core.components.event.conditions.player module

class core.components.event.conditions.player.Player[source]

Bases: object

party_size(game, condition)[source]

Perform various checks about the player’s party size. With this condition you can see if the player’s party is less than, greater than, or equal to then number you specify.

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: check,party_size

The “check” parameter can be one of the following: “equals”, “less_than”, or “greater_than”.

Examples:

>>> condition.__dict__
{
    "type": "party_size",
    "parameters": [
        "less_than",
        "2"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 6,
    "y": 9,
    ...
}
player_at(game, condition)[source]

Checks to see if the player is at a current position on the map.

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

Examples:

>>> condition.__dict__
{
    "type": "player_at",
    "parameters": [
        "6",
        "9"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 6,
    "y": 9,
    ...
}
player_facing(game, condition)[source]

Checks to see where the player is facing

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.map.Map.loadevents() for the format of the dictionary.
Return type:

Boolean

Returns:

True or False

Valid Parameters: direction (“up”, “down”, “left” or “right”)

Examples:

>>> condition.__dict__
{
    "type": "player_facing",
    "parameters": [
        "up"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 6,
    "y": 9,
    ...
}
player_facing_tile(game, condition)[source]

Checks to see the player is facing a tile position

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

Examples:

>>> condition.__dict__
{
    "type": "facing_tile",
    "parameters": [],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 6,
    "y": 9,
    ...
}
player_moved(game, condition)[source]

Checks to see the player has just moved into this tile. Using this condition will prevent a condition like “player_at” from constantly being true every single frame.

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": "player_moved",
    "parameters": [],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 6,
    "y": 9,
    ...
}