Skip to content

CurrencyReward ​

Inherits: Reward < Resource

Grants currency to the player's inventory

Properties ​

intcurrency_id
intamount100

Methods ​

Dictionaryapply_to_player( player: Player )
boolunapply_from_player( player: Player, tracking_data: Dictionary )
boolsupports_unapply()
Stringget_summary()
voidset_currency_reward( currency_def: int, reward_amount: int )
Array[Dictionary]validate()

Property descriptions ​

int currency_id ​

The currency to grant

int amount = 100 ​

How much of the currency to grant (above 0)

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?

String get_summary() ​

A short text about the reward and its settings.

void set_currency_reward( currency_def: int, reward_amount: int ) ​

Sets the currency and the amount the reward gives.

Array[Dictionary] validate() ​

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