Safe Haskell | None |
---|---|
Language | Haskell2010 |
Actors perceiving other actors and the dungeon level.
Visibility works according to KISS. Everything that player sees is real. There are no unmarked hidden tiles and only solid tiles can be marked, so there are no invisible walls and to pass through an illusory wall, you have to use a turn bumping into it first. Only tiles marked with Suspect can turn out to be another tile. (So, if all tiles are marked with Suspect, the player knows nothing for sure, but this should be avoided, because searching becomes too time-consuming.) Each actor sees adjacent tiles, even when blind, so adjacent tiles are known, so the actor can decide accurately whether to pass thorugh or alter, etc.
Items are always real and visible. Actors are real, but can be invisible. Invisible actors in walls can't be hit, but are hinted at when altering the tile, so the player can flee or block. Invisible actors in open space can be hit.
Synopsis
- newtype PerVisible = PerVisible {}
- newtype PerSmelled = PerSmelled {}
- data Perception = Perception {
- psight :: PerVisible
- psmell :: PerSmelled
- type PerLid = EnumMap LevelId Perception
- type PerFid = EnumMap FactionId PerLid
- totalVisible :: Perception -> EnumSet Point
- totalSmelled :: Perception -> EnumSet Point
- emptyPer :: Perception
- nullPer :: Perception -> Bool
- addPer :: Perception -> Perception -> Perception
- diffPer :: Perception -> Perception -> Perception
Documentation
newtype PerVisible Source #
Visible positions.
Instances
Eq PerVisible Source # | |
Defined in Game.LambdaHack.Common.Perception (==) :: PerVisible -> PerVisible -> Bool # (/=) :: PerVisible -> PerVisible -> Bool # | |
Show PerVisible Source # | |
Defined in Game.LambdaHack.Common.Perception showsPrec :: Int -> PerVisible -> ShowS # show :: PerVisible -> String # showList :: [PerVisible] -> ShowS # | |
Binary PerVisible Source # | |
Defined in Game.LambdaHack.Common.Perception |
newtype PerSmelled Source #
Smelled positions.
Instances
Eq PerSmelled Source # | |
Defined in Game.LambdaHack.Common.Perception (==) :: PerSmelled -> PerSmelled -> Bool # (/=) :: PerSmelled -> PerSmelled -> Bool # | |
Show PerSmelled Source # | |
Defined in Game.LambdaHack.Common.Perception showsPrec :: Int -> PerSmelled -> ShowS # show :: PerSmelled -> String # showList :: [PerSmelled] -> ShowS # | |
Binary PerSmelled Source # | |
Defined in Game.LambdaHack.Common.Perception |
data Perception Source #
The type representing the perception of a faction on a level.
Instances
type PerLid = EnumMap LevelId Perception Source #
Perception of a single faction, indexed by level identifier.
type PerFid = EnumMap FactionId PerLid Source #
Perception indexed by faction identifier.
This can't be added to FactionDict
, because clients can't see it
for other factions.
totalVisible :: Perception -> EnumSet Point Source #
The set of tiles visible by at least one hero.
totalSmelled :: Perception -> EnumSet Point Source #
The set of tiles smelt by at least one hero.
nullPer :: Perception -> Bool Source #
addPer :: Perception -> Perception -> Perception Source #
diffPer :: Perception -> Perception -> Perception Source #