-- | Cave properties.
module Content.CaveKind
  ( content
  ) where

import Prelude ()

import Game.LambdaHack.Core.Prelude

import Data.Ratio

import Game.LambdaHack.Content.CaveKind
import Game.LambdaHack.Core.Dice

content :: [CaveKind]
content :: [CaveKind]
content =
  [CaveKind
rogue, CaveKind
arena, CaveKind
smoking, CaveKind
laboratory, CaveKind
noise, CaveKind
mine, CaveKind
empty, CaveKind
shallowRogue, CaveKind
outermost, CaveKind
raid, CaveKind
brawl, CaveKind
shootout, CaveKind
hunt, CaveKind
escape, CaveKind
zoo, CaveKind
ambush, CaveKind
battle, CaveKind
safari1, CaveKind
safari2, CaveKind
safari3]

rogue,    arena, smoking, laboratory, noise, mine, empty, shallowRogue, outermost, raid, brawl, shootout, hunt, escape, zoo, ambush, battle, safari1, safari2, safari3 :: CaveKind

-- * Underground caves; most of mediocre height and size

rogue :: CaveKind
rogue = $WCaveKind :: Char
-> Text
-> Freqs CaveKind
-> X
-> X
-> DiceXY
-> DiceXY
-> DiceXY
-> Dice
-> Dice
-> Rational
-> Rational
-> X
-> Dice
-> Rational
-> Rational
-> X
-> X
-> Freqs ItemKind
-> Dice
-> Freqs ItemKind
-> Freqs PlaceKind
-> Bool
-> Bool
-> GroupName TileKind
-> GroupName TileKind
-> GroupName TileKind
-> GroupName TileKind
-> GroupName TileKind
-> GroupName TileKind
-> GroupName TileKind
-> GroupName TileKind
-> GroupName TileKind
-> Bool
-> GroupName TileKind
-> GroupName TileKind
-> Freqs PlaceKind
-> Freqs PlaceKind
-> Freqs PlaceKind
-> Text
-> CaveKind
CaveKind
  { csymbol :: Char
csymbol       = 'R'
  , cname :: Text
cname         = "A maze of twisty passages"
  , cfreq :: Freqs CaveKind
cfreq         = [("default random", 100), ("caveRogue", 1)]
  , cXminSize :: X
cXminSize     = 80
  , cYminSize :: X
cYminSize     = 21
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (2 X -> X -> Dice
`d` 4 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 10) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY (2 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 4) 5
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 16 40
  , cdarkOdds :: Dice
cdarkOdds     = 1 X -> X -> Dice
`d` 54 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 X -> X -> Dice
`dL` 20
      -- most rooms lit, to compensate for dark corridors
  , cnightOdds :: Dice
cnightOdds    = 51  -- always night
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%2
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%6
  , cminStairDist :: X
cminStairDist = 20
  , cextraStairs :: Dice
cextraStairs  = 1 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 X -> X -> Dice
`d` 2
  , cdoorChance :: Rational
cdoorChance   = 3Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%4
  , copenChance :: Rational
copenChance   = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%5
  , chidden :: X
chidden       = 7
  , cactorCoeff :: X
cactorCoeff   = 65  -- the maze requires time to explore
  , cactorFreq :: Freqs ItemKind
cactorFreq    = [("monster", 60), ("animal", 40)]
  , citemNum :: Dice
citemNum      = 6 X -> X -> Dice
`d` 5 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 10 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
- 10 X -> X -> Dice
`dL` 1  -- deep down quality over quantity
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 40), ("treasure", 60)]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("rogue", 1)]
  , cpassable :: Bool
cpassable     = Bool
False
  , labyrinth :: Bool
labyrinth     = Bool
False
  , cdefTile :: GroupName TileKind
cdefTile      = "fillerWall"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "floorCorridorDark"
  , clitCorTile :: GroupName TileKind
clitCorTile   = "floorCorridorLit"
  , cwallTile :: GroupName TileKind
cwallTile     = "fillerWall"
  , ccornerTile :: GroupName TileKind
