core.components.event.conditions.core module

class core.components.event.conditions.core.Core[source]

Bases: object

button_pressed(game, condition)[source]

Checks to see if a particular key was pressed

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • condition (Dictionary) – A dictionary of condition details. See core.components.map.Map.loadevents() for the format of the dictionary.
Return type:

Boolean

Returns:

True or False

Valid Parameters: A pygame key (E.g. “K_RETURN”)

Examples:

>>> condition.__dict__
{
    "type": "button_pressed",
    "parameters": [
        "K_RETURN"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 2,
    "y": 2,
    ...
}
button_released(game, condition)[source]

Checks to see if a particular key was released

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • condition (Dictionary) – A dictionary of condition details. See core.components.map.Map.loadevents() for the format of the dictionary.
Return type:

Boolean

Returns:

True or False

Valid Parameters: A pygame key (E.g. “K_RETURN”)

Examples:

>>> condition.__dict__
{
    "type": "button_released",
    "parameters": [
        "K_RETURN"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 2,
    "y": 2,
    ...
}
dialog_open(game, condition)[source]

Checks to see if a dialog window is open.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • condition (Dictionary) – A dictionary of condition details. See core.components.map.Map.loadevents() for the format of the dictionary.
Return type:

Boolean

Returns:

True or False

Valid Parameters: None

Examples:

>>> condition.__dict__
{
    "type": "dialog_open",
    "parameters": []
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 2,
    "y": 2,
    ...
}
true(game, condition)[source]

This function always returns true unless the operator is set to “is_not”

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • condition (Dictionary) – A dictionary of condition details. See core.components.map.Map.loadevents() for the format of the dictionary.
Return type:

Boolean

Returns:

True or False

variable_set(game, condition)[source]

Checks to see if a player game variable has been set. This will look for a particular key in the player.game_variables dictionary and see if it exists. If it exists, it will return true.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • condition (Dictionary) – A dictionary of condition details. See core.components.map.Map.loadevents() for the format of the dictionary.
Return type:

Boolean

Returns:

True or False

Valid Parameters: variable_name:value

Examples:

>>> condition.__dict__
{
    "type": "variable_set",
    "parameters": [
        "battle_won:yes"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 2,
    "y": 2,
    ...
}