LambdaHack- A game engine library for roguelike dungeon crawlers

Safe HaskellNone




Actors in the game: heroes, monsters, etc. No operation in this module involves the State or Action type.


Actor identifiers and related operations

data ActorId Source

A unique identifier of an actor in the dungeon.

monsterGenChance :: AbsDepth -> AbsDepth -> Int -> Int -> Rnd Bool Source

Chance that a new monster is generated. Currently depends on the number of monsters already present, and on the level. In the future, the strength of the character and the strength of the monsters present could further influence the chance, and the chance could also affect which monster is generated. How many and which monsters are generated will also depend on the cave kind used to build the level.

partActor :: Actor -> Part Source

The part of speech describing the actor.

partPronoun :: Actor -> Part Source

The part of speech containing the actor pronoun.

The Actor type

data Actor Source

Actor properties that are changing throughout the game. If they are dublets of properties from ActorKind, they are usually modified temporarily, but tend to return to the original value from ActorKind over time. E.g., HP.




btrunk :: !ItemId
bsymbol :: !Char

individual map symbol

bname :: !Text

individual name

bpronoun :: !Text

individual pronoun

bcolor :: !Color

individual map color

btime :: !Time

absolute time of next action

bhp :: !Int64

current hit points * 1M

bhpDelta :: !ResDelta

HP delta this turn * 1M

bcalm :: !Int64

current calm * 1M

bcalmDelta :: !ResDelta

calm delta this turn * 1M

bpos :: !Point

current position

boldpos :: !(Maybe Point)

previous position, if any

blid :: !LevelId

current level

boldlid :: !LevelId

previous level

bfid :: !FactionId

faction the actor currently belongs to

bfidImpressed :: !FactionId

the faction actor is attracted to

bfidOriginal :: !FactionId

the original faction of the actor

btrajectory :: !(Maybe ([Vector], Speed))

trajectory the actor must travel and his travel speed

borgan :: !ItemBag


beqp :: !ItemBag

personal equipment

binv :: !ItemBag

personal inventory

bwait :: !Bool

is the actor waiting right now?

bproj :: !Bool

is a projectile? (shorthand only, this can be deduced from bkind)


data ResDelta Source




resCurrentTurn :: !Int64

resource change this player turn

resPreviousTurn :: !Int64

resource change last player turn

actorTemplate :: ItemId -> Char -> Text -> Text -> Color -> Int64 -> Int64 -> Point -> LevelId -> Time -> FactionId -> Actor Source

A template for a new actor.

braced :: Actor -> Bool Source

Whether an actor is braced for combat this clip.

waitedLastTurn :: Actor -> Bool Source

The actor waited last turn.

unoccupied :: [Actor] -> Point -> Bool Source

Checks for the presence of actors in a position. Does not check if the tile is walkable.


type ActorDict = EnumMap ActorId Actor Source

All actors on the level, indexed by actor identifier.

smellTimeout :: Delta Time Source

How long until an actor's smell vanishes from a tile.