core.components.event.conditions.npc module

class core.components.event.conditions.npc.Npc[source]

Bases: object

facing_npc(game, condition)[source]

Checks to see the player is next to and facing a particular NPC

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: npc_name

Examples:

>>> condition.__dict__
{
    "type": "facing_npc",
    "parameters": [
        "Oak"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 0,
    "y": 0,
    ...
}
npc_at(game, condition)[source]

Checks to see if an npc 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": "npc_at",
    "parameters": [
        "Maple",
        "6",
        "9"
    ],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 6,
    "y": 9,
    ...
}
npc_exists(game, condition)[source]

Checks to see if a particular NPC object exists in the current list of NPCs.

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: npc_name

Examples:

>>> condition.__dict__
{
    "type": "npc_exists",
    "parameters": [
        "Oak"
    ],
    "width": 1,
    "height": 1,
    "operator": "is_not",
    "x": 0,
    "y": 0,
    ...
}
npc_facing(game, condition)[source]

Checks to see where an NPC 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: npc_name, direction (“up”, “down”, “left” or “right”)

Examples:

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

Checks to see if an NPC 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": ["Maple"],
    "width": 1,
    "height": 1,
    "operator": "is",
    "x": 6,
    "y": 9,
    ...
}