tuxemon.event.actions.random_integer module

final class tuxemon.event.actions.random_integer.RandomIntegerAction(var, lower_bound, upper_bound)[source]

Bases: EventAction

Randomly choose an integer between 2 numbers (inclusive), and set the key in the player.game_variables dictionary to be this value.

For example, ‘random_integer xyz,1,6’ will set the value of the game variable ‘xyz’ to be either 1, 2, 3, 4, 5, or 6.

Script usage

random_integer <variable>,<lower_bound>,<upper_bound>
Script parameters:
  • variable – Name of the variable.

  • lower_bound – Lower bound of range to return an integer between (inclusive)

  • upper_bound – Upper bound of range to return an integer between (inclusive)

Parameters:
  • var (str) –

  • lower_bound (int) –

  • upper_bound (int) –

lower_bound: int
name: ClassVar[str] = 'random_integer'
start()[source]

Called only once, when the action is started.

For all actions, you will need to override this method.

For actions that only need to run one frame you can simply put all the code here. If the action will need to run over several frames, you can init your action here, then override the update method.

Return type:

None

upper_bound: int
var: str