Skip to content

TakeCurrencyAction ​

Inherits: PlayerEventAction < EventAction < Resource

Action that takes currency from player(s): a fee, a bribe, the meat a quest asks for when a currency stands for it.

Properties ​

intcurrency_id0
intamount1
boolall_or_nothingtrue

Methods ​

Stringget_player_function_description()
boolexecute_on_players( players: Array[Player] )
Dictionarysave()
voidload_data( data: Dictionary )

Property descriptions ​

int currency_id = 0 ​

The currency to take

int amount = 1 ​

How much to take

bool all_or_nothing = true ​

Take nothing when the player has less than that (on), or take what they have (off). The action fails when nothing could be taken from a player

Method descriptions ​

String get_player_function_description() ​

The sentence the editor shows for the action, with {placeholders} for its values.

bool execute_on_players( players: Array[Player] ) ​

Takes the currency from each player. With all or nothing set, nobody pays unless every player can. False when it fails.

Dictionary save() ​

The state of the action for a save.

void load_data( data: Dictionary ) ​

Restores the state of the action from a save.