ccornerTile   = "fillerWall"
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "basic outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "basic outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "basic outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "basic outer fence"
  , cfenceApart :: Bool
cfenceApart   = Bool
False
  , clegendDarkTile :: GroupName TileKind
clegendDarkTile = "legendDark"
  , clegendLitTile :: GroupName TileKind
clegendLitTile  = "legendLit"
  , cescapeFreq :: Freqs PlaceKind
cescapeFreq   = []
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("walled staircase", 50), ("open staircase", 50)
                    , ("tiny staircase", 1) ]
  , cstairAllowed :: Freqs PlaceKind
cstairAllowed = []
  , cdesc :: Text
cdesc         = "Winding tunnels stretch into the dark."
  }  -- no lit corridors cave alternative, since both lit # and . look bad here
arena :: CaveKind
arena = CaveKind
rogue
  { csymbol :: Char
csymbol       = 'A'
  , cname :: Text
cname         = "Dusty underground library"
  , cfreq :: Freqs CaveKind
cfreq         = [("default random", 60), ("caveArena", 1)]
  , cXminSize :: X
cXminSize     = 50
  , cYminSize :: X
cYminSize     = 21
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (3 X -> X -> Dice
`d` 3 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 17) (1 X -> X -> Dice
`d` 3 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 4)
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY (2 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 4) 6
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 16 12
  , cdarkOdds :: Dice
cdarkOdds     = 49 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 X -> X -> Dice
`d` 10  -- almost all rooms dark (1 in 10 lit)
  -- Light is not too deadly, because not many obstructions and so
  -- foes visible from far away and few foes have ranged combat
  -- at shallow depth.
  , cnightOdds :: Dice
cnightOdds    = 0  -- always day
  , cauxConnects :: Rational
cauxConnects  = 1
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%8
  , cminStairDist :: X
cminStairDist = 15
  , cextraStairs :: Dice
cextraStairs  = 1 X -> X -> Dice
`d` 2
  , chidden :: X
chidden       = 0
  , cactorCoeff :: X
cactorCoeff   = 75  -- small open level, don't rush the player
  , cactorFreq :: Freqs ItemKind
cactorFreq    = [("monster", 30), ("animal", 70)]
  , citemNum :: Dice
citemNum      = 4 X -> X -> Dice
`d` 5  -- few rooms
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 20), ("treasure", 40), ("any scroll", 40)]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("arena", 1)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "arenaSetLit"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "trailLit"  -- let trails give off light
  , clitCorTile :: GroupName TileKind
clitCorTile   = "trailLit"  -- may be rolled different than the above
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("walled staircase", 20), ("closed staircase", 80)
                    , ("tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "The shelves groan with dusty books and tattered scrolls."
  }
smoking :: CaveKind
smoking = CaveKind
arena
  { cname :: Text
cname         = "Smoking rooms"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveSmoking", 1)]
  , cdarkOdds :: Dice
cdarkOdds     = 41 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 X -> X -> Dice
`d` 10  -- almost all rooms lit (1 in 10 dark)
  -- Trails provide enough light for fun stealth.
  , cnightOdds :: Dice
cnightOdds    = 51  -- always night
  , citemNum :: Dice
citemNum      = 6 X -> X -> Dice
`d` 5  -- rare, so make it exciting
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 20), ("treasure", 40), ("any vial", 40)]
  , cdefTile :: GroupName TileKind
cdefTile      = "arenaSetDark"
  , cdesc :: Text
cdesc         = "Velvet couches exude the strong smell of tobacco."
  }
