Action

class Action[source]

Bases: abc.ABC

Action taken during the game. A container for Effects.

class Affliction(origin: int, affected_entity: int, duration: int)[source]

Bases: scripts.engine.internal.action.Action

A subclass of Affliction represents an affliction (a semi-permanent modifier) and holds all the data that is not dependent on the individual instances - stuff like applicable targets etc.

An instance of Affliction represents an individual application of that affliction, and holds only the data that is tied to the individual use - stuff like the user and target.

__init__(origin: int, affected_entity: int, duration: int)[source]

Initialize self. See help(type(self)) for accurate signature.

apply()Iterator[Tuple[EntityID, List[Effect]]][source]

Apply the affliction to the affected entity. An iterator over pairs of (affected entity, [effects]). Use affected entity position. Applies to each entity only once.

trigger()[source]

Trigger the affliction on the affected entity

class Behaviour(attached_entity: int)[source]

Bases: abc.ABC

Base class for AI behaviours. Not really an Action, as such, more of a super class that determines when npcs will use Actions.

__init__(attached_entity: int)[source]

Initialize self. See help(type(self)) for accurate signature.

abstract act()[source]

Perform the behaviour

class DelayedSkill(attached_entity: int)[source]

Bases: scripts.engine.internal.action.Behaviour

After duration ends trigger skill centred on self.

__init__(attached_entity: int)[source]

Initialize self. See help(type(self)) for accurate signature.

act()[source]

Perform the behaviour

class Projectile(attached_entity: int)[source]

Bases: scripts.engine.internal.action.Behaviour

Move in direction, up to max_range (in tiles). Speed is time spent per tile moved.

__init__(attached_entity: int)[source]

Initialize self. See help(type(self)) for accurate signature.

act()[source]

Perform the behaviour

class Skill(user: int, target_tile: scripts.engine.world_objects.tile.Tile, direction: DirectionType)[source]

Bases: scripts.engine.internal.action.Action

A subclass of Skill represents a skill and holds all the data that is not dependent on the individual cast - stuff like shape, base accuracy, etc.

An instance of Skill represents an individual use of that skill, and additionally holds only the data that is tied to the individual use - stuff like the user and target.

__init__(user: int, target_tile: scripts.engine.world_objects.tile.Tile, direction: DirectionType)[source]

Initialize self. See help(type(self)) for accurate signature.

apply()Iterator[Tuple[EntityID, List[Effect]]][source]

An iterator over pairs of (affected entity, [effects]). Uses target tile. Can apply to an entity multiple times.

use()bool[source]

If uses_projectile then create a projectile to carry the skill effects. Otherwise call self.apply

class SkillModifier(owner)[source]

Bases: abc.ABC

The base class for blessings. Blessings modify skills through the effects applied.

__init__(owner)[source]

Initialize self. See help(type(self)) for accurate signature.

apply(effects: List[scripts.engine.core.effect.Effect], owner, target)[source]

This is the core function of the blessing. It takes the effect stack and modifies it with the blessing.

property involved_effects

Get the set of effects involved in the blessing.

roll_level()[source]

Runs the level selection algorithm and updates attributes with the applied level.

set_level(level)[source]

Refreshes the class attributes with the data for the specific blessing level.

register_action(cls: Type[Union[Action, Behaviour, SkillModifier]])[source]

Initialises the class properties set by external data, if appropriate, and adds to the action registry for use by the engine.