Safe Haskell | None |
---|---|
Language | Haskell2010 |
Actors in the game: heroes, monsters, etc.
Synopsis
- data Actor = Actor {
- btrunk :: ItemId
- bnumber :: Maybe Int
- bhp :: Int64
- bhpDelta :: ResDelta
- bcalm :: Int64
- bcalmDelta :: ResDelta
- bpos :: Point
- boldpos :: Maybe Point
- blid :: LevelId
- bfid :: FactionId
- btrajectory :: Maybe ([Vector], Speed)
- borgan :: ItemBag
- beqp :: ItemBag
- bweapon :: Int
- bweapBenign :: Int
- bwatch :: Watchfulness
- bproj :: Bool
- data ResDelta = ResDelta {
- resCurrentTurn :: (Int64, Int64)
- resPreviousTurn :: (Int64, Int64)
- type ActorMaxSkills = EnumMap ActorId Skills
- data Watchfulness
- deltasSerious :: ResDelta -> Bool
- deltasSeriousThisTurn :: ResDelta -> Bool
- deltasHears :: ResDelta -> Bool
- deltaBenign :: ResDelta -> Bool
- deltaWasBenign :: ResDelta -> Bool
- actorCanMelee :: ActorMaxSkills -> ActorId -> Actor -> Bool
- actorCanMeleeToHarm :: ActorMaxSkills -> ActorId -> Actor -> Bool
- actorWorthChasing :: ActorMaxSkills -> ActorId -> Actor -> Bool
- actorWorthKilling :: ActorMaxSkills -> ActorId -> Actor -> Bool
- gearSpeed :: Skills -> Speed
- actorTemplate :: ItemId -> Maybe Int -> Int64 -> Int64 -> Point -> LevelId -> FactionId -> Bool -> Actor
- actorWaits :: Actor -> Bool
- actorWaitsOrSleeps :: Actor -> Bool
- actorDying :: Actor -> Bool
- hpTooLow :: Actor -> Skills -> Bool
- calmEnough :: Actor -> Skills -> Bool
- calmFull :: Actor -> Skills -> Bool
- hpFull :: Actor -> Skills -> Bool
- canSleep :: Skills -> Bool
- prefersSleep :: Skills -> Bool
- checkAdjacent :: Actor -> Actor -> Bool
- eqpOverfull :: Actor -> Int -> Bool
- eqpFreeN :: Actor -> Int
- getCarriedIidsAndTrunk :: Actor -> [ItemId]
- getCarriedIidCStore :: Actor -> [(ItemId, CStore)]
- type ActorDict = EnumMap ActorId Actor
- monsterGenChance :: AbsDepth -> AbsDepth -> Int -> Int -> Int
- 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.11.0.0-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 #
deltasSeriousThisTurn :: ResDelta -> Bool Source #
deltasHears :: ResDelta -> Bool Source #
deltaBenign :: ResDelta -> Bool Source #
deltaWasBenign :: ResDelta -> Bool Source #
actorCanMelee :: ActorMaxSkills -> ActorId -> Actor -> Bool Source #
actorCanMeleeToHarm :: ActorMaxSkills -> ActorId -> Actor -> Bool Source #
actorWorthChasing :: ActorMaxSkills -> ActorId -> Actor -> Bool Source #
actorWorthKilling :: ActorMaxSkills -> ActorId -> Actor -> Bool Source #
actorTemplate :: ItemId -> Maybe Int -> Int64 -> Int64 -> Point -> LevelId -> FactionId -> Bool -> Actor Source #
actorWaits :: Actor -> Bool Source #
actorWaitsOrSleeps :: Actor -> Bool Source #
actorDying :: Actor -> Bool Source #
Projectile that ran out of steam or collided with obstacle, dies. Even if it pierced through an obstacle, but lost its payload while altering the obstacle during piercing, it dies, too.
calmEnough :: Actor -> Skills -> Bool Source #
Check if actor calm enough to perform some actions.
If max Calm is zero, always holds, to permit removing disastrous equipped items, which would otherwise be stuck forever.
prefersSleep :: Skills -> Bool Source #
Can't loot, not too aggresive, so sometimes prefers to sleep instead of exploring.
getCarriedIidsAndTrunk :: Actor -> [ItemId] Source #
Assorted
type ActorDict = EnumMap ActorId Actor Source #
All actors on the level, indexed by actor identifier.
monsterGenChance :: AbsDepth -> AbsDepth -> Int -> Int -> Int Source #
Chance, in parts per million, that a new monster is generated. Depends on the number of monsters already present, and on the level depth and its cave kind.
Note that sometimes monsters spawn in groups, increasing danger, but many monsters are generated asleep, decreasing initial danger.
smellTimeout :: Delta Time Source #
How long until an actor's smell vanishes from a tile.