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

Safe HaskellNone

Game.LambdaHack.Perception

Description

Actors perceiving other actors and the dungeon level.

Synopsis

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.