LambdaHack-0.2.6.5: A roguelike game engine in early and active development

Safe HaskellNone

Game.LambdaHack.Perception

Description

Actors perceiving other actors and the dungeon level.

Synopsis

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.

actorSeesActor :: Ops TileKind -> Perception -> Level -> ActorId -> ActorId -> Point -> Point -> ActorId -> BoolSource

Whether an actor can see another. An approximation.