Skip to content

Creating an Ability

GuyDarel edited this page Nov 12, 2021 · 25 revisions

Properties Of Abilities

Required Properties

  • name(String)
    • Name of the Ability
  • target_mode (String)
    • What type of entities the Ability can target
    • Available target_mode values are: SINGLE,SINGLE_HOSTILE,SINGLE_FRIENDLY,ALL,ALL_FRIENDLY,ALL_HOSTILE,SELF
  • description (String)
    • The description of the Ability
  • use_text (String)
    • The text that is printed in Combat when the Ability is used
    • use_text strings have some special formatting available. For example, if you would like to include the name of the entity that is casting the Ability in the use text, simply put {CASTER} there. Similarly, if you would like to place the target's name in the use text, you can put {TARGET} into your use_text field.

Optional Properties

  • damage (int) (0)
    • The amount of damage an ability deals.
    • must be a non-negative
  • effects (Array[Combat Effect]) ([])
    • The effects array may only contain Combat Effect elements. For more information on how to write a Combat Effect with JSON, see Combat Effect.
  • requirements (Array[Requirement]) ([])
    • The requirements array may only contain Requirement elements. For more information on how to write a Requirement with JSON, see Requirement.
  • resource_cost (Array[String]) ([])
    • All Strings in the resource_cost array must be formatted specifically like so "<resource_name>,<quantity>" without the <>. For example, "Health,50".

Notes

  • 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.
  • In the event that the caster does not have enough resources to pay for the ability cost, the ability will not be chosen.

Examples

Here are some examples for how to write an Ability using JSON. These examples demonstrate the basics of how to design an Ability.

Simplest Ability

This is the most basic ability that can be designed. When inspected, Splash's description text is displayed. When used, splash displays the use_text. It targets the user but does no damage to the user and doesn't apply any combat effect to the user because none are specified.

{
  "name" : "Splash",
  "target_mode" : "SELF",
  "description" : "Splash a bit of water, do nothing.",
  "use_text" : "{CASTER} flicks a small amount of water into the air, nobody seams to notice."
}
Expanded

This splash is the expanded version of the above splash, it functions identically. damage effects requirements and resource_cost are all optional parameters and have default values that match the values listed below.

{
  "name" : "Splash",
  "target_mode" : "SELF",
  "description" : "Splash a bit of water, do nothing.",
  "use_text" : "{CASTER} flicks a small amount of water into the air, nobody seams to notice.",
  "damage" : 0,
  "effects" : [],
  "requirements" : [],
  "resource_cost" : []
}

Basic Abilities

Damage

Smack can target exactly one entity hostile to the caster. It deals 100 damage.

{
  "name" : "Smack",
  "target_mode" : "SINGLE_HOSTILE",
  "description" : "The target 'finna catch these hands'",
  "use_text" : "{CASTER} smacks {TARGET} so hard it alters {TARGET}'s DNA.",
  "damage" : 100
}
Resource Cost

Blast targets all hostiles simultaneously. It deals 100 damage to each target and costs 50 Mana from the caster.

{
  "name" : "Blast",
  "target_mode" : "ALL_HOSTILE",
  "description" : "EXPLOOOOOOSION!",
  "use_text" : "{CASTER} annihilates all enemies with explosion magic, devastating the enemies.",
  "damage" : 100,
  "resource_cost" : ["Mana,50"]
}

Inversion can target exactly one entity from among all entities (this includes hostiles, allies, and self). It deals 90 damage and costs 90 Health and 10 Stamina from the caster.

{
  "name" : "Inversion",
  "target_mode" : "SINGLE",
  "description" : "Converts the user's life force into raw energy, damaging the target.",
  "use_text" : "{CASTER} drains away its life forcing, hurling it at {TARGET}",
  "damage" : 90,
  "resource_cost" : ["Health,90", "Stamina,10"]
}

Intermediate Abilities

Now that you've gotten the hang of creating basic abilities, lets take the next step and add some Combat Effects.

Combat Effect

Optical Pat-Down can target any entity in Combat and deals 30 damage to that entity. Optical Pat-Down has one Combat Effect: Restores 10% of the effect's owner's Stamina for 1 turn. For more information on how to write a Combat Effect with JSON, see Combat Effect.