laboratory :: CaveKind
laboratory = CaveKind
rogue
  { csymbol :: Char
csymbol       = 'L'
  , cname :: Text
cname         = "Burnt laboratory"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveLaboratory", 1)]
  , cXminSize :: X
cXminSize     = 60
  , cYminSize :: X
cYminSize     = 21
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (1 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 5) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 7 5
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 10 40
  , cnightOdds :: Dice
cnightOdds    = 0  -- always day so that the corridor smoke is lit
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%5
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , cextraStairs :: Dice
cextraStairs  = 2
  , cdoorChance :: Rational
cdoorChance   = 1
  , copenChance :: Rational
copenChance   = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%2
  , cactorFreq :: Freqs ItemKind
cactorFreq    = [("monster", 30), ("animal", 70)]
  , citemNum :: Dice
citemNum      = 6 X -> X -> Dice
`d` 5  -- reward difficulty
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 20), ("treasure", 40), ("explosive", 40)]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("laboratory", 1)]
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "labTrailLit"  -- let lab smoke give off light always
  , clitCorTile :: GroupName TileKind
clitCorTile   = "labTrailLit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("walled staircase", 50), ("open staircase", 50)
                    , ("tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "Shattered glassware and the sharp scent of spilt chemicals show that something terrible happened here."
  }
noise :: CaveKind
noise = CaveKind
rogue
  { csymbol :: Char
csymbol       = 'N'
  , cname :: Text
cname         = "Leaky burrowed sediment"
  , cfreq :: Freqs CaveKind
cfreq         = [("default random", 30), ("caveNoise", 1)]
  , cXminSize :: X
cXminSize     = 50
  , cYminSize :: X
cYminSize     = 21
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (3 X -> X -> Dice
`d` 5 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 12) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 8 5
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 20 20
  , cdarkOdds :: Dice
cdarkOdds     = 51
  -- Light is deadly, because nowhere to hide and pillars enable spawning
  -- very close to heroes.
  , cnightOdds :: Dice
cnightOdds    = 0  -- harder variant, but looks cheerful
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%100
  , cminStairDist :: X
cminStairDist = 15
  , cdoorChance :: Rational
cdoorChance   = 1  -- to avoid lit quasi-door tiles
  , chidden :: X
chidden       = 0
  , cactorCoeff :: X
cactorCoeff   = 80  -- the maze requires time to explore; also, small
  , cactorFreq :: Freqs ItemKind
cactorFreq    = [("monster", 80), ("animal", 20)]
  , citemNum :: Dice
citemNum      = 6 X -> X -> Dice
`d` 5  -- an incentive to explore the labyrinth
  , cpassable :: Bool
cpassable     = Bool
True
  , labyrinth :: Bool
labyrinth     = Bool
True
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("noise", 1)]
  , cdefTile :: GroupName TileKind
cdefTile      = "noiseSetLit"
  , cfenceApart :: Bool
cfenceApart   = Bool
True  -- ensures no cut-off parts from collapsed
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "damp floor Dark"
  , clitCorTile :: GroupName TileKind
clitCorTile   = "damp floor Lit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("closed staircase", 50), ("open staircase", 50)
                    , ("tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "Soon, these passages will be swallowed up by the mud."
  }
mine :: CaveKind
mine = CaveKind
noise
  { cname :: Text
cname         = "Frozen derelict mine"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveMine", 1)]
  , cnightOdds :: Dice
cnightOdds    = 51  -- easier variant, but looks sinister
  , citemNum :: Dice
citemNum      = 10 X -> X -> Dice
`d` 4  -- an incentive to explore the final labyrinth
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 20), ("gem", 20)]
                      -- can't be "valuable" or template items generated
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("noise", 1), ("mine", 99)]
  , cdefTile :: GroupName TileKind
cdefTile      = "powerSetDark"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("gated closed staircase", 50)
                    , ("gated open staircase", 50)
                    , ("gated tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "Pillars of shining ice create a frozen labyrinth."
  }
