Safe Haskell | None |
---|---|
Language | Haskell2010 |
Actors in the game: heroes, monsters, etc.
Synopsis
- data Actor = Actor {}
- data ResDelta = ResDelta {
- resCurrentTurn :: (Int64, Int64)
- resPreviousTurn :: (Int64, Int64)
- type ActorMaxSkills = EnumMap ActorId Skills
- data Watchfulness
- deltasSerious :: ResDelta -> Bool
- deltasHears :: ResDelta -> Bool
- deltaBenign :: ResDelta -> Bool
- deltaWasBenign :: ResDelta -> Bool
- actorCanMelee :: ActorMaxSkills -> ActorId -> Actor -> Bool
- gearSpeed :: Skills -> Speed
- actorTemplate :: ItemId -> Int64 -> Int64 -> Point -> LevelId -> FactionId -> Bool -> Actor
- actorWaits :: Actor -> Bool
- actorWaitsOrSleeps :: Actor -> Bool
- actorDying :: Actor -> Bool
- hpTooLow :: Actor -> Skills -> Bool
- calmEnough :: Actor -> Skills -> Bool
- hpEnough :: Actor -> Skills -> Bool
- hpFull :: Actor -> Skills -> Bool
- canSleep :: Skills -> Bool
- prefersSleep :: Skills -> Bool
- checkAdjacent :: Actor -> Actor -> Bool
- eqpOverfull :: Actor -> Int -> Bool
- eqpFreeN :: Actor -> Int
- type ActorDict = EnumMap ActorId Actor
- monsterGenChance :: AbsDepth -> AbsDepth -> Int -> Int -> Rnd Bool
- smellTimeout :: Delta Time
The Acto
r type, its components and operations on them
Actor attributes that are changing throughout the game. If they appear to be dublets of aspects from actor kinds, e.g. HP, they may be results of casting the dice specified in their respective actor kind and/or may be modified temporarily, but return to the original value from their respective kind over time.
Other properties of an actor, in particular its current aspects, are derived from the actor's trunk, organs and equipment. A class of the aspects, the boolean ones, are called flags. Another class are skills. Stats are a subclass that determines if particular actions are permitted for the actor (or faction).
Actor | |
|
Instances
Representation of recent changes to HP of Calm of an actor. This is reset every time the actor perfoms an action, so this is aggregated over actor turn (move), not time turn. The resource changes recorded in the tuple are, respectively, negative and positive.
ResDelta | |
|
Instances
Eq ResDelta Source # | |
Show ResDelta Source # | |
Generic ResDelta Source # | |
Binary ResDelta Source # | |
type Rep ResDelta Source # | |
Defined in Game.LambdaHack.Common.Actor type Rep ResDelta = D1 (MetaData "ResDelta" "Game.LambdaHack.Common.Actor" "LambdaHack-0.9.3.1-inplace" False) (C1 (MetaCons "ResDelta" PrefixI True) (S1 (MetaSel (Just "resCurrentTurn") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Int64, Int64)) :*: S1 (MetaSel (Just "resPreviousTurn") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Int64, Int64)))) |
data Watchfulness Source #
Instances
deltasSerious :: ResDelta -> Bool Source #
deltasHears :: ResDelta -> Bool Source #
deltaBenign :: ResDelta -> Bool Source #
deltaWasBenign :: ResDelta -> Bool Source #
actorCanMelee :: ActorMaxSkills -> ActorId -> Actor -> Bool Source #
actorTemplate :: ItemId -> Int64 -> Int64 -> Point -> LevelId -> FactionId -> Bool -> Actor Source #
actorWaits :: Actor -> Bool Source #
actorWaitsOrSleeps :: Actor -> Bool Source #
actorDying :: Actor -> Bool Source #
prefersSleep :: Skills -> Bool Source #
Can't loot, so sometimes prefers to sleep instead of exploring.
Assorted
type ActorDict = EnumMap ActorId Actor Source #
All actors on the level, indexed by actor identifier.
monsterGenChance :: AbsDepth -> AbsDepth -> Int -> Int -> Rnd Bool Source #
Chance that a new monster is generated. Depends on the number of monsters already present, and on the level depth and its cave kind.
smellTimeout :: Delta Time Source #
How long until an actor's smell vanishes from a tile.