LambdaHack- A game engine library for roguelike dungeon crawlers

Safe HaskellNone



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.



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

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



:: 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 -> BoolSource

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 -> ActorSource

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

getLocalTime :: LevelId -> State -> TimeSource

Get current time from the dungeon data.

itemPrice :: (Item, Int) -> IntSource

Price an item, taking count into consideration.

radiusBlind :: Int -> BoolSource

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.