Actors perceiving other actors and the dungeon level.
- type DungeonPerception = [(LevelId, Perception)]
- data Perception
- totalVisible :: Perception -> IntSet
- debugTotalReachable :: Perception -> IntSet
- dungeonPerception :: COps -> State -> DungeonPerception
- 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
The type representing the perception for all levels in the dungeon.
The type representing the perception of all actors on the level.
Note: Heroes share visibility and only have separate reachability. The pplayer field must be void on all levels except where he resides. Right now, the field is used only for player-controlled monsters.
For debug only: the set of tiles reachable (would be visible if lit) by at least one hero.
Calculate the perception of all actors on the level.
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).
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.,
Defaults to false if neither actor is player-controlled.
Whether a monster can see a hero (
False if the target has
no perceptions, e.g., not a hero or a hero without perception, due
to being spawned on the same turn by a monster and then seen by another).
An approximation, to avoid computing FOV for the monster.