empty :: CaveKind
empty = CaveKind
rogue
  { csymbol :: Char
csymbol       = 'E'
  , cname :: Text
cname         = "Tall cavern"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveEmpty", 1)]
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (2 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 11) (1 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 8)
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 13 11
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 37 31  -- favour large rooms
  , cdarkOdds :: Dice
cdarkOdds     = 1 X -> X -> Dice
`d` 100 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 X -> X -> Dice
`dL` 100
  , cnightOdds :: Dice
cnightOdds    = 0  -- always day
  , cauxConnects :: Rational
cauxConnects  = 3Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%2
  , cmaxVoid :: Rational
cmaxVoid      = 0  -- too few rooms to have void and fog common anyway
  , cminStairDist :: X
cminStairDist = 30
  , cextraStairs :: Dice
cextraStairs  = 1
  , cdoorChance :: Rational
cdoorChance   = 0
  , copenChance :: Rational
copenChance   = 0
  , chidden :: X
chidden       = 0
  , cactorCoeff :: X
cactorCoeff   = 7
  , cactorFreq :: Freqs ItemKind
cactorFreq    = [("animal", 10), ("immobile animal", 90)]
      -- The healing geysers on lvl 3 act like HP resets. Needed to avoid
      -- cascading failure, if the particular starting conditions were
      -- very hard. Items are not reset, even if they are bad, which provides
      -- enough of a continuity. Gyesers on lvl 3 are not OP and can't be
      -- abused, because they spawn less and less often and also HP doesn't
      -- effectively accumulate over max.
  , citemNum :: Dice
citemNum      = 4 X -> X -> Dice
`d` 5  -- few rooms and geysers are the boon
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("empty", 1)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "emptySetLit"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "floorArenaDark"
  , clitCorTile :: GroupName TileKind
clitCorTile   = "floorArenaLit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("walled staircase", 20), ("closed staircase", 80)
                    , ("tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "Swirls of warm fog fill the air, the hiss of geysers sounding all around."
  }
shallowRogue :: CaveKind
shallowRogue = CaveKind
rogue
  { cfreq :: Freqs CaveKind
cfreq         = [("caveShallowRogue", 100)]
  , cXminSize :: X
cXminSize     = 60
  , cYminSize :: X
cYminSize     = 21
  , cextraStairs :: Dice
cextraStairs  = 1  -- ensure heroes meet initial monsters and their loot
  , cdesc :: Text
cdesc         = "The snorts and grunts of savage beasts can be clearly heard."
  }
outermost :: CaveKind
outermost = CaveKind
shallowRogue
  { csymbol :: Char
csymbol       = 'B'
  , cname :: Text
cname         = "Cave entrance"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveOutermost", 100)]
  , cXminSize :: X
cXminSize     = 40
  , cYminSize :: X
cYminSize     = 21
  , cdarkOdds :: Dice
cdarkOdds     = 0  -- all rooms lit, for a gentle start
  , cminStairDist :: X
cminStairDist = 10
  , cextraStairs :: Dice
cextraStairs  = 1
  , cactorCoeff :: X
cactorCoeff   = 80  -- already animals start there; also, pity on the noob
  , cactorFreq :: Freqs ItemKind
cactorFreq    = ((GroupName ItemKind, X) -> Bool)
-> Freqs ItemKind -> Freqs ItemKind
forall a. (a -> Bool) -> [a] -> [a]
filter ((GroupName ItemKind -> GroupName ItemKind -> Bool
forall a. Eq a => a -> a -> Bool
/= "monster") (GroupName ItemKind -> Bool)
-> ((GroupName ItemKind, X) -> GroupName ItemKind)
-> (GroupName ItemKind, X)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (GroupName ItemKind, X) -> GroupName ItemKind
forall a b. (a, b) -> a
fst) (Freqs ItemKind -> Freqs ItemKind)
-> Freqs ItemKind -> Freqs ItemKind
forall a b. (a -> b) -> a -> b
$ CaveKind -> Freqs ItemKind
cactorFreq CaveKind
rogue
  , citemNum :: Dice
citemNum      = 6 X -> X -> Dice
`d` 5  -- lure them in with loot
  , citemFreq :: Freqs ItemKind
citemFreq     = ((GroupName ItemKind, X) -> Bool)
-> Freqs ItemKind -> Freqs ItemKind
forall a. (a -> Bool) -> [a] -> [a]
filter ((GroupName ItemKind -> GroupName ItemKind -> Bool
forall a. Eq a => a -> a -> Bool
/= "treasure") (GroupName ItemKind -> Bool)
-> ((GroupName ItemKind, X) -> GroupName ItemKind)
-> (GroupName ItemKind, X)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (GroupName ItemKind, X) -> GroupName ItemKind
forall a b. (a, b) -> a
fst) (Freqs ItemKind -> Freqs ItemKind)
-> Freqs ItemKind -> Freqs ItemKind
forall a b. (a -> b) -> a -> b
$ CaveKind -> Freqs ItemKind
citemFreq CaveKind
rogue
  , cescapeFreq :: Freqs PlaceKind
cescapeFreq   = [("escape up", 1)]
  , cdesc :: Text
cdesc         = "This close to the surface, the sunlight still illuminates the dungeon."
  }

-- * Overground "caves"; no story-wise limits wrt height and size

raid :: CaveKind
raid = CaveKind
rogue
  { csymbol :: Char
csymbol       = 'T'
  , cname :: Text
cname         = "Typing den"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveRaid", 1)]
  , cXminSize :: X
cXminSize     = 50
  , cYminSize :: X
cYminSize     = 21
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (2 X -> X -> Dice
`d` 4 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 6) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY (2 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 4) 5
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 16 20
  , cdarkOdds :: Dice
cdarkOdds     = 0  -- all rooms lit, for a gentle start
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , cextraStairs :: Dice
cextraStairs  = 0
  , cactorCoeff :: X
cactorCoeff   = 250  -- deep level with no kit, so slow spawning
  , cactorFreq :: Freqs ItemKind
cactorFreq    = [("animal", 100)]
  , citemNum :: Dice
citemNum      = 6 X -> X -> Dice
`d` 6  -- just one level, hard enemies, treasure
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 100), ("currency", 500)]
  , cescapeFreq :: Freqs PlaceKind
