Safe Haskell | Safe-Infered |
---|
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
Documentation
type DungeonPerception = [(LevelId, Perception)]Source
The type representing the perception for all levels in the dungeon.
data Perception Source
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.
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.
dungeonPerception :: COps -> State -> DungeonPerceptionSource
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 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.