ActiveAbilityDefinition ​
Inherits: PassiveAbilityDefinition < AbilityDefinition < DatabaseResource < Resource
Inherited by: ChargeStackActiveAbilityDefinition, ComboActiveAbilityDefinition, PowerUpActiveAbilityDefinition
ActiveAbilityDefinition with integrated Requirement system Active abilities are player-triggered abilities that consume resources and have cooldowns They require targeting and use strategies to determine how they execute
Properties ​
TargetStrategyDefinition | targeting_strategy_definition | |
UseStrategyDefinition | use_strategy_definition | |
Array[int] | on_use_effects | [] |
int | ability_school | 0 |
HitRule | hit_rule | HitRule.PROJECT_DEFAULT |
AttackStyle | attack_style | AttackStyle.AUTOMATIC |
bool | on_global_cooldown | true |
float | cooldown_duration | 0.0 |
bool | use_weapon_speed_as_cooldown | false |
float | on_use_effects_delay | 0.0 |
bool | strip_passive_on_inactive | true |
String | cost_pool_type | "No Cost" |
int | cost_pool_id | 0 |
float | cost_amount | 0.0 |
String | gain_pool_type | "No Cost" |
int | gain_pool_id | 0 |
float | gain_amount | 0.0 |
AmmoSource | ammo_source | AmmoSource.NONE |
int | ammo_amount | 1 |
int | ammo_item_id | 0 |
int | ammo_group_id | 0 |
int | ammo_currency_id | 0 |
Methods ​
Array[Effect] | get_current_on_use_effects( ability_instance: AbilityInstance ) |
void | handle_completion( ability_instance: AbilityInstance ) |
AbilityInstance.AbilityUseAttemptResult | validate_ability_usage( ability_instance: AbilityInstance, from_action: bool ) |
float | get_effective_cooldown_duration( ability_instance: AbilityInstance ) |
bool | can_be_interrupted() |
float | get_execution_duration() |
float | get_max_range() |
bool | requires_line_of_sight() |
Dictionary | check_requirements( user: Entity ) |
bool | meets_requirements( user: Entity ) |
String | get_requirement_failure_message( user: Entity ) |
Dictionary | get_cost_info() |
Dictionary | get_gain_info() |
bool | has_costs() |
bool | has_gains() |
String | get_tooltip_description() |
Enumerations ​
enum HitRule ​
Whether an ability makes a hit roll against the enemies it reaches (see GameplayConfig, Hit Rules)
- PROJECT_DEFAULT =
0- Follows the game settings: it can miss when the project uses the hit system - ALWAYS_HITS =
1- Never misses, whatever the project says (a spell that cannot be dodged, a sure strike) - CAN_MISS =
2- Can miss even when the project does not use the hit system: only some abilities of the game roll to hit
enum AttackStyle ​
Whether an attack is melee or ranged: it picks the base chance to hit and the stat effects that apply
- AUTOMATIC =
0- Melee when the range of the ability is at most the melee range of the game settings, ranged beyond - MELEE =
1 - RANGED =
2
enum AmmoSource ​
The options of ammo source: none, equipped ammo, item, item group, currency.
- NONE =
0- no ammo or reagent is spent - EQUIPPED_AMMO =
1- the ammo equipped in the ammo slot (the player chooses it), of the group the weapon shoots - ITEM =
2- a specific item from the inventory (a reagent) - ITEM_GROUP =
3- any item of a group from the inventory - CURRENCY =
4- a currency
Property descriptions ​
Strategy Definitions
TargetStrategyDefinition targeting_strategy_definition ​
Defines how this ability selects and validates targets (self, enemy, point, etc.)
UseStrategyDefinition use_strategy_definition ​
Defines how this ability executes over time (instant, cast, channel, toggle)
On Use Effects
Array[int] on_use_effects = [] ​
Effects applied to the target when this ability is activated.
General
int ability_school = 0 ​
School/category of this ability for dispel/immunity purposes (fire, healing, physical, etc.) References a SchoolTypeDefinition resource by ID
HitRule hit_rule = HitRule.PROJECT_DEFAULT ​
Can this ability miss? Project default: it can when the game settings use the hit system; Can miss makes it roll even when they do not, Always hits never. The hit roll is made once per use against each enemy it reaches
AttackStyle attack_style = AttackStyle.AUTOMATIC ​
Melee or ranged (Automatic: by its range). The base chance to hit and the accuracy and evasion effects can differ for each
bool on_global_cooldown = true ​
Whether this ability triggers the global cooldown that affects other abilities
float cooldown_duration = 0.0 ​
Base cooldown duration in seconds before ability can be used again
bool use_weapon_speed_as_cooldown = false ​
If true, uses weapon attack speed as cooldown instead of cooldown_duration
float on_use_effects_delay = 0.0 ​
Delay in seconds before on-use effects are applied after the ability fires. Use this to align effect application with hit animations - e.g. a melee swing that visually lands 0.3s after the ability activates. Has no effect on passive_effects.
bool strip_passive_on_inactive = true ​
If true, passive effects (inherited from PassiveAbilityDefinition) are removed when requirements are no longer met. If false, passive effects persist even while inactive - useful for proc-to-activate patterns where the passive enables its own condition.
Pool Actions
String cost_pool_type = "No Cost" ​
Type of resource pool this ability consumes (No Cost, Resource Pool, Health Pool)
int cost_pool_id = 0 ​
ID of the specific pool to consume from (references PoolDefinition)
float cost_amount = 0.0 ​
Amount of resources to consume when using this ability
String gain_pool_type = "No Cost" ​
Type of resource pool this ability grants to (No Cost, Resource Pool, Health Pool)
int gain_pool_id = 0 ​
ID of the specific pool to grant resources to (references PoolDefinition)
float gain_amount = 0.0 ​
Amount of resources to grant when using this ability (combo points, rage, etc.)
Ammo and Reagents
AmmoSource ammo_source = AmmoSource.NONE ​
What this ability spends a piece of every time it is used
int ammo_amount = 1 ​
How many pieces (arrows, reagents, coins) every use takes
int ammo_item_id = 0 ​
The item spent when the source is Item
int ammo_group_id = 0 ​
The group of items spent when the source is Item Group
int ammo_currency_id = 0 ​
The currency spent when the source is Currency
Method descriptions ​
Array[Effect] get_current_on_use_effects( ability_instance: AbilityInstance ) ​
Return the resolved on-use effects for this ability. Respects live_effects overrides on the instance if present.
void handle_completion( ability_instance: AbilityInstance ) ​
Override to add active ability specific validation Active abilities complete the standard way (cooldown, resource gain, state, ability_used); the passive base class that this extends has no completion logic
AbilityInstance.AbilityUseAttemptResult validate_ability_usage( ability_instance: AbilityInstance, from_action: bool ) ​
Checks whether the user can use the ability now (not incapacitated, silenced ...). Gives the result.
float get_effective_cooldown_duration( ability_instance: AbilityInstance ) ​
Get the effective cooldown duration for this ability Handles weapon speed cooldowns and runtime overrides
bool can_be_interrupted() ​
Check if this ability can be interrupted during casting/channeling
float get_execution_duration() ​
Get the cast/channel duration for this ability
float get_max_range() ​
Get the maximum range of this ability
bool requires_line_of_sight() ​
Check if this ability requires line of sight to target
Dictionary check_requirements( user: Entity ) ​
Check if user meets all requirements to use this ability
bool meets_requirements( user: Entity ) ​
Quick check: can this ability be used by the specified user?
String get_requirement_failure_message( user: Entity ) ​
Get failure message for why requirements aren't met
Dictionary get_cost_info() ​
Get comprehensive cost information for UI display
Dictionary get_gain_info() ​
Get comprehensive gain information for UI display
bool has_costs() ​
Check if this ability has any resource costs
bool has_gains() ​
Check if this ability grants any resources
String get_tooltip_description() ​
The text of the tooltip, with the cost and the cooldown.