Skip to content

AbilityReward ​

Inherits: Reward < Resource

Grants an ability to the player

Properties ​

intgranted_ability_id0
AbilityDestinationability_destinationAbilityDestination.ADD_ACTIVE
intinitial_rank1

Methods ​

Dictionaryapply_to_player( player: Player )
boolunapply_from_player( player: Player, tracking_data: Dictionary )
boolsupports_unapply()
boolshould_apply_on_load()
Stringget_summary()
Array[Dictionary]validate()

Enumerations ​

enum AbilityDestination ​

The options of ability destination: replace basic, add active, add passive.

  • REPLACE_BASIC = 0
  • ADD_ACTIVE = 1

Property descriptions ​

int granted_ability_id = 0 ​

The ability to grant

AbilityDestination ability_destination = AbilityDestination.ADD_ACTIVE ​

Where the ability goes: it replaces the basic attack, or is added to the active or to the passive abilities

int initial_rank = 1 ​

The rank the ability starts at (1 = the first; the ability's highest rank is its limit). Later ranks come from Ability Rank rewards

Method descriptions ​

Dictionary apply_to_player( player: Player ) ​

Gives the reward to the player. Gives back how it went and what it needs to take the reward back.

bool unapply_from_player( player: Player, tracking_data: Dictionary ) ​

Takes the reward back from the player (only for a reward that supports it).

bool supports_unapply() ​

Can the reward be taken back?

bool should_apply_on_load() ​

Is the reward given again when a save is loaded (the ability is put back)?

String get_summary() ​

A short text about the reward and its settings.

Array[Dictionary] validate() ​

Checks the settings of the reward. Gives the problems found (empty when it is fine).