LambdaHack-0.5.0.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Content.TileKind

Description

The type of kinds of terrain tiles.

Synopsis

Documentation

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.

Constructors

TileKind 

Fields

data Feature Source #

All possible terrain tile features.

Constructors

Embed !(GroupName ItemKind)

embed an item of this group, to cause effects (WIP)

Cause !Effect

causes the effect when triggered; more succint than Embed, but will probably get supplanted by Embed

OpenTo !(GroupName TileKind)

goes from a closed to an open tile when altered

CloseTo !(GroupName TileKind)

goes from an open to a closed tile when altered

ChangeTo !(GroupName TileKind)

alters tile, but does not change walkability

HideAs !(GroupName TileKind)

when hidden, looks as a tile of the group

RevealAs !(GroupName TileKind)

if secret, 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 shine

Suspect

may not be what it seems (clients only)

Impenetrable

can never be excavated nor seen through

OftenItem

initial items often generated there

OftenActor

initial actors and stairs often generated there

NoItem

no items ever generated there

NoActor

no actors nor stairs ever generated there

Trail

used for visible trails throughout the level

Instances

Eq Feature Source # 

Methods

(==) :: Feature -> Feature -> Bool #

(/=) :: Feature -> Feature -> Bool #

Ord Feature Source # 
Read Feature Source # 
Show Feature Source # 
Generic Feature Source # 

Associated Types

type Rep Feature :: * -> * #

Methods

from :: Feature -> Rep Feature x #

to :: Rep Feature x -> Feature #

Binary Feature Source # 

Methods

put :: Feature -> Put #

get :: Get Feature #

putList :: [Feature] -> Put #

NFData Feature Source # 

Methods

rnf :: Feature -> () #

Hashable Feature Source # 

Methods

hashWithSalt :: Int -> Feature -> Int #

hash :: Feature -> Int #

type Rep Feature Source # 
type Rep Feature = D1 (MetaData "Feature" "Game.LambdaHack.Content.TileKind" "LambdaHack-0.5.0.0-6OC76ogcRhh29GihdYiJrn" False) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "Embed" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName ItemKind)))) (C1 (MetaCons "Cause" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Effect)))) ((:+:) (C1 (MetaCons "OpenTo" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName TileKind)))) (C1 (MetaCons "CloseTo" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName TileKind)))))) ((:+:) ((:+:) (C1 (MetaCons "ChangeTo" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName TileKind)))) (C1 (MetaCons "HideAs" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName TileKind))))) ((:+:) (C1 (MetaCons "RevealAs" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName TileKind)))) (C1 (MetaCons "Walkable" PrefixI False) U1)))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "Clear" PrefixI False) U1) (C1 (MetaCons "Dark" PrefixI False) U1)) ((:+:) (C1 (MetaCons "Suspect" PrefixI False) U1) (C1 (MetaCons "Impenetrable" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "OftenItem" PrefixI False) U1) (C1 (MetaCons "OftenActor" PrefixI False) U1)) ((:+:) (C1 (MetaCons "NoItem" PrefixI False) U1) ((:+:) (C1 (MetaCons "NoActor" PrefixI False) U1) (C1 (MetaCons "Trail" PrefixI False) U1))))))

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, the description and the 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 iiles may freely differ wrt dungeon generation, AI preferences, etc.

actionFeatures :: Bool -> TileKind -> IntSet Source #

Features of tiles that differentiate them substantially from one another. By tile content validation condition, this means the player can tell such tile apart, and only looking at the map, not tile name. 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.