Safe Haskell | None |
---|
Actors perceiving other actors and the dungeon level.
- data Perception
- totalVisible :: Perception -> IntSet
- debugTotalReachable :: Perception -> IntSet
- perception :: COps -> State -> Perception
- actorReachesLoc :: ActorId -> Point -> Perception -> Maybe ActorId -> Bool
- actorReachesActor :: ActorId -> ActorId -> Point -> Point -> Perception -> Maybe ActorId -> Bool
- monsterSeesHero :: Ops TileKind -> Perception -> Level -> ActorId -> ActorId -> Point -> Point -> Bool
Documentation
data Perception Source
The type representing the perception of all actors on the level.
totalVisible :: Perception -> IntSetSource
The set of tiles visible by at least one hero.
debugTotalReachable :: Perception -> IntSetSource
For debug only: the set of tiles reachable (would be visible if lit) by at least one hero.
perception :: COps -> State -> PerceptionSource
Calculate the perception of all actors on the level.
actorReachesLoc :: ActorId -> Point -> Perception -> Maybe ActorId -> BoolSource
Check whether a location is within the visually reachable area of the given actor (disregarding lighting). Defaults to false if the actor is not player-controlled (monster or hero).
actorReachesActor :: ActorId -> ActorId -> Point -> Point -> Perception -> Maybe ActorId -> BoolSource
Check whether an actor is within the visually reachable area
of the given actor (disregarding lighting).
Not quite correct if FOV not symmetric (e.g., Shadow
).
Defaults to false if neither actor is player-controlled.
monsterSeesHero :: Ops TileKind -> Perception -> Level -> ActorId -> ActorId -> Point -> Point -> BoolSource
Whether a monster can see a hero (False
if the target is not a hero).
An approximation, to avoid computing FOV for the monster.
If the target actor has no FOV pre-computed, we assume it can't be seen.