Safe Haskell | None |
---|
Actors in the game: monsters and heroes. No operation in this module
involves the State
or Action
type.
- type ActorId = Int
- findHeroName :: ConfigUI -> Int -> Text
- monsterGenChance :: Int -> Int -> Rnd Bool
- partActor :: Ops ActorKind -> Actor -> Part
- data Actor = Actor {}
- template :: Id ActorKind -> Maybe Char -> Maybe Text -> Int -> Point -> Time -> Id FactionKind -> Bool -> Actor
- addHp :: Ops ActorKind -> Int -> Actor -> Actor
- timeAddFromSpeed :: Ops ActorKind -> Actor -> Time -> Time
- braced :: Actor -> Time -> Bool
- unoccupied :: [Actor] -> Point -> Bool
- heroKindId :: Ops ActorKind -> Id ActorKind
- projectileKindId :: Ops ActorKind -> Id ActorKind
- actorSpeed :: Ops ActorKind -> Actor -> Speed
- data Target
Actor identifiers and related operations
findHeroName :: ConfigUI -> Int -> TextSource
Find a hero name in the config file, or create a stock name.
monsterGenChance :: 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 | |
|
template :: Id ActorKind -> Maybe Char -> Maybe Text -> Int -> Point -> Time -> Id FactionKind -> Bool -> ActorSource
A template for a new non-projectile actor. The initial target is invalid to force a reset ASAP.
timeAddFromSpeed :: Ops ActorKind -> Actor -> Time -> TimeSource
Add time taken by a single step at the actor's current speed.
unoccupied :: [Actor] -> Point -> BoolSource
Checks for the presence of actors in a location. Does not check if the tile is walkable.
actorSpeed :: Ops ActorKind -> Actor -> SpeedSource
Access actor speed, individual or, otherwise, stock.