LambdaHack-0.2.0: A roguelike game engine in early and very active development

Safe HaskellNone

Game.LambdaHack.ActorState

Description

Operations on the Actor type that need the State type, but not the Action type. TODO: Add an export list and document after it's rewritten according to #17.

Synopsis

Documentation

findActorAnyLevel :: ActorId -> State -> (LevelId, Actor, [Item])Source

Finds an actor body on any level. Fails if not found.

absentHero :: ActorId -> State -> BoolSource

Checks whether an actor is a hero, but not a member of the party.

allHeroesAnyLevel :: State -> [(ActorId, LevelId)]Source

The list of actors and their levels for all heroes in the dungeon.

targetToLoc :: IntSet -> State -> Maybe PointSource

Calculate the location of player's target.

memActor :: ActorId -> State -> BoolSource

Checks if the actor is present on the current level.

getActor :: ActorId -> State -> ActorSource

Gets actor body from the current level. Error if not found.

getActorItem :: ActorId -> State -> [Item]Source

Gets actor's items from the current level. Empty list, if not found.

deleteActor :: ActorId -> State -> StateSource

Removes the actor, if present, from the current level.

insertActor :: ActorId -> Actor -> State -> StateSource

Add actor to the current level.

deletePlayer :: State -> StateSource

Removes a player from the current level and party list.

locToActor :: Point -> State -> Maybe ActorIdSource

Finds an actor at a location on the current level. Perception irrelevant.

addHero :: COps -> Point -> State -> StateSource

Create a new hero on the current level, close to the given location.

initialHeroes :: COps -> Point -> State -> StateSource

Create a set of initial heroes on the current level, at location ploc.

addMonster :: Ops TileKind -> Id ActorKind -> Int -> Point -> State -> StateSource

Create a new monster in the level, at a given position and with a given actor kind and HP.

calculateTotal :: Ops ItemKind -> State -> IntSource

Calculate loot's worth for heroes on the current level.