cescapeFreq   = [("escape up", 1)]
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cdesc :: Text
cdesc         = ""
  }
brawl :: CaveKind
brawl = CaveKind
rogue  -- many random solid tiles, to break LOS, since it's a day
               -- and this scenario is not focused on ranged combat;
               -- also, sanctuaries against missiles in shadow under trees
  { csymbol :: Char
csymbol       = 'b'
  , cname :: Text
cname         = "Sunny woodland"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveBrawl", 1)]
  , cXminSize :: X
cXminSize     = 60
  , cYminSize :: X
cYminSize     = 21
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (2 X -> X -> Dice
`d` 5 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 5) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 3 3
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 7 5
  , cdarkOdds :: Dice
cdarkOdds     = 51
  , cnightOdds :: Dice
cnightOdds    = 0
  , cdoorChance :: Rational
cdoorChance   = 1
  , copenChance :: Rational
copenChance   = 0
  , cextraStairs :: Dice
cextraStairs  = 0
  , chidden :: X
chidden       = 0
  , cactorFreq :: Freqs ItemKind
cactorFreq    = []
  , citemNum :: Dice
citemNum      = 5 X -> X -> Dice
`d` 6
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 100)]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("brawl", 1)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "brawlSetLit"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "dirt Lit"
  , clitCorTile :: GroupName TileKind
clitCorTile   = "dirt Lit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "outdoor outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "outdoor outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "outdoor outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "outdoor outer fence"
  , cdesc :: Text
cdesc         = "Sunlight falls through the trees and dapples on the ground."
  }
