LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Content.TileKind

Contents

- Internal operations

Description

The type of tile kinds. Every terrain tile in the game is an instantiated tile kind.

Synopsis

- pattern S_UNKNOWN_SPACE :: GroupName TileKind
- pattern S_UNKNOWN_OUTER_FENCE :: GroupName TileKind
- pattern S_BASIC_OUTER_FENCE :: GroupName TileKind
- pattern AQUATIC :: GroupName TileKind
- data TileKind = TileKind {
  - tsymbol :: Char
  - tname :: Text
  - tfreq :: Freqs TileKind
  - tcolor :: Color
  - tcolor2 :: Color
  - talter :: Word8
  - tfeature :: [Feature]
  }
- data ProjectileTriggers
  - = ProjYes
  - | ProjNo
- data Feature
  - = Embed (GroupName ItemKind)
  - | OpenTo (GroupName TileKind)
  - | CloseTo (GroupName TileKind)
  - | ChangeTo (GroupName TileKind)
  - | OpenWith ProjectileTriggers [(Int, GroupName ItemKind)] (GroupName TileKind)
  - | CloseWith ProjectileTriggers [(Int, GroupName ItemKind)] (GroupName TileKind)
  - | ChangeWith ProjectileTriggers [(Int, GroupName ItemKind)] (GroupName TileKind)
  - | HideAs (GroupName TileKind)
  - | BuildAs (GroupName TileKind)
  - | RevealAs (GroupName TileKind)
  - | ObscureAs (GroupName TileKind)
  - | Walkable
  - | Clear
  - | Dark
  - | OftenItem
  - | VeryOftenItem
  - | OftenActor
  - | NoItem
  - | NoActor
  - | ConsideredByAI
  - | Trail
  - | Spice
- makeData :: [TileKind] -> [GroupName TileKind] -> [GroupName TileKind] -> ContentData TileKind
- isUknownSpace :: ContentId TileKind -> Bool
- unknownId :: ContentId TileKind
- isSuspectKind :: TileKind -> Bool
- isOpenableKind :: TileKind -> Bool
- isClosableKind :: TileKind -> Bool
- talterForStairs :: Word8
- floorSymbol :: Char
- mandatoryGroups :: [GroupName TileKind]
- mandatoryGroupsSingleton :: [GroupName TileKind]
- validateSingle :: TileKind -> [Text]
- validateAll :: [TileKind] -> ContentData TileKind -> [Text]
- validateDups :: TileKind -> Feature -> [Text]

# Documentation

pattern S_UNKNOWN_SPACE :: GroupName TileKind Source #

pattern S_UNKNOWN_OUTER_FENCE :: GroupName TileKind Source #

pattern S_BASIC_OUTER_FENCE :: GroupName TileKind Source #

pattern AQUATIC :: GroupName TileKind Source #

data TileKind Source #

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 `ContentId` index. The `talter` for unknown space is `1` and no other tile kind has that value.

Constructors

TileKind |

Fields

- tsymbol :: Char

  map symbol

- tname :: Text

  short description

- tfreq :: Freqs TileKind

  frequency within groups

- tcolor :: Color

  map color

- tcolor2 :: Color

  map color when not in FOV

- talter :: Word8

  minimal skill needed to activate embeds and, in case of big actors not standing on the tile, to alter the tile in any way

- tfeature :: [Feature]

  properties; order matters

#### Instances

Instances details

Show TileKind Source # |
Instance details Defined in Game.LambdaHack.Content.TileKind Methods showsPrec :: Int -> TileKind -> ShowS Source # show :: TileKind -> String Source # showList :: [TileKind] -> ShowS Source #

data ProjectileTriggers Source #

Marks whether projectiles are permitted to trigger the tile transformation action.

Constructors

ProjYes |
ProjNo |

#### Instances

Instances details

Show ProjectileTriggers Source # |
Instance details Defined in Game.LambdaHack.Content.TileKind Methods showsPrec :: Int -> ProjectileTriggers -> ShowS Source # show :: ProjectileTriggers -> String Source # showList :: [ProjectileTriggers] -> ShowS Source #
Eq ProjectileTriggers Source # |
Instance details Defined in Game.LambdaHack.Content.TileKind Methods (==) :: ProjectileTriggers -> ProjectileTriggers -> Bool Source # (/=) :: ProjectileTriggers -> ProjectileTriggers -> Bool Source #

data Feature Source #

All possible terrain tile features.

Constructors

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 closed or open tile when altered
CloseTo (GroupName TileKind) | goes from an open to open or closed tile when altered
ChangeTo (GroupName TileKind) | alters tile, but does not change walkability
OpenWith ProjectileTriggers [(Int, GroupName ItemKind)] (GroupName TileKind) | alters tile, as before, using up all listed items from the ground and equipment; the list never empty; for simplicity, such tiles are never taken into account when pathfinding
CloseWith ProjectileTriggers [(Int, GroupName ItemKind)] (GroupName TileKind) |
ChangeWith ProjectileTriggers [(Int, GroupName ItemKind)] (GroupName TileKind) |
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
VeryOftenItem | initial items very often generated there
OftenActor | initial actors often generated there; counterpart of `VeryOftenItem` for dark places
NoItem | no items ever generated there
NoActor | no actors ever generated there
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 (according to frequencies of non-spicy) and at most one spicy (according to their frequencies) is rolled per place and then, once for each position, one of the two is semi-randomly chosen (according to their individual frequencies only)

#### Instances

Instances details

Show Feature Source # |
Instance details Defined in Game.LambdaHack.Content.TileKind Methods showsPrec :: Int -> Feature -> ShowS Source # show :: Feature -> String Source # showList :: [Feature] -> ShowS Source #
Eq Feature Source # |
Instance details Defined in Game.LambdaHack.Content.TileKind Methods (==) :: Feature -> Feature -> Bool Source # (/=) :: Feature -> Feature -> Bool Source #

makeData :: [TileKind] -> [GroupName TileKind] -> [GroupName TileKind] -> ContentData TileKind Source #

isUknownSpace :: ContentId TileKind -> Bool Source #

unknownId :: ContentId TileKind Source #

isSuspectKind :: TileKind -> Bool Source #

isOpenableKind :: TileKind -> Bool Source #

isClosableKind :: TileKind -> Bool Source #

talterForStairs :: Word8 Source #

floorSymbol :: Char Source #

mandatoryGroups :: [GroupName TileKind] Source #

mandatoryGroupsSingleton :: [GroupName TileKind] Source #

# Internal operations

validateSingle :: TileKind -> [Text] Source #

Validate a single tile kind.

validateAll :: [TileKind] -> ContentData TileKind -> [Text] Source #

Validate all tile kinds.

We don't check it any more, but if tiles look the same on the map (symbol and color), their substantial features should be the same, too, unless there is a good reason they shouldn't. Otherwise the player has to inspect manually all the tiles with this look to see if any is special. This tends to be tedious. Note that tiles may freely differ wrt text blurb, dungeon generation rules, AI preferences, etc., whithout causing the tedium.

validateDups :: TileKind -> Feature -> [Text] Source #