Safe Haskell | None |
---|---|
Language | Haskell2010 |
Operations concerning dungeon level tiles.
Unlike for many other content types, there is no type Tile
,
of particular concrete tiles in the dungeon,
corresponding to TileKind
(the type of kinds of terrain tiles).
This is because the tiles are too numerous and there's not enough
storage space for a well-rounded Tile
type, on one hand,
and on the other hand, tiles are accessed
too often in performance critical code
to try to compress their representation and/or recompute them.
Instead, of defining a Tile
type, we express various properties
of concrete tiles by arrays or sparse EnumMaps, as appropriate.
Actors at normal speed (2 m/s) take one turn to move one tile (1 m by 1 m).
- type SmellTime = Time
- kindHasFeature :: Feature -> TileKind -> Bool
- hasFeature :: Ops TileKind -> Feature -> Id TileKind -> Bool
- isClear :: Ops TileKind -> Id TileKind -> Bool
- isLit :: Ops TileKind -> Id TileKind -> Bool
- isWalkable :: Ops TileKind -> Id TileKind -> Bool
- isPassable :: Ops TileKind -> Id TileKind -> Bool
- isPassableNoSuspect :: Ops TileKind -> Id TileKind -> Bool
- isDoor :: Ops TileKind -> Id TileKind -> Bool
- isSuspect :: Ops TileKind -> Id TileKind -> Bool
- isExplorable :: Ops TileKind -> Id TileKind -> Bool
- lookSimilar :: TileKind -> TileKind -> Bool
- speedup :: Bool -> Ops TileKind -> TileSpeedup
- openTo :: Ops TileKind -> Id TileKind -> Rnd (Id TileKind)
- closeTo :: Ops TileKind -> Id TileKind -> Rnd (Id TileKind)
- embedItems :: Ops TileKind -> Id TileKind -> [GroupName ItemKind]
- causeEffects :: Ops TileKind -> Id TileKind -> [Effect]
- revealAs :: Ops TileKind -> Id TileKind -> Rnd (Id TileKind)
- hideAs :: Ops TileKind -> Id TileKind -> Id TileKind
- isOpenable :: Ops TileKind -> Id TileKind -> Bool
- isClosable :: Ops TileKind -> Id TileKind -> Bool
- isChangeable :: Ops TileKind -> Id TileKind -> Bool
- isEscape :: Ops TileKind -> Id TileKind -> Bool
- isStair :: Ops TileKind -> Id TileKind -> Bool
- ascendTo :: Ops TileKind -> Id TileKind -> [Int]
- data TileSpeedup = TileSpeedup {
- isClearTab :: !Tab
- isLitTab :: !Tab
- isWalkableTab :: !Tab
- isPassableTab :: !Tab
- isPassableNoSuspectTab :: !Tab
- isDoorTab :: !Tab
- isSuspectTab :: !Tab
- isChangeableTab :: !Tab
- data Tab
- createTab :: Ops TileKind -> (TileKind -> Bool) -> Tab
- accessTab :: Tab -> Id TileKind -> Bool
Documentation
The last time a hero left a smell in a given tile. To be used by monsters that hunt by smell.
kindHasFeature :: Feature -> TileKind -> Bool Source
Whether a tile kind has the given feature.
hasFeature :: Ops TileKind -> Feature -> Id TileKind -> Bool Source
Whether a tile kind (specified by its id) has the given feature.
isClear :: Ops TileKind -> Id TileKind -> Bool Source
Whether a tile does not block vision. Essential for efficiency of FOV, hence tabulated.
isLit :: Ops TileKind -> Id TileKind -> Bool Source
Whether a tile is lit on its own. Essential for efficiency of Perception, hence tabulated.
isWalkable :: Ops TileKind -> Id TileKind -> Bool Source
Whether actors can walk into a tile. Essential for efficiency of pathfinding, hence tabulated.
isPassable :: Ops TileKind -> Id TileKind -> Bool Source
Whether actors can walk into a tile, perhaps opening a door first, perhaps a hidden door. Essential for efficiency of pathfinding, hence tabulated.
isPassableNoSuspect :: Ops TileKind -> Id TileKind -> Bool Source
Whether actors can walk into a tile, perhaps opening a door first, perhaps a hidden door. Essential for efficiency of pathfinding, hence tabulated.
isDoor :: Ops TileKind -> Id TileKind -> Bool Source
Whether a tile is a door, open or closed. Essential for efficiency of pathfinding, hence tabulated.
isSuspect :: Ops TileKind -> Id TileKind -> Bool Source
Whether a tile is suspect. Essential for efficiency of pathfinding, hence tabulated.
isExplorable :: Ops TileKind -> Id TileKind -> Bool Source
Whether one can easily explore a tile, possibly finding a treasure or a clue. Doors can't be explorable since revealing a secret tile should not change it's (walkable and) explorable status. Door status should not depend on whether they are open or not so that a foe opening a door doesn't force us to backtrack to explore it.
lookSimilar :: TileKind -> TileKind -> Bool Source
The player can't tell one tile from the other.
isOpenable :: Ops TileKind -> Id TileKind -> Bool Source
Whether a tile kind (specified by its id) has an OpenTo feature.
isClosable :: Ops TileKind -> Id TileKind -> Bool Source
Whether a tile kind (specified by its id) has a CloseTo feature.
isChangeable :: Ops TileKind -> Id TileKind -> Bool Source
Whether a tile kind (specified by its id) has a ChangeTo feature. Essential for efficiency of pathfinding, hence tabulated.
Internal operations
data TileSpeedup Source
TileSpeedup | |
|