{
  "name" : "Optical Pat-Down",
  "target_mode" : "SINGLE",
  "description" : "Assesses the HOSTILE with rough-shod accuracy.",
  "use_text" : "{CASTER} visually assesses {TARGET}... with questionable accuracy.",
  "damage" : 30,
  "effects" : [
    {
      "class_name" : "ProportionalResourceEffect",
      "duration"  : 1,
      "trigger_phase" : "PRE_ACTION",
      "trigger_message" : "{OWNER} gains the energy to act after being audibly misjudged. (Stamina +10%)",
      "cleanup_message" : "",
      "properties": ["Stamina,0.10"]
    }
  ],
  "resource_cost" : ["Stamina,10"]
},
Requirement

Rock Shot deals 7 damage to its target and costs 2 Stamina from its caster. It has one Requirement: Rock Shot may only be used if its caster has at least one item with ID of 1 in its inventory. In the test environment, the Item with ID on 1 is "Rock". For more information on how to write a Requirement with JSON, see Requirement.

{
  "name" : "Rock Shot",
  "target_mode" : "SINGLE_HOSTILE",
  "description" : "Throw a stone at the target with pin-point precision.",
  "use_text" : "{CASTER} forcefully throws a rock at {TARGET}.",
  "damage" : 7,
  "requirements" : [
    {
      "class_name" : "ItemRequirement",
      "properties" : ["1"]
    }
  ],
  "resource_cost" : ["Stamina,2"]
}

Advanced Abilities

Order of Operations

Lupine Form targets self and costs 1 Mana from its caster. It has one Requirement: it can only be used while the Full Moon flag is set. It has four Combat Effects:

  1. Skip the next two turns' POST_ACTION phases (triggers on each ACTION phase).
  2. Increase Mana to 0% (triggers on ACTION phase).
  3. Decrease Health to 0% for 3 turns (triggers on each POST_ACTION phase).
  4. Increase Health to 100% for 2 turns (triggers on each POST_ACTION phase).
  • If a phase is skipped for any number of turns effects that would trigger during that phase are delayed for that many turns
  • Effects that trigger in the same phase of an entity's turn resolve in order of first applied.
  • An entity cannot die until health is checked at the end of the turn.

The ability results in this 5 turn sequence.

  1. Cast Lupine Form, Skip POST_ACTION phase, and set Mana to 0%.

  2. Skip POST_ACTION phase

  3. Set Health to 100%.

  4. Set Health to 100%.

  5. Set Health to 0%.

    { "name" : "Lupine Form", "target_mode" : "SELF", "description" : "Use all Mana to get two turns of effect slowing followed by two turns of Max Health followed by death.", "use_text" : "Red stained fur sprouts violently from under {CASTER}'s skin. (+effect slowing, +100% Health in 2 turns, and death in 5 turns)", "effects" : [ { "class_name" : "RemovePhaseEffect", "duration" : 2, "trigger_phase" : "ACTION", "trigger_message" : "{OWNER} is unaffected by status effects while adjusting to transformation", "cleanup_message" : "{OWNER} is reborn a lycan", "properties": ["POST_ACTION"] }, { "class_name" : "ProportionalResourceEffect", "duration" : 1, "trigger_phase" : "ACTION", "trigger_message" : "", "cleanup_message" : "", "properties": ["Mana,-1"] }, { "class_name" : "ProportionalResourceEffect", "duration" : 3, "trigger_phase" : "POST_ACTION", "trigger_message" : "", "cleanup_message" : "{OWNER}'s transformation breaks", "properties": ["Health,-1"] }, { "class_name" : "ProportionalResourceEffect", "duration" : 2, "trigger_phase" : "POST_ACTION", "trigger_message" : "", "cleanup_message" : "{OWNER}'s transformation weakens", "properties": ["Health,1"] } ], "requirements" : [ { "class_name" : "FlagRequirement", "properties" : ["Full Moon"] } ], "resource_cost" : ["Mana,1"] }

Getting Started

JSON Formatting Guide

Embedded JSON Structures

Designing Your Game

Clone this wiki locally