-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a Combat Entity
Creating Combat Entities is not very hard--unlike Abilities, they don't contain any sub-objects. That said, if you haven't read up on creating Items and Abilities, you will want to do so before reading this page.
-
id(int)- The ID of the Combat Entity. This must be unique.
-
name(String) -
resources(Array[String])- An array of Strings. These strings should be formatted as a String-int pair. These values correspond to Resource Name-Resource Max. For example, if the resource was Health and had a maximum value of 100, the String would be
"Health,100".
- An array of Strings. These strings should be formatted as a String-int pair. These values correspond to Resource Name-Resource Max. For example, if the resource was Health and had a maximum value of 100, the String would be
-
abilities(Array[String])- An array of Strings corresponding to defined JSON ability names.
- What is an Ability?
- How to define a JSON ability?
-
combat_xp_yield(int)- The amount of XP dropped by the Entity when killed. Must be positive.
-
opening_dialog(String) ("")- This string gets printed at the start of combat.
-
closing_dialog(String) ("")- This string gets printed at the end of combat. &
-
inventory(Array[String]) ([])- An array of strings. Each String should be formatted as an id-quantity pair. For example, for an item with id 13 and quantity 5, the string would be
"13,5".
- An array of strings. Each String should be formatted as an id-quantity pair. For example, for an item with id 13 and quantity 5, the string would be
-
equipment_ids(Array[int]) ([])- Each int in this array should correspond to the ID of a piece of Equipment. Be aware that you may only include a maximum of one Equipment of each slot type.
-
speed(int) (0)- Higher speed equates to earlier execution in turn order. Must be positive.
- Recommendation: if you want your player to always go first, set player speed property to 1 and don't set any other entity speed.
-
level(int) (1)- Must be greater than zero.
- These fields may appear in any order within the actual JSON object.
- The value adjacent to each listed field is its default value and is applied whenever that field is omitted.
Here are some examples for JSON Combat Entities. We'll start with something simple.
Small Blue Slime is a simple Combat Entity that knows two Abilities. It has an empty inventory, no equipment, and an XP yield of 20.
{
"id" : 2,
"name" : "Small Blue Slime",
"opening_dialog" : "*plop*",
"closing_dialog" : "",
"inventory" : []
"equipment_ids" : [],
"combat_xp_yield" : 20,
"resources" : ["Health,30", "Stamina,30", "Mana,5"],
"abilities" : ["Bounce", "Water Shot"],
"speed" : 2,
"level" : 1
}
Note that a Combat Entity that doesn't know any Abilities will simply have its turn skipped.
Here's a slightly more complex Combat Entity. This entity has a series of items in its inventory.
{
"id" : 1,
"name" : "Frank, Mastermind in the Coil",
"opening_dialog" : "Mwleh, Charlie, I gotta go to the playground, don't follow me!",
"closing_dialog" : "It's Saturday coming up, kids are gonna be here!",
"inventory" : ["1,13", "2,6", "3,7", "4,3", "5,2"],
"equipment_ids" : [],
"combat_xp_yield" : 69,
"resources" : ["Health,55", "Stamina,30", "Mana,200"],
"abilities" : ["Dupe", "Bomb-Threat"],
"speed" : 2,
"level" : 30
}
Say we have created a series of equipment and would like to create a Combat Entity that uses then.
Iron Leggings (id 12)
Iron Helm (id 13)
Steel Mace (id 14)
Mithril Boots (id 15)
Here is what a Combat Entity looks like when it is wearing that equipment
{
"id" : 5,
"name" : "Runescape Noob",
"opening_dialog" : "Why can't I equip a Rune Plate Mail?",
"closing_dialog" : "Thats not fair!",
"inventory" : [],
"equipment_ids" : [12, 13, 14, 15],
"combat_xp_yield" : 69,
"resources" : ["Health,55", "Stamina,30", "Mana,200"],
"abilities" : ["Trim", "Complain"],
"speed" : 0,
"level" : 28
}
You can put the equipment IDs in any order you want. If you put more than one equipment of the same slot type in the equipment_ids array, only the last one of that type will be equipped.