shootout :: CaveKind
shootout = CaveKind
rogue  -- a scenario with strong missiles;
                  -- few solid tiles, but only translucent tiles or walkable
                  -- opaque tiles, to make scouting and sniping more interesting
                  -- and to avoid obstructing view too much, since this
                  -- scenario is about ranged combat at long range
  { csymbol :: Char
csymbol       = 'S'
  , cname :: Text
cname         = "Misty meadow"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveShootout", 1)]
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (1 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 6) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 3 3
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 4 4
  , cdarkOdds :: Dice
cdarkOdds     = 51
  , cnightOdds :: Dice
cnightOdds    = 0
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , cdoorChance :: Rational
cdoorChance   = 1
  , copenChance :: Rational
copenChance   = 0
  , cextraStairs :: Dice
cextraStairs  = 0
  , chidden :: X
chidden       = 0
  , cactorFreq :: Freqs ItemKind
cactorFreq    = []
  , citemNum :: Dice
citemNum      = 5 X -> X -> Dice
`d` 16
                      -- less items in inventory, more to be picked up,
                      -- to reward explorer and aggressor and punish camper
  , citemFreq :: Freqs ItemKind
citemFreq     = [ ("common item", 30)
                    , ("any arrow", 400), ("harpoon", 300), ("explosive", 50) ]
                      -- Many consumable buffs are needed in symmetric maps
                      -- so that aggressor prepares them in advance and camper
                      -- needs to waste initial turns to buff for the defence.
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("shootout", 1)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "shootoutSetLit"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "dirt Lit"
  , clitCorTile :: GroupName TileKind
clitCorTile   = "dirt Lit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "outdoor outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "outdoor outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "outdoor outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "outdoor outer fence"
  , cdesc :: Text
cdesc         = ""
  }
hunt :: CaveKind
hunt = CaveKind
rogue  -- a scenario with strong missiles for ranged and shade for melee
  { csymbol :: Char
csymbol       = 'H'
  , cname :: Text
cname         = "Noon swamp"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveHunt", 1)]
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (1 X -> X -> Dice
`d` 2 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 6) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 3 3
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 4 4
  , cdarkOdds :: Dice
cdarkOdds     = 51
  , cnightOdds :: Dice
cnightOdds    = 0
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , cdoorChance :: Rational
cdoorChance   = 1
  , copenChance :: Rational
copenChance   = 0
  , cextraStairs :: Dice
cextraStairs  = 0
  , chidden :: X
chidden       = 0
  , cactorFreq :: Freqs ItemKind
cactorFreq    = []
  , citemNum :: Dice
citemNum      = 5 X -> X -> Dice
`d` 10
  , citemFreq :: Freqs ItemKind
citemFreq     = [ ("common item", 30)
                    , ("any arrow", 400), ("harpoon", 300), ("explosive", 50) ]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("brawl", 50), ("shootout", 100)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "shootoutSetLit"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "dirt Lit"
  , clitCorTile :: GroupName TileKind
clitCorTile   = "dirt Lit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "outdoor outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "outdoor outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "outdoor outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "outdoor outer fence"
  , cdesc :: Text
cdesc         = ""
  }
escape :: CaveKind
escape = CaveKind
rogue  -- a scenario with weak missiles, because heroes don't depend
                -- on them; dark, so solid obstacles are to hide from missiles,
                -- not view; obstacles are not lit, to frustrate the AI;
                -- lots of small lights to cross, to have some risks
  { csymbol :: Char
csymbol       = 'E'
  , cname :: Text
cname         = "Metropolitan park at dusk"  -- "night" didn't fit
  , cfreq :: Freqs CaveKind
cfreq         = [("caveEscape", 1)]
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (1 X -> X -> Dice
`d` 3 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 7) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 5 3
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 9 9  -- bias towards larger lamp areas
  , cdarkOdds :: Dice
cdarkOdds     = 51  -- rooms always dark so that fence not visible from afar
  , cnightOdds :: Dice
cnightOdds    = 51  -- always night
  , cauxConnects :: Rational
cauxConnects  = 2  -- many lit trails, so easy to aim
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%100
  , cextraStairs :: Dice
cextraStairs  = 0
  , chidden :: X
chidden       = 0
  , cactorFreq :: Freqs ItemKind
cactorFreq    = []
  , citemNum :: Dice
citemNum      = 6 X -> X -> Dice
`d` 8
  , citemFreq :: Freqs ItemKind
citemFreq     = [ ("common item", 30), ("gem", 150)
                    , ("weak arrow", 500), ("harpoon", 400)
                    , ("explosive", 100) ]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("escape", 1)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "escapeSetDark"  -- unlike in ambush, tiles not burning yet
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "safeTrailLit"  -- let trails give off light
  , clitCorTile :: GroupName TileKind
clitCorTile   = "safeTrailLit"
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "outdoor outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "outdoor outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "outdoor outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "outdoor outer fence"
  , cescapeFreq :: Freqs PlaceKind
cescapeFreq   = [("escape outdoor down", 1)]
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cdesc :: Text
cdesc         = ""
  }
