core.components.event.actions.combat module

class core.components.event.actions.combat.Combat[source]

Bases: object

Checks to see if the player has any monsters fit for battle.

Param:None
Return type:Bool
Returns:True/False
random_encounter(game, action)[source]

Randomly starts a battle with a monster defined in the “encounter” table in the “monster.db” database. The chance that this will start a battle depends on the “encounter_rate” specified in the database. The “encounter_rate” number is the chance walking in to this tile will trigger a battle out of 100.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: encounter_id

start_battle(game, action)[source]

Start a battle and switch to the combat module. The parameters must contain an NPC id in the NPC database.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • action (Tuple) – The action (tuple) retrieved from the database that contains the action’s parameters
Return type:

None

Returns:

None

Valid Parameters: npc_id

Examples:

>>> action.__dict__
{
    "type": "start_battle",
    "parameters": [
        "1"
    ]
}
start_pseudo_battle(game, npc)[source]

Start a networked duel and switch to the combat module.

Parameters:
  • game (core.control.Control) – The main game object that contains all the game’s variables.
  • npc (core.components.player.Npc) – The NPC to fight if fighting a specific character.
Return type:

None

Returns:

None