LambdaHack-0.2.14: A roguelike game engine in early development

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.ActorState

Description

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

Synopsis

Documentation

calculateTotal :: Actor -> State -> (ItemBag, Int) Source

Calculate loot's worth for a faction of a given actor.

whereTo Source

Arguments

:: LevelId

level of the stairs

-> Point

position of the stairs

-> Int

jump up this many levels

-> Dungeon

current game dungeon

-> (LevelId, Point)

target level and the position of its receiving stairs

Compute the level identifier and starting position on the level, after a level change.

posToActor :: Point -> LevelId -> State -> Maybe ((ActorId, Actor), [(ItemId, Item)]) Source

Finds an actor at a position on the current level.

memActor :: ActorId -> LevelId -> State -> Bool Source

Checks if the actor is present on the current level. The order of argument here and in other functions is set to allow

b <- getsState (memActor a)

getActorBody :: ActorId -> State -> Actor Source

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

getLocalTime :: LevelId -> State -> Time Source

Get current time from the dungeon data.

itemPrice :: (Item, Int) -> Int Source

Price an item, taking count into consideration.

radiusBlind :: Int -> Bool Source

Determine if the sight radius is high enough to deem the actor capable of projecting items and similar activities. Otherwise, the actor is assumed to use a combination of peripherial vision, hearing, etc., and not the actual focused, long-distance sight sense.