Safe Haskell | None |
---|
Actors in the game: heroes, monsters, etc. No operation in this module
involves the State
or Action
type.
- data ActorId
- monsterGenChance :: Int -> Int -> Int -> Rnd Bool
- partActor :: Actor -> Part
- data Actor = Actor {}
- actorTemplate :: Id ActorKind -> Char -> Text -> Color -> Speed -> Int -> Maybe [Vector] -> Point -> LevelId -> Time -> FactionId -> Bool -> Actor
- timeAddFromSpeed :: Actor -> Time -> Time
- braced :: Actor -> Time -> Bool
- waitedLastTurn :: Actor -> Time -> Bool
- unoccupied :: [Actor] -> Point -> Bool
- heroKindId :: Ops ActorKind -> Id ActorKind
- projectileKindId :: Ops ActorKind -> Id ActorKind
- type ItemBag = EnumMap ItemId Int
- type ItemInv = EnumMap InvChar ItemId
- newtype InvChar = InvChar {}
- type ItemDict = EnumMap ItemId Item
- type ItemRev = HashMap Item ItemId
- allLetters :: [InvChar]
- assignLetter :: ItemId -> Maybe InvChar -> Actor -> Maybe InvChar
- letterLabel :: InvChar -> Part
- letterRange :: [InvChar] -> Text
- rmFromBag :: Int -> ItemId -> ItemBag -> ItemBag
- type ActorDict = EnumMap ActorId Actor
- smellTimeout :: Time
- mapActorItems_ :: Monad m => (ItemId -> Int -> m a) -> Actor -> m ()
Actor identifiers and related operations
A unique identifier of an actor in the dungeon.
monsterGenChance :: Int -> Int -> Int -> Rnd BoolSource
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.
The Acto
r type
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.
Actor | |
|
actorTemplate :: Id ActorKind -> Char -> Text -> Color -> Speed -> Int -> Maybe [Vector] -> Point -> LevelId -> Time -> FactionId -> Bool -> ActorSource
A template for a new actor.
timeAddFromSpeed :: Actor -> Time -> TimeSource
Add time taken by a single step at the actor's current speed.
braced :: Actor -> Time -> BoolSource
Whether an actor is braced for combat this clip. If a foe
moves just after this actor in the same time moment, the actor won't block,
because bwait
is reset to zero in ageActorA
before the condition
is checked.
waitedLastTurn :: Actor -> Time -> BoolSource
The actor most probably waited at most a turn ago (unless his speed was changed, etc.)
unoccupied :: [Actor] -> Point -> BoolSource
Checks for the presence of actors in a position. Does not check if the tile is walkable.
Inventory management
type ItemDict = EnumMap ItemId ItemSource
All items in the dungeon (including in actor inventories), indexed by item identifier.
type ItemRev = HashMap Item ItemIdSource
Reverse item map, for item creation, to keep items and item identifiers in bijection.
allLetters :: [InvChar]Source
assignLetter :: ItemId -> Maybe InvChar -> Actor -> Maybe InvCharSource
Assigns a letter to an item, for inclusion in the inventory of a hero. Tries to to use the requested letter, if any.
letterLabel :: InvChar -> PartSource
letterRange :: [InvChar] -> TextSource
Assorted
How long until an actor's smell vanishes from a tile.