zoo :: CaveKind
zoo = CaveKind
rogue  -- few lights and many solids, to help the less numerous heroes
  { csymbol :: Char
csymbol       = 'Z'
  , cname :: Text
cname         = "Menagerie in flames"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveZoo", 1)]
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (1 X -> X -> Dice
`d` 3 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 7) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 4 4
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 12 5
  , cdarkOdds :: Dice
cdarkOdds     = 51  -- rooms always dark so that fence not visible from afar
  , cnightOdds :: Dice
cnightOdds    = 51  -- always night
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%4
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%20
  , cdoorChance :: Rational
cdoorChance   = 7Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , copenChance :: Rational
copenChance   = 9Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , cextraStairs :: Dice
cextraStairs  = 0
  , chidden :: X
chidden       = 0
  , cactorFreq :: Freqs ItemKind
cactorFreq    = []
  , citemNum :: Dice
citemNum      = 7 X -> X -> Dice
`d` 8
  , citemFreq :: Freqs ItemKind
citemFreq     = [ ("common item", 100), ("light source", 1000)
                    , ("starting weapon", 1000) ]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("zoo", 1)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "zooSetDark"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "safeTrailLit"  -- let trails give off light
  , clitCorTile :: GroupName TileKind
clitCorTile   = "safeTrailLit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "outdoor outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "outdoor outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "outdoor outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "outdoor outer fence"
  , cdesc :: Text
cdesc         = ""
  }
ambush :: CaveKind
ambush = CaveKind
rogue  -- a scenario with strong missiles;
                -- dark, so solid obstacles are to hide from missiles,
                -- not view, and they are all lit, because stopped missiles
                -- are frustrating, while a few LOS-only obstacles are not lit;
                -- few small lights to cross, giving a chance to snipe;
                -- crucial difference wrt shootout and hunt is that trajectories
                -- of missiles are usually not seen, so enemy can't be guessed;
                -- camping doesn't pay off, because enemies can sneak and only
                -- active scouting, throwing flares and shooting discovers them
  { csymbol :: Char
csymbol       = 'M'
  , cname :: Text
cname         = "Burning metropolitan park"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveAmbush", 1)]
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (1 X -> X -> Dice
`d` 4 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 7) 6
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 5 3
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 9 9  -- bias towards larger lamp areas
  , cdarkOdds :: Dice
cdarkOdds     = 51  -- rooms always dark so that fence not visible from afar
  , cnightOdds :: Dice
cnightOdds    = 51  -- always night
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10  -- few lit trails, so hard to aim
  , cextraStairs :: Dice
cextraStairs  = 0
  , chidden :: X
chidden       = 0
  , cactorFreq :: Freqs ItemKind
cactorFreq    = []
  , citemNum :: Dice
citemNum      = 5 X -> X -> Dice
`d` 8
  , citemFreq :: Freqs ItemKind
citemFreq     = [ ("common item", 30)
                    , ("any arrow", 400), ("harpoon", 300), ("explosive", 50) ]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("ambush", 1)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "ambushSetDark"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "trailLit"  -- let trails give off light
  , clitCorTile :: GroupName TileKind
clitCorTile   = "trailLit"
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "outdoor outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "outdoor outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "outdoor outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "outdoor outer fence"
  , cdesc :: Text
cdesc         = ""
  }

-- * Other caves; testing, Easter egg, future work

