Abilities

**Ability creation** is one of the main aspects of Popup Dungeon and often one of the first steps when designing a new hero or enemy. There are three main categories of abilities: Normal ones, passives and reactions (also called commands if they can execute at any time). Normal abilities and reactions need four things to work properly: A name, image (preferably 448x648 resolution), ability media and at least one executable action (like dealing damage or applying a buff). Passives do not require an ability media, they trigger automatically at the beginning of the turn with no animation.

## The Ability Creation Menu

The ability creation menu contains three tabs - Main, Logic and Cosmetic - which we will explore in the following.

### Main Properties

The main properties of an ability are the best way to increase an ability's base power (besides negatives, conditions and reactions set in the Logic tab, see below). Base power always starts at 20 (for spending an card slot if you want) and acts as an multiplier to the caster's power when determining the actual statistics of an ability. This bonus factor can be calculated as: 1 + [(Ability Power - 20) / 100]. Power added to an ability via Upgrade Books during a run does *not* contribute to this multiplier.

Note: The Rank of an Ability acts as a multiplier to the final power calculation of an ability (i.e. after the activator's power has been added and targets defenses have been subtracted). Each rank increases power by 5%.

#### Activation Costs

This tab defines the most basic properties of any ability. First of: Is it an active or passive ability? Passives trigger automatically each turn, cost always 0 AP and can only target its user.

Active abilities on the other hand have a set action point (AP) cost and possibly a charge time, cooldown or limited uses per battle. All of these settings increase the ability's overall power, but also restrict its use in some way or the other. The minimum settings are 1 AP, no charge time, a one-turn cooldown and 0 (unlimited) uses per battle. The AP cost is shown in the upper left corner of the ability's card and all non-standard settings for charge, cooldown and uses are shown in the right middle across from the range seal.

Most vanilla abilities cost between 2 and 5 AP, have no charge time, a cooldown of one or two turns and often three or unlimited uses per battle.

Each AP grants 20 base power, charge, cooldown and number of uses give a different amount of base power, as shown below.

 1
 2
 3

\*a limited number of use may contribute less power if the ability has been granted temporary to the user

#### Range

Next up is setting an ability's range, going from 0 (self) up to 10 tiles. Abilities with a wide range of targets are less powerful and scale faster with a high aim statistic than abilities with a shorter range. The only value of importance here is the difference between minimum and maximum range, not the size of the possibly affected area - so an ability with a range of 5-9 has the same power as a 1-5 ranged ability. While it might seem tempting to prefer higher ranges to cover a potentially larger area, a lot of combats are resolved in close- to mid-range.

An ability can additionally ignore line of sight (LoS) which will cost some power, while an ability that can only target in a straight line will gain some. An active ability always displays a non-zero range in the middle left side of its card in red for a LoS obeying ability and in green if ignoring LoS. A straight white line under the range indicates that the ability works in a straight line only.

#### Area Of Effect

The last part of the main tab shows 25 squares representing the tiles affected by the ability and a little arrow inside a circle representing the origin of the ability. The origin can be dragged and dropped and each of the tiles can be toggled to be targeted or not. When executed, the ability's origin has to be in inside the defined range while the affected tiles do not - which allows to create 0 range abilities which can still affect other entities if additional tiles beside the origin are targeted. Each additional tile will cost some power depending on its distance from the origin and the number of total tiles affected.

The button next to the AoE allows to set if a LoS between origin and affected tile is necessary or not (which will cost additional power unless all tiles affected are guaranteed to be in LoS).

### Logic Properties

This tab defines the actions executed by an ability and consists at first of only one part: A blank space with a little yellow plus-button, allowing to select up to 4 actions, conditions or reactions for an ability, each with its own set of parameters. Actions and certain reactions consume power, while conditions and most reactions add power to their connected actions by limiting the use of the ability. A reactive condition always apply to the ability as a whole, while conditions can be restricted to single actions. To apply a condition to an action, simply drag and drop it beneath the condition. You can copy any action or condition by holding the Alt-key.

When selecting a single logic, you will see a little menu popping up below, showing a whole range of different parameters to work with. The most important parameters (if available) are:

* Source & Type (all actions) - Defines which power source the ability draws from (except raw power or support). An action based on magical air for example becomes stronger with a high magical power, elemental power and air power stat of the caster.
* Placement (all actions except *swap position*) - Defines the target of an action. The action can affect the caster (self),only the ability's origin (origin) all entities in an affected tile (target) or might place a trap or tile marker on all affected tiles (tile/trap). Traps can only trigger once but are stronger than tiles and have a lower upkeep (power per round placed) than tile effects.
* Weight (all actions) - Defines how much power from the pool is used for this action in comparison with others.
* Variance (all actions) - Adds a random factor ranging from 1-[variance] to 1+[variance] to the action's power when executed.
* Duration (all actions) - This defines how long a (de-)buff or status is applied to a target and whether a damaging or kill effect is only executed once or spread out over multiple turns (increasing total damage but lowering the damage per turn dealt).
* Delay (all actions) - Sets a delay for an action in turns, increasing the power of the action.
* Inflicted Status (status action, condition & reaction) - Sets the kind of status to inflict, to have or to react to.
* Chance to react (all reactions) - Acts like a built-in chance condition, increasing the ability's power by setting a limited chance to react each time the conditions are met.
* Can trigger on your own turn (all reactions) - Changes a reaction into a command, which can trigger during your own turn and are especially useful if an ability is to be given to enemy via *give ability*.
* Fixed duration (status actions and *give ability*) - Instead of calculating the duration of a status or give ability action based on the caster's power and the target's defenses (if hostile), the action is always carried out with a certain chance to inflict a status/give an ability for a fixed duration. This will add power to the action performed as it limits its potential later on.

#### Reactions and Commands

Reactions set specific triggers which will force the owner to cast them if possible out of his turn. A reaction can be turned into a command, which will also force the ability to activate during the owner's turn (this is always necessary if a reaction includes the [on start/end of your own turn]. Currently, changing a reaction to a command does not cost any power, but might do so in future builds. If a new reaction is added to an ability, it will automatically replace the old one.

See also the creator video here

#### The Actual Strength of an Action

The system will always show a preview of the ability in question, using the statistics of the currently selected entity. You can set the entity (hero or enemy), its rank and the rank of the ability at the right bottom of the screen (usually the ability's rank automatically scales with the level of the entity, but you can overwrite this). Take into account, that there is currently no preview taking the defenses of a potential target into account, so your new ability might be more or less effective in combat! This is especially important, when balancing the power of status effects: What seems like a certain action (100% to stun, kill, daze, etc.) will turn into a chance even for the puniest of defense, if the ability is "too optimized". The most important stats to overcome when attacking are defense (which might only act against specific sources or for specific directions) and resistance (which only works against actions using the support stat). If an action's outcome depends on additional (defensive) statistics, this will be noted in the table below. If an action's strength is based on support, the effect might be diminished if applied to the caster by himself (to prevent exponential stacking buffs).

#### Logic restrictions

There are restrictions to the logic availability of passive abilities. Passives cannot be made with Summon and Resurrection actions, likely intended to prevent possible cases of unlimited ally spawning or revival loops. Passives cannot be made with Siphon Health, Transfer Damage, Steal Statistic, Move Self, Orient, Swap Position, Guard or Transfer Effects actions, most likely as they could not be used effectively as a result of the target restrictions. Comparison and Cumulative conditions, cannot be applied to passives, either, nor can Last Move Distance or Position Relative To Target conditions, or reactions in general. The Number of Targets condition cannot have its requirement of 2 area of effect tiles to be toggled on for a passive ability, thus it can't be used.

### The Cosmetic Part

At last (or maybe right at the beginning), you will want to choose a nice image for your ability to be displayed on the card (and possibly on all trap or tiles placed by the ability) and select an animation (which is a full blown requirement, except for passives).

You can select any of the standard images or import your own right away (for fair use of third party media)! If the picture chosen for your ability is too big to fit, you can drag & drop it in this menu to adjust its positioning. You can choose an animation right below the image settings (or go and create a new one) and check right away if it looks good by clicking [Play Ability Media] in the lower right menu.

At last, you can also select the color of the card's trim and border to add a personal touch.

## Tips & Tricks

### Things to Keep in Mind

* When creating abilities for new enemies, remember to set their power level correctly during preview. You don't have to worry about a novice entity not being able to use your elite-rank ability efficiently, but you also don't want to wonder why your perfectly balanced stun attack suddenly doesn't work anymore if used by an adept. Additionally, enemies can have additional strengths and weaknesses based on their rank which you might want to check.
* Granted abilities may not profit as much from limited uses as normal abilities do, but they are still empowered. If you plan on creating an ability specifically for getting granted, you might want to add limited uses.
* Stolen statistics remain even if the target has already died, this can be useful when targeting dying allies or allied summons as these do not apply their defense/resistance against the action, allowing for an easy net increase in party power. Same goes for transferred debuffs.
* A lot of conditions do not work together with negatives if there positive effects are also part of the ability. This is to prevents creating too strong supporting abilities with easy to avoid drawbacks. If the system prevents you from saving your new ability, check your conditions and try to remove negatives.
* Most self-inflicted negatives for range 0 abilities are very weak and might not fit with your idea (e.g. a self-destruct that will trigger a kill status in 3 turns). It is currently possible to trick the system using reactions: A reaction with range 0-1 and the target setting <self> can inflict much greater negatives than normally possible (tested for PCs and the kill-status).
* If you're not happy with how the AI handles some of your abilities, you can try to turn them into commands and reactions. For example, when using an attack including a <orient away> and another attack which only works on the back on the target, the AI might always go for the back shot right away, wasting AP on movement instead of using the first ability. Turning the backshot into a command <When an enemy turns their back on you> might help.
* Picking a nice animation for charging abilities might be tricky sometimes, because the charge animation is currently based on the first few dozens frames of the animation. This might lead to strange results if using fast moving, jumping casting animations like the smoke bomb (the entity wobbles wildly in midair all the time while charging).
* Debuffing SELF in an ability can be used to reduce AP cost or cooldown etc. While not powering down the ability as much, Debuffing yourself basically strengthens the rest of the ability most of the time to balance it.
* Due to the effect of Very Sudden Death damaging allies starting at Round 10 a battle is not expected to last longer than fifteen rounds. Please take into mind this when making abilities, especially abilities that summon or transform characters/enemies.

## Detailed Statistics

* Loss of power in dependence of the distance of the targeted tile from the origin of the ability. An ability ignoring LoS is about 15 percentage points weaker.
* Relative power loss and maximum damage dealt by a 10 AP ability with no base power in dependence of the number of targeted tiles at distance of 2 from the origin. Obeying LoS makes a noticeable difference for the maximum damage output, but has a much lower chance of actually using this potential.
* Relative power of an AoE ability for 4 and 8 affected tiles at a distance of 1 and 2 tiles from the origin in dependence of the caster's focus (normed for a "minor strength: focus" entity with 11% focus).