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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Content.CaveKind

Contents

- Internal operations

Description

The type of cave kinds. Every level in the game is an instantiated cave kind.

Synopsis

- pattern DEFAULT_RANDOM :: GroupName CaveKind
- data CaveKind = CaveKind {
  - cname :: Text
  - cfreq :: Freqs CaveKind
  - cXminSize :: X
  - cYminSize :: Y
  - ccellSize :: DiceXY
  - cminPlaceSize :: DiceXY
  - cmaxPlaceSize :: DiceXY
  - cdarkOdds :: Dice
  - cnightOdds :: Dice
  - cauxConnects :: Rational
  - cmaxVoid :: Rational
  - cdoorChance :: Chance
  - copenChance :: Chance
  - chidden :: Int
  - cactorCoeff :: Int
  - cactorFreq :: Freqs ItemKind
  - citemNum :: Dice
  - citemFreq :: Freqs ItemKind
  - cplaceFreq :: Freqs PlaceKind
  - cpassable :: Bool
  - clabyrinth :: Bool
  - cdefTile :: GroupName TileKind
  - cdarkCorTile :: GroupName TileKind
  - clitCorTile :: GroupName TileKind
  - cwallTile :: GroupName TileKind
  - ccornerTile :: GroupName TileKind
  - cfenceTileN :: GroupName TileKind
  - cfenceTileE :: GroupName TileKind
  - cfenceTileS :: GroupName TileKind
  - cfenceTileW :: GroupName TileKind
  - cfenceApart :: Bool
  - cminStairDist :: Int
  - cmaxStairsNum :: Dice
  - cescapeFreq :: Freqs PlaceKind
  - cstairFreq :: Freqs PlaceKind
  - cstairAllowed :: Freqs PlaceKind
  - cskip :: [Int]
  - cinitSleep :: InitSleep
  - cdesc :: Text
  }
- data InitSleep
  - = InitSleepAlways
  - | InitSleepPermitted
  - | InitSleepBanned
- makeData :: RuleContent -> [CaveKind] -> [GroupName CaveKind] -> [GroupName CaveKind] -> ContentData CaveKind
- validateSingle :: RuleContent -> CaveKind -> [Text]
- validateAll :: [CaveKind] -> ContentData CaveKind -> [Text]
- mandatoryGroups :: [GroupName CaveKind]

# Documentation

pattern DEFAULT_RANDOM :: GroupName CaveKind Source #

data CaveKind Source #

Parameters for the generation of dungeon levels. Warning: for efficiency, avoid embedded items in any of the common tiles.

Constructors

CaveKind |

Fields

- cname :: Text

  short description

- cfreq :: Freqs CaveKind

  frequency within groups

- cXminSize :: X

  minimal X size of the whole cave

- cYminSize :: Y

  minimal Y size of the whole cave

- ccellSize :: DiceXY

  size of a map cell holding a place

- cminPlaceSize :: DiceXY

  minimal size of places; for merging

- cmaxPlaceSize :: DiceXY

  maximal size of places; for growing

- cdarkOdds :: Dice

  the odds a place is dark (level-scaled dice roll > 50)

- cnightOdds :: Dice

  the odds the cave is dark (level-scaled dice roll > 50)

- cauxConnects :: Rational

  a proportion of extra connections

- cmaxVoid :: Rational

  at most this proportion of rooms may be void

- cdoorChance :: Chance

  the chance of a door in an opening

- copenChance :: Chance

  if there's a door, is it open?

- chidden :: Int

  if not open, hidden one in n times

- cactorCoeff :: Int

  the lower, the more monsters spawn

- cactorFreq :: Freqs ItemKind

  actor groups to consider

- citemNum :: Dice

  number of initial items in the cave

- citemFreq :: Freqs ItemKind

  item groups to consider; note that the groups are flattened; e.g., if an item is moved to another included group with the same weight, the outcome doesn't change

- cplaceFreq :: Freqs PlaceKind

  place groups to consider

- cpassable :: Bool

  are passable default tiles permitted

- clabyrinth :: Bool

  waste of time for AI to explore

- cdefTile :: GroupName TileKind

  the default cave tile

- cdarkCorTile :: GroupName TileKind

  the dark cave corridor tile

- clitCorTile :: GroupName TileKind

  the lit cave corridor tile

- cwallTile :: GroupName TileKind

  the tile used for `FWall` fence

- ccornerTile :: GroupName TileKind

  tile used for the fence corners

- cfenceTileN :: GroupName TileKind

  the outer fence N wall

- cfenceTileE :: GroupName TileKind

  the outer fence E wall

- cfenceTileS :: GroupName TileKind

  the outer fence S wall

- cfenceTileW :: GroupName TileKind

  the outer fence W wall

- cfenceApart :: Bool

  are places touching fence banned

- cminStairDist :: Int

  minimal distance between stairs

- cmaxStairsNum :: Dice

  maximum number of stairs

- cescapeFreq :: Freqs PlaceKind

  escape groups, if any

- cstairFreq :: Freqs PlaceKind

  place groups for created stairs

- cstairAllowed :: Freqs PlaceKind

  extra groups for inherited

- cskip :: [Int]

  which faction starting positions to skip

- cinitSleep :: InitSleep

  whether actors spawn sleeping

- cdesc :: Text

  full cave description

#### Instances

Instances details

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

data InitSleep Source #

Constructors

InitSleepAlways |
InitSleepPermitted |
InitSleepBanned |

#### Instances

Instances details

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

makeData :: RuleContent -> [CaveKind] -> [GroupName CaveKind] -> [GroupName CaveKind] -> ContentData CaveKind Source #

# Internal operations

validateSingle :: RuleContent -> CaveKind -> [Text] Source #

Catch caves with not enough space for all the places. Check the size of the cave descriptions to make sure they fit on screen. Etc.

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

Validate all cave kinds. Note that names don't have to be unique: we can have several variants of a cave with a given name.

mandatoryGroups :: [GroupName CaveKind] Source #