battle :: CaveKind
battle = CaveKind
rogue  -- few lights and many solids, to help the less numerous heroes
  { csymbol :: Char
csymbol       = 'B'
  , cname :: Text
cname         = "Old battle ground"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveBattle", 1)]
  , ccellSize :: DiceXY
ccellSize     = Dice -> Dice -> DiceXY
DiceXY (5 X -> X -> Dice
`d` 3 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 11) 5  -- cfenceApart results in 2 rows
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 4 4
  , cmaxPlaceSize :: DiceXY
cmaxPlaceSize = Dice -> Dice -> DiceXY
DiceXY 9 7
  , cdarkOdds :: Dice
cdarkOdds     = 0
  , cnightOdds :: Dice
cnightOdds    = 51  -- always night
  , cauxConnects :: Rational
cauxConnects  = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%4
  , cmaxVoid :: Rational
cmaxVoid      = 1Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%20
  , cdoorChance :: Rational
cdoorChance   = 2Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , copenChance :: Rational
copenChance   = 9Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
%10
  , cextraStairs :: Dice
cextraStairs  = 0
  , chidden :: X
chidden       = 0
  , cactorFreq :: Freqs ItemKind
cactorFreq    = []
  , citemNum :: Dice
citemNum      = 5 X -> X -> Dice
`d` 8
  , citemFreq :: Freqs ItemKind
citemFreq     = [("common item", 100), ("light source", 200)]
  , cplaceFreq :: Freqs PlaceKind
cplaceFreq    = [("battle", 50), ("rogue", 50)]
  , cpassable :: Bool
cpassable     = Bool
True
  , cdefTile :: GroupName TileKind
cdefTile      = "battleSetDark"
  , cdarkCorTile :: GroupName TileKind
cdarkCorTile  = "safeTrailLit"  -- let trails give off light
  , clitCorTile :: GroupName TileKind
clitCorTile   = "safeTrailLit"
  , cfenceTileN :: GroupName TileKind
cfenceTileN   = "outdoor outer fence"
  , cfenceTileE :: GroupName TileKind
cfenceTileE   = "outdoor outer fence"
  , cfenceTileS :: GroupName TileKind
cfenceTileS   = "outdoor outer fence"
  , cfenceTileW :: GroupName TileKind
cfenceTileW   = "outdoor outer fence"
  , cfenceApart :: Bool
cfenceApart   = Bool
True  -- ensures no cut-off parts from collapsed
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = []
  , cdesc :: Text
cdesc         = ""
  }
safari1 :: CaveKind
safari1 = CaveKind
brawl
  { cname :: Text
cname         = "Hunam habitat"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveSafari1", 1)]
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 5 3
  , cextraStairs :: Dice
cextraStairs  = 1
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("outdoor walled staircase", 20)
                    , ("outdoor closed staircase", 80)
                    , ("outdoor tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "\"Act 1. Hunams scavenge in a forest in their usual disgusting way.\""
  }
safari2 :: CaveKind
safari2 = CaveKind
escape  -- lamps instead of trees, but ok, it's only a simulation
  { cname :: Text
cname         = "Deep into the jungle"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveSafari2", 1)]
  , cextraStairs :: Dice
cextraStairs  = 1
  , cescapeFreq :: Freqs PlaceKind
cescapeFreq   = []
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("outdoor walled staircase", 20)
                    , ("outdoor closed staircase", 80)
                    , ("outdoor tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "\"Act 2. In the dark pure heart of the jungle noble animals roam freely.\""
  }
safari3 :: CaveKind
safari3 = CaveKind
zoo  -- glass rooms, but ok, it's only a simulation
  { cname :: Text
cname         = "Jungle in flames"
  , cfreq :: Freqs CaveKind
cfreq         = [("caveSafari3", 1)]
  , cminPlaceSize :: DiceXY
cminPlaceSize = Dice -> Dice -> DiceXY
DiceXY 5 4
  , cescapeFreq :: Freqs PlaceKind
cescapeFreq   = [("escape outdoor down", 1)]
  , cextraStairs :: Dice
cextraStairs  = 1
  , cstairFreq :: Freqs PlaceKind
cstairFreq    = [ ("outdoor walled staircase", 20)
                    , ("outdoor closed staircase", 80)
                    , ("outdoor tiny staircase", 1) ]
  , cdesc :: Text
cdesc         = "\"Act 3. Jealous hunams set jungle on fire and flee.\""
  }