Safe Haskell | None |
---|---|
Language | Haskell2010 |
The type of kinds of terrain tiles.
- data TileKind = TileKind {}
- data Feature
- = Embed !(GroupName ItemKind)
- | OpenTo !(GroupName TileKind)
- | CloseTo !(GroupName TileKind)
- | ChangeTo !(GroupName TileKind)
- | HideAs !(GroupName TileKind)
- | BuildAs !(GroupName TileKind)
- | RevealAs !(GroupName TileKind)
- | ObscureAs !(GroupName TileKind)
- | Walkable
- | Clear
- | Dark
- | OftenItem
- | OftenActor
- | NoItem
- | NoActor
- | Indistinct
- | ConsideredByAI
- | Trail
- | Spice
- validateSingleTileKind :: TileKind -> [Text]
- validateAllTileKind :: [TileKind] -> [Text]
- actionFeatures :: Bool -> TileKind -> IntSet
- data TileSpeedup = TileSpeedup {
- isClearTab :: !(Tab Bool)
- isLitTab :: !(Tab Bool)
- isWalkableTab :: !(Tab Bool)
- isDoorTab :: !(Tab Bool)
- isChangableTab :: !(Tab Bool)
- isSuspectTab :: !(Tab Bool)
- isHideAsTab :: !(Tab Bool)
- consideredByAITab :: !(Tab Bool)
- isOftenItemTab :: !(Tab Bool)
- isOftenActorTab :: !(Tab Bool)
- isNoItemTab :: !(Tab Bool)
- isNoActorTab :: !(Tab Bool)
- isEasyOpenTab :: !(Tab Bool)
- alterMinSkillTab :: !(Tab Word8)
- alterMinWalkTab :: !(Tab Word8)
- newtype Tab a = Tab (Vector a)
- isUknownSpace :: Id TileKind -> Bool
- unknownId :: Id TileKind
- isSuspectKind :: TileKind -> Bool
- isOpenableKind :: TileKind -> Bool
- isClosableKind :: TileKind -> Bool
- talterForStairs :: Word8
- floorSymbol :: Char
Documentation
The type of kinds of terrain tiles. See Tile.hs
for explanation
of the absence of a corresponding type Tile
that would hold
particular concrete tiles in the dungeon.
Note that tile names (and any other content names) should not be plural
(that would lead to "a stairs"), so "road with cobblestones" is fine,
but "granite cobblestones" is wrong.
Tile kind for unknown space has the minimal KindOps.Id
index.
The talter
for unknown space is 1
and no other tile kind has that value.
All possible terrain tile features.
Embed !(GroupName ItemKind) | initially an item of this group is embedded; we assume the item has effects and is supposed to be triggered |
OpenTo !(GroupName TileKind) | goes from a closed to (randomly closed or) open tile when altered |
CloseTo !(GroupName TileKind) | goes from an open to (randomly opened or) closed tile when altered |
ChangeTo !(GroupName TileKind) | alters tile, but does not change walkability |
HideAs !(GroupName TileKind) | when hidden, looks as the unique tile of the group |
BuildAs !(GroupName TileKind) | when generating, may be transformed to the unique tile of the group |
RevealAs !(GroupName TileKind) | when generating in opening, can be revealed to belong to the group |
ObscureAs !(GroupName TileKind) | when generating in solid wall, can be revealed to belong to the group |
Walkable | actors can walk through |
Clear | actors can see through |
Dark | is not lit with an ambient light |
OftenItem | initial items often generated there |
OftenActor | initial actors often generated there |
NoItem | no items ever generated there |
NoActor | no actors ever generated there |
Indistinct | is allowed to have the same look as another tile |
ConsideredByAI | even if otherwise uninteresting, taken into account for triggering by AI |
Trail | used for visible trails throughout the level |
Spice | in place normal legend and in override, don't roll a tile kind only once per place, but roll for each position; one non-spicy and at most one spicy is rolled per place and then one of the two is rolled for each position |
validateSingleTileKind :: TileKind -> [Text] Source #
Validate a single tile kind.
validateAllTileKind :: [TileKind] -> [Text] Source #
Validate all tile kinds.
If tiles look the same on the map (symbol and color), their substantial features should be the same, too. Otherwise, the player has to inspect manually all the tiles of that kind, or even experiment with them, to see if any is special. This would be tedious. Note that tiles may freely differ wrt text blurb, dungeon generation, AI preferences, etc.
actionFeatures :: Bool -> TileKind -> IntSet Source #
Features of tiles that differentiate them substantially from one another. The intention is the player can easily tell such tiles apart by their behaviour and only looking at the map, not tile name nor description. So if running uses this function, it won't stop at places that the player can't himself tell from other places, and so running does not confer any advantages, except UI convenience. Hashes are accurate enough for our purpose, given that we use arbitrary heuristics anyway.
data TileSpeedup Source #
TileSpeedup | |
|
isSuspectKind :: TileKind -> Bool Source #
isOpenableKind :: TileKind -> Bool Source #
isClosableKind :: TileKind -> Bool Source #
floorSymbol :: Char Source #