Matter

add_component(entity: int, component: snecs.component.Component)[source]

Add a component to the entity

add_immunity(entity: int, immunity_name: str, duration: int)[source]

Add an immunity to an Entity’s Immunities Component. If entity has no Immunities Component one will be added.

apply_affliction(affliction: scripts.engine.internal.action.Affliction)bool[source]

Apply the affliction’s effects. Returns True is successful if criteria to trigger the affliction was met, False if not.

apply_damage(entity: int, damage: int)bool[source]

Remove damage from entity’s health. Return True is damage was applied.

apply_skill(skill: scripts.engine.internal.action.Skill)bool[source]

Resolve the skill’s effects. Returns True is successful if criteria to apply skill was met, False if not.

calculate_damage(base_damage: int, damage_mod_amount: int, resist_value: int, hit_type: HitTypeType)int[source]

Work out the damage to be dealt.

calculate_to_hit_score(attacker_accuracy: int, skill_accuracy: int, stat_to_target_value: int)int[source]

Get the to hit score based on the stats of both entities and a random roll.

can_use_skill(entity: int, skill_name: str)bool[source]

Check if entity can use skill. Checks cooldown and resource affordability.

choose_target(entity: int)Optional[int][source]

Choose an appropriate target for the entity. N.B. CURRENTLY JUST RETURNS PLAYER

create_actor(actor_data: scripts.engine.internal.definition.ActorData, spawn_pos: Tuple[int, int], is_player: bool = False)int[source]

Create an entity with all of the components to be an actor. Returns entity ID.

create_affliction(name: str, creator: int, target: int, duration: int)scripts.engine.internal.action.Affliction[source]

Creates an instance of an Affliction provided the name

create_delayed_skill(creating_entity: int, tile_pos: Tuple[int, int], data: scripts.engine.internal.definition.DelayedSkillData)int[source]

Create an entity with all of the components to be a delayed skill. Returns Entity ID.

create_effect(origin: int, target: int, data: scripts.engine.internal.definition.EffectData)scripts.engine.core.effect.Effect[source]

Create an effect from effect data.

create_entity(components: Optional[List[snecs.component.Component]] = None)int[source]

Use each component in a list of components to create an entity

create_god(god_data: scripts.engine.internal.definition.GodData)int[source]

Create an entity with all of the components to be a god. god_name must be in the gods json file.

create_light(pos: Tuple[int, int], radius: int, colour: Tuple[int, int, int], alpha: int)str[source]

Create a Light and add it to the current GameMap’s Lightbox. Pos is the world position - the light will handle scaling to screen. Returns the light_id of the Light.

create_pathfinder()tcod.path.Pathfinder[source]

Create an empty pathfinder using the current game map

create_projectile(creating_entity: int, tile_pos: Tuple[int, int], data: scripts.engine.internal.definition.ProjectileData)int[source]

Create an entity with all of the components to be a projectile. Returns entity ID.

create_terrain(terrain_data: scripts.engine.internal.definition.TerrainData, spawn_pos: Tuple[int, int], lifespan: int = 999)int[source]

Create terrain

delete_entity(entity: int)[source]

Queues entity for removal from the world_objects. Happens at the next run of process.

entity_has_immunity(entity: int, name: str)bool[source]

Check if an entity has immunity to the named Action.

get_affected_entities(target_pos: Tuple[int, int], shape: ShapeType, shape_size: int, shape_direction: Optional[Tuple[int, int]] = None)[source]

Return a list of entities that are within the shape given, using target position as a centre point. Entity must have Position, Resources to be eligible.

get_entities_on_tile(tile: scripts.engine.world_objects.tile.Tile)List[int][source]

Return a list of all the entities in that tile

get_entitys_component(entity: int, component: Type[_C])_C[source]

Get an entity’s component. Will raise exception if entity does not have the component. Use entity_has_component to check.

get_hit_type(to_hit_score: int)HitTypeType[source]

Get the hit type from the to hit score

get_known_skill(entity: int, skill_name: str)Type[scripts.engine.internal.action.Skill][source]

Get an entity’s known skill from their Knowledge component.

get_name(entity: int)str[source]

Get an entity’s Identity component’s name.

get_player()int[source]

Get the player.

kill_entity(entity: int)[source]

Add entity to the deletion stack and removes them from the turn queue.

learn_skill(entity: int, skill_name: str)[source]

Add the skill name to the entity’s knowledge component.

pay_resource_cost(entity: int, resource: ResourceType, cost: int)bool[source]

Remove the resource cost from the using entity

remove_affliction(entity: int, affliction: scripts.engine.internal.action.Affliction)[source]

Remove affliction from active list and undo any stat modification.

remove_component(entity: int, component: Type[snecs.component.Component])[source]

Remove a component from the entity

set_skill_on_cooldown(entity: int, skill_name: str, cooldown_duration: int)[source]

Sets an entity’s skill on cooldown.

spend_time(entity: int, time_spent: int)bool[source]

Add time_spent to the entity’s total time spent.

take_turn(entity: int)bool[source]

Process the entity’s Thought component. If no component found then EndTurn event is fired.

trigger_affliction(affliction: scripts.engine.internal.action.Affliction)[source]

Trigger the affliction on the affected entity.

use_skill(user: int, skill: Type[scripts.engine.internal.action.Skill], target_tile: scripts.engine.world_objects.tile.Tile, direction: DirectionType)bool[source]

Use the specified skill on the target tile, usually creating a projectile. Returns True is successful if criteria to use skill was met, False if not.