################################################################################
# lair.des: All maps relating to the Lair branch.
#           Content order: branch entries, vault sets, decorative vaults,
#           other normal vaults, small ending vaults, large ending vaults.
#
#           Branches off of Lair can be found in their relevant file:
#           Swamp - swamp.des                Shoals - shoals.des
#           Snake Pit - snake.des            Spider Nest - spider.des
#           Pits of Slime - slime.des
################################################################################

{{
function wad_woods_setup(e, uniq, weight, mist, delaynum, sizenum, spreadnum)
    if uniq == "decor" then
        e.tags("uniq_wad_woods_decor decor extra")
    elseif uniq ~= "other" then
        e.tags("uniq_wad_woods_" .. uniq)
    end
    e.weight(weight)
    e.mons("plant")
    e.mons("bush")
    e.mons("fungus")

    if you.in_branch("Lair") then
        e.mons("spriggan")
        if you.absdepth() >= 13 then
            e.mons("wyvern / elephant w:4 / dream sheep w:2")
        else
            e.mons("wolf / black bear w:4 / yak w:2")
        end
    else
        if you.absdepth() >= 12 then
            e.mons("centaur warrior / two-headed ogre")
            e.mons("hell rat")
        elseif you.absdepth() >= 8 then
            e.mons("centaur / troll")
            e.mons("elephant")
        elseif you.absdepth() >= 5 then
            e.mons("gnoll / ogre w:1")
            e.mons("river rat")
        else
            e.mons("gnoll")
            e.mons("quokka")
        end
    end

    e.ftile(".t+%*|q012345678COGTU = floor_grass")

    e.kfeat("O = shallow_water")
    if mist then
        e.lua_marker("O", fog_machine { pow_min = 3, pow_max = 7, delay = delaynum,
                          size = sizenum, walk_dist = 1, spread_rate = spreadnum } )
    end
end

function beast_lair_populate_mons_large(e)
    local set = crawl.random2(3)
    if you.depth() > 3 then
      set = set + 3
    end
    e.tags("no_monster_gen")
    e.mons("plant") -- 1 is always plant.
    if set == 0 then
        e.mons("hound / wolf")
        e.mons("wolf")
        e.mons("wolf / warg w:1")
    elseif set == 1 then
        e.mons("black bear")
        e.mons("black bear / polar bear")
        e.mons("polar bear")
    elseif set == 2 then
        e.mons("iguana")
        e.mons("iguana / basilisk")
        e.mons("komodo dragon w:20 / hydra w:2")
    elseif set == 3 then
        e.mons("elephant")
        e.mons("elephant")
        e.mons("elephant / dire elephant w:1")
    elseif set == 4 then
        e.mons("yak")
        e.mons("yak / death yak w:6")
        e.mons("death yak / catoblepas w:1")
    else
        e.mons("water moccasin")
        e.mons("water moccasin / black mamba w:5")
        e.mons("black mamba / anaconda w:2")
    end
end

function beast_lair_populate_mons_small(e)
    -- don't do this while validating because this call changes the tags
    if not e.is_validating() and crawl.one_chance_in(25) then
        beast_lair_populate_mons_large(e)
    else
        local monster_list = {}
        if you.depth() < 4 then
            monster_list = { "black bear", "water moccasin", "bullfrog",
                             "wolf", "yak", "komodo dragon", "cane toad" }
        else
            monster_list = { "yak", "yak", "polar bear", "death yak",
                             "elephant", "cane toad", "komodo dragon",
                             "wyvern" }
        end
        e.mons(plant)
        e.mons(monster_list[crawl.random2(#monster_list) + 1])
        e.mons(monster_list[crawl.random2(#monster_list) + 1])
        e.mons(monster_list[crawl.random2(#monster_list) + 1])
    end
end

function beast_lair_randomise(e)
    e.tags("no_trap_gen")
    e.depth("Lair, !Lair:$")
    -- Tools for randomizing environments,
    -- making given glyphs plants, floor, shallow water, or empty floor.
    e.subst("A = 1:5 .")
    e.subst("B = x:3 .")
    e.subst("C = W:3 .")
    e.subst("D = Wx1.")
    e.subst("E : 1:3 .:9")
    e.subst("F : x:3 .:9")
    e.subst("G : W:3 .:9")
    -- Tools for randomizing monsters and items.
    -- M for monster, P for pack, L for loot, J for junk.
    e.subst("M = 2:4 .:8")
    e.subst("P : 2:2 .")
    e.subst("L = *:1 % .:5")
    e.subst("J = %:6 .:28")
end

function lair_small_ending(e)
    e.tags('lair_end_small')
    e.weight(5)
    if not dgn.persist.lair_second_ending_built then
      e.kitem("R = earthy gem")
    end

    if e.is_validating() then return end

    e.hook("post_place", function ()
        if not dgn.persist.lair_second_ending_built then
            dgn.persist.lair_second_ending_built = true
            dgn.place_maps { tag = "lair_end_small" }
            dgn.persist.lair_second_ending_built = nil
        end
    end)
end
}}

################################################################################
# Lair entries
################################################################################
# Dummy Lair entry
NAME:   lair_entry_dummy
TAGS:   lair_entry extra transparent
WEIGHT: 30
ORIENT: float
KFEAT:  O = enter_lair
MAP
O
ENDMAP

######################################
# Generic Lair entry.
#
NAME:    david_lair_generic
TAGS:    lair_entry transparent
ORIENT:  float
MONS:    black bear / basilisk
MONS:    wyvern, yak / death yak w:2, elephant
KMONS:   P = plant / fungus
SHUFFLE: 234, A1
SUBST:   A = ., P = P.
KFEAT:   O = enter_lair
MAP
xxxx..@..xxxx
xx.........xx
x..P.A...P..x
..PP..1...P..
@....2O3....@
..P...1..P...
x..P...A....x
xx.........xx
xxxx..@..xxxx
ENDMAP

# Shrubbed Lair entry
NAME:   david_lair_shrubbed
TAGS:   lair_entry transparent
ORIENT: float
MONS:   komodo dragon, wyvern / basilisk / iguana
KMONS:  P = plant
KFEAT:  O = enter_lair
SUBST:  ' = P., 2 = 22.
MAP
xxxxxxxxxxxxx
xxPPPPPPPPPxx
xPP1.'PPPPPPx
xPP.O.'PPP''.
xPP'.2PPP'..@
xPPPPPP''....
xP''PP......x
xx.''..'...xx
xxxx..@..xxxx
ENDMAP

# Lair monsters near stair
NAME:    dpeg_lair_monsters
TAGS:    ruin lair_entry transparent
ORIENT:  float
MONS:    yak, death yak
MONS:    iguana w:20 / black bear w:20 / komodo dragon / basilisk w:5
MONS:    river rat / hell rat / quokka / rat
MONS:    bullfrog w:40 / blink frog / cane toad
SHUFFLE: 1345
NSUBST:  1 = 2:11112 / * = 1..
NSUBST:  3 = 1:2 / * = 2.., 5 = 1:4 / * = 4:5 .:9
SUBST:   y = xx.
KFEAT:   O = enter_lair
MAP
xxxxx...@...y
x111.........
x111.y...2...
x11.y...y...@
x..yy.O.yy...
@...y...y....
...2...y2.yy.
..........yy.
y...@........
ENDMAP

# Obligatory Oklob Plant Lair Entry Vault
NAME:   dpeg_oklobed_lair
TAGS:   lair_entry no_monster_gen no_pool_fixup transparent
ORIENT: float
MONS:   fungus, plant, oklob plant
KFEAT:  O = enter_lair
: if you.absdepth() < 10 then
SUBST:  A = 11., B = 2.
: else
SUBST:  A = 2
:    if you.absdepth() < 11 then
NSUBST: B = 2 = 3... / * = 2.
:    else
NSUBST: B = 3 = 33... / * = 2.
:    end
: end
MAP
...xxxxxxx...
..x...w...x..
....x...x....
...xxBBBxx...
.x..BAAAB..x.
.xw.BAOAB.wx.
.x..BAAAB..x.
...xxBBBxx...
....x...x....
..x...w...x..
...xxxxxxx...
ENDMAP

# Grove Lair entry
NAME:   minmay_lair_entry_grove
TAGS:   lair_entry no_monster_gen transparent
ORIENT: float
MONS:   wyvern / basilisk w:4, yak, black bear / wolf
MONS:   water moccasin / iguana w:2 / scorpion w:2
KMONS:  P = plant / bush w:2 / fungus w:2
KFEAT:  O = enter_lair
NSUBST: . = 1:1 / 2:2 / 1:4 / 1 = 12 / 1 = 4. / 12:P / * = .:450 t:20 P:40
NSUBST: ' = 1:1 / 1:2 / 1:4 / 1 = 12 / 1 = 40 / 8:P / * = .:250 t:20 P:40
SUBST:  2 : 223
validate {{ return has_exit_from_glyph('O') }}
MAP
     .....
   .........
  ...........
 .............
 .....'''.....
.....'''''.....
....'''''''....
....'''O'''....
....'''''''....
.....'''''.....
 .....'''.....
 .............
  ...........
   .........
     .....
ENDMAP

# Lava Lair entry
NAME:   minmay_lair_entry_lava
TAGS:   lair_entry no_monster_gen transparent
ORIENT: float
WEIGHT: 1
MONS:   fire crab
KFEAT:  O = enter_lair
NSUBST: M = 1:1 / *:L
SUBST:  L = l.
MAP
xx.x.x.x.xx
x.........x
....lLll...
x..llllll.x
...llMMlL..
x.LlMOMll.x
..ll.Mlll..
x.l.llll..x
...lllL....
x.........x
xx.x.x.x.xx
ENDMAP

# Welcome to Lair Island. We make great pancakes.
NAME:   erik_lair_island
TAGS:   lair_entry transparent
ORIENT: float
MONS:   troll, hound w:15 / wolf
KFEAT:  O = enter_lair
SUBST:  - = w., 2 = 2:5 .:1
MAP
.@........wwwwww-.....
..-.-.-..wwwwwww.-..-.
..--w..wwwwwwwww-.--..
...--w.wwwwwwwwwwww-..
...wwww-wwwwwwwwww--..
..wwwwww--w--w2wwww..@
..wwwwww--....wwww---.
....1....2.2O2.wwww...
..-wwwww---2.2www.ww-.
.....wwww2..w.2www....
..wwwwwwwww-.wwww---..
@..wwwwwwwwwwwwwww....
....-ww..ww-www..w....
....-......--.w..---..
...........-...@......
ENDMAP

# Dragon's Lair, for generous values of Dragon
NAME:    erik_lair_dragon
TAGS:    lair_entry no_rotate
ORIENT:  float
MONS:    steam dragon / acid dragon / swamp drake
MONS:    basilisk / wyvern / komodo dragon
NSUBST:  2 = 3=2 / 3=2. / .
SHUFFLE: %!*O
SUBST:   z = .xc, ! = %
KFEAT:   O = enter_lair
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxzxxxzxzxxzx.2xxzxxxzx*zxxxz.2.xxxx
xxxxxxxxxxxxxxx.2.......zxx.x.zxxxz.zzxxxxzx.zxxx
xxxxxxxxxxxxxz....xxx...2....zzzzzz..zzzzx..%cccc
xxzxxzzzxxxxx..xxzzxxzz..........z...zzz..zzc+.zc
@......xxx.2.xxzxxxxxxzxzxzz.......1...2.x.ccc.zc
xxxzxxx...xxxxxxxxxxxxzxxxx.zz.2...z......zccc$cc
xxxxxxzxxxzxxxxxxxxxxxx....xxzz...z....zz..zzcczc
xxxxxxxxxxxxxxxxxxxxxzz2xxxzxxzzzz..zzz2zz.2Ozccc
xxxxxxxxxxxxxxxxxxxxxz!zxxxxxxxxxx.xxxzxxxzxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# Orcish Takeover!
NAME:   erik_lair_orcish_takeover
TAGS:   lair_entry transparent
ORIENT: float
MONS:   orc, wolf, orc warrior / warg
MONS:   orc priest / orc wizard / plant
KFEAT:  O = enter_lair
MAP
xxxx..@..xxxx
xx.........xx
x...2...44..x
...4..1......
@....3O.....@
......1..4...
x...4...2...x
xx.........xx
xxxx..@..xxxx
ENDMAP

# Plant/fungus spiral (due)
NAME:   due_lair_maze_entry_diamond
TAGS:   lair_entry transparent
ORIENT: float
MONS:   water moccasin w:30 / scorpion / bullfrog w:30 / \
        black bear w:25 / yak / komodo dragon w:5
KMONS:  P = plant / fungus
KFEAT:  O = enter_lair
SUBST:  P = P:60 `
NSUBST: 1 = 3:1 / * = 1:30 P .
NSUBST: . = 10:P / 10 = P. / 4:1 / 2 = 3. / *:.
validate {{ return has_exit_from_glyph('O') }}
MAP
       ..P.P..
     ...........
   ..P.P.PP.PP....
 .....PP..PP1PP..P.
 .P..PPPP.PP.PPP...
....P.PPPP1PP.PPP....
.P.PPP1P.PPP.P.PPP...
...PPPP.P1PP.P.PPP...
...PPP.PPPO.PP.P.P...
.P.P1....PPPP1PP.P.P.
..PPPPPP.PPP.PP.P....
 ....PPPP.P.PP.P..P.
 P....PPPP.PP.P..P..
   .P..PPPPP.P....
     ......P....
       ..P....
ENDMAP

# A guard hut placed over the entrance of the lair,
# and a guard to watch over it.
NAME:   grunt_lair_entry_orc_guard_hut
TAGS:   lair_entry transparent
ORIENT: float
MONS:   bullfrog w:15 / scorpion / black bear
MONS:   yak / elephant / komodo dragon
MONS:   patrolling orc warrior
KMONS:  P = plant / fungus
KFEAT:  O = enter_lair
NSUBST: D = 2:1 / 2 = 1` / * = P``, 1 = 2:1 / 1:2 / 2 = 1. / 1 = 12 / * = `
SUBST:  P = PP`, . = P:1 .:5, ` = .
validate {{ return has_exit_from_glyph('O') }}
MAP
    ...@..
  ..D.P.P...
 ..D.PDPDP...
 .D.PD11PDP..
.D.PDPDPDPDP..
..PDPccccDPDP.
@PD1DcO2cP1P..
..P1Pc%`cD1DP@
.PDPDcc+cPDP..
..PDPDP`PDP.D.
 ..PDP11DP.D.
 ...PDPDP.D..
  ...P.P.D..
    ..@...
ENDMAP

NAME:    mainiacjoe_lair_zoo
TAGS:    lair_entry transparent no_monster_gen no_item_gen
ORIENT:  float
SHUFFLE: NALPS
KMONS:   P = anaconda / shock serpent
KMONS:   L = catoblepas / eight-headed hydra
KMONS:   N = emperor scorpion / orb spider
KMONS:   A = kraken / alligator snapping turtle
KMONS:   S = bunyip / goliath frog
KMONS:   z = orc knight ; whip
NSUBST:  P = P / `, N = N / `, A = A / W, S = S / W, L = L / `
SUBST:   T : TG
KFEAT:   AS = shallow_water
KFEAT:   ` = floor
KFEAT:   # = iron_grate
KFEAT:   O = enter_lair
FTILE:   `PNL = floor_dirt
KPROP:   `WANPLS = no_tele_into
MAP
.............
.............
..####c####..
..#AAAcNNN#.....
..#AAAcNNN#......
..#AAAcNNN#.T.T...
..ccccccccc........
..#PPPc...+.....T..
..#PPPc.z.+..O.....
..#PPPc...+.....T..
..ccccccccc........
..#LLLcSSS#.T.T...
..#LLLcSSS#......
..#LLLcSSS#.....
..####c####..
.............
.............
ENDMAP

NAME:   hellmonk_lair_entry_icy
TAGS:   lair_entry transparent
ORIENT: float
MONS:   ice beast, wolf / polar bear w:3, rime drake
NSUBST: 3 = 3 / 2.., . = 2 / 4 = 2... / .
SUBST:  x = xxx., - = W:5 ':25 x:20 .:15
NSUBST: ' = 16 = 1''' / '
KFEAT:  O = enter_lair
TILE:   x = wall_ice_block
FTILE:  '1 = floor_ice
COLOUR: '1 = blue
MAP
       -------
     --'''''''--
    -'''''''''''-
   -''''-----''''-
  -'''.........'''-
 -'''.x.x...x.x.'''-
 -'''..xxx.xxx..'''-
-'''-.xxx.3.xxx.-'''-
-'''-..x.....x..-'''-
-'''-...3.O.3...-'''-
-'''-..x.....x..-'''-
-'''-.xxx.3.xxx.-'''-
 -'''. xxx.xxx..'''-
 -'''.x x...x.x.'''-
  -'''.........'''-
   -''''-----''''-
    -'''''''''''-
     --'''''''--
       ---@---
ENDMAP

###############################################################################
# Regular Lair vaults.
###############################################################################

#######################################
# Vault sets.
# First, a group of oklob-focused vaults.

NAME:   minmay_lair_oklob_tunnel
DEPTH:  Lair, !Lair:$
ORIENT: southwest
MONS:   plant, oklob plant
NSUBST: 1 = 4:2 / 4 = 10 / *=1..
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx11xxx111.....
xxxxxxxxxxxxxxxxxxxxxxx111xxxx111xx111...@
xxxxxxxxxxx111xxx11xxxxx111111111111111..x
xxxxxxxxxx11xxxx11xxxx111111111111111111xx
xxxxxxxxxx1xxxxxx11111111111111111111x1xx
xxxxxxxxxx11xx1111111111111xxx11111xxxxxx
xxxxx11xx1111111111111111111xxxxxx111x
xxxxxx1111111111111xx111xxx11xxxxxxxxx
xxxx%+11111111111xxxxxx11xxxxx
xxxx%xxx11111xxx11xxxxxxxxxx
xxxx|xx11xxx11xxxxx
xxxxxxxxxxxxx111xx
xxxxxxxxxxxxxxxxx
xxxxxxxxxxx
xxxxxxxxx
ENDMAP

NAME:   minmay_lair_oklob_items
TAGS:   luniq_oklob extra
DEPTH:  Lair
MONS:   plant / fungus w:3 / bush w:5
KMONS:  | = oklob plant
KITEM:  | = |
SUBST:  X = xx_
CLEAR:  _
SUBST:  % = ....%%%%**
MAP
XXXXXXXXX
Xxxxxxxxx.
Xx%%%1.x.@
Xx%%%xx.x.
Xx|%%xxxx
XxxxxxXXX
XXXXXXX
ENDMAP

# Combined vault with four size settings, each with
# one more oklob and more items.
NAME:   minmay_lair_oklob_chamber
TAGS:   luniq_oklob no_monster_gen
DEPTH:  Lair
ORIENT: north
KMONS:  p = plant
KMONS:  P = oklob plant
# Lair:1 is absdepth 11, for reference.
: local size = crawl.random2(10) + you.absdepth() - 10
: if size > 8 then
SUBST:  '`" = ., yza = x, XYZ = ?, 1234 = p
NSUBST: ? = 1:% / 4:P / * = ?
: elseif size > 6 then
SUBST:  '` = ., XY = ?, yzZ4 = x, 123 = p
NSUBST: ? = 1:% / 3:P / * = ?
: elseif size > 3 then
SUBST:  ' = ., X = ?, 3yY = x, 12 = p
NSUBST: ? = 1:% / 2:P / * = ?
: else
SUBST:  X2 = x, 1 = p
NSUBST: ? = 1:% / 1:P / * = ?
: end
CLEAR:  '`"34yzaYZ
SUBST:  ? = ....111$$%%*|
MAP
xxxxxxx
xxxxxxx
xxxxxxx
aaaaaaa
zZZZZZa
yYYYYZa
xXXXYZa
x??XYZa
x??XYZa
x11234a
....'`"
 .@'`"
ENDMAP

# Combined vault. More and more open space
# for an oklob plant ringed by bushes.
NAME:   minmay_lair_oklob_bushes
TAGS:   luniq_oklob extra
DEPTH:  Lair
MONS:   oklob plant, bush
: local size = crawl.random2(10)
: if size > 8 then
SUBST:  `'" = .
: elseif size > 6 then
SUBST:  `' = .
: elseif size > 3 then
SUBST:  ` = .
: end
CLEAR:  `'"
MAP
       """
    """""""""
   """""""""""
  """""'''"""""
 """"'''''''""""
 """'''```'''"""
 """''`.%.`''"""
"""''`.222.`''"""
"""''`%212%`''"""
"""''`.222.`''"""
 """''`...`''"""
 """'''```'''"""
 """"'''''''""""
  """""'''"""""
   """""""""""
    """""""""
       """
ENDMAP

###############################################################################
# A long set of wood themed vaults, as salvaged scraps from an idea for an
# early outdoors portal vault. Can generate in Lair and occasionally D.
# uniq_ tagged by tier: large, medium, small, rock, and decor.
#
NAME:   wad_woods_pond
DEPTH:  D:2-, Lair
ORIENT: float
: wad_woods_setup(_G, "large", 1, true, 21, 2, 36)
FTILE:  ' = floor_dirt
MAP
                 .         tt.
             tttt. tt  ttttt...ttt    tt   tt
         tttttttt...ttttttt....tttt....t. ttt
      tttt11.tt.t...t11t.......tt.ttttt..t..tt
     ttttttt..tt.t1...t.1t...t...t...tttt..t.tt
   ttt.tt.ttt1t1t.t.....tt.........t....ttt....
  ttt....tttt.t.........Wt.t............t..t.t
 ttttt..ttt.t...t.W.OWtWt1t....1........t....tt
 tt11.tttt1.t..t...W1tWWtW1tWt....1....'.''..tt
ttt1.t.1t.t......WtWWWwWWtWWtWtW.W......''...t
 tt...t........tWtWWww.w0%WWWWWWWt.1......'..t
  tttt...t...t....ttWWtwwtWWWtWW1W......11t1.tt
  ttt...11t1t.t...W.W.WWWWtW1tW.tt.......t.tttt
 tt.t.t.tt.t1tttt....W.tWtW1WO.t....1...t1.t...
ttt..tttttt.tt.t.t.1.........1.........ttt..1t
 tt.t...tttt.t1.11................t.t.t.ttttt
 tt...t..t.tt1t11..1t..........t1t.t.t1t.tt1.
 tt....1t..tt.t1...ttt1...1...t.t.t.t.t.t.t...
ttt....tt1tt.t......1ttt1...tttt.ttt1t.t.t.tt..
 tt...t11tt..1t........tt.1t.tt.tt.tt1t.t.t.tt.
 .t......t..1t1.....1..1t.t.tt.t.t.t.t.t.t.t
...t.......t1.........1t1tt..1tt..t.ttt.t.t.
 .t1t....1.....'.....t.1..tt.t..t..11ttt1t.t
  1.tt.1.....''''...tt..t..tt..t1.1tt..tt1t.t
     ......'''''.....tt.t.11tt..t..t.1t..t.t.t
      ..1...'.'''..t..t.11.t.tt...t1.ttt..t..t
      t.........1...tt.1.tt.tt..t.tttt...t..tt
      .t1.1..1.......t..t.t.1tt.t11..t.t..1t
       ..1.11..1.11t.1t.tttt.t.t1.t.ttt..1ttt
          ..111.1.ttttttt    ttttt tttttt.tt
            ......ttttt       ttt  tttttt..
              ..   ttt                    .
ENDMAP

NAME:   wad_woods_settlement
DEPTH:  D:2-, Lair
ORIENT: float
: wad_woods_setup(_G, "large", 1, true, 21, 2, 36)
NSUBST: 4 = 2:4 / 1 = 4' / *:', 6 = 4
FTILE:  '4*+ = floor_dirt
MAP
               ..  tttt   ...   ...
          .tt.t...t11t.......tt.ttt
       .tt..tt.t1...t.1t...t...t...ttt
     tt.ttt1t1t.t................t....ttt.
      .t.tt.t.......xxx...............t..t.
    ..ttt.t...xxx...+4x'''''''1......x.t..
  1.tt.t1.....x4+'''xxx'....x+xx1...x.....
t1.t.1t.t.....xxx..'1'''..1.x''x..........
t...t..............'''1..T..x*6x..1.x......
tttt...t...t.........'.%....xx+x1...x.11t1.
 tt...11t1t.t.....x..''''''''''........t.ttt
..t.t.tt.t1tt.t....x''.xxxx.......1...t1.t.
t..tt...t.tt.t.t.1''x''+%4x..........ttt..1
t.t...tt.tOt1.11.'....1xxxx1....t.t.t.ttttt
 ...t..t.tt1t11.'1t..........t1t.t.t1t.tt1.
  ...1t.%tt.t1..'tt.1....1..t.t.t.t.t.tOt...
  ...tt1tt.t....'.1ttt1...tttt.ttt1t.t.t.tt
  ..t11tt..1t...'....tt.1t.tt%tt.tt1t5t.t
 ......t..1t1..G4G1..1t.t.tt.t.t.t.t.t.t.t
.t.......t1.....'...1t1tt..1tt..t.ttt.t.t
t1t....1........'..t.1..tt.tO.t..11ttt1t.
1.tt.1....xxx..'..tt..t..tt5.t1.1tt..tt1tt
  t.......x4+''....tt.t.11tt..t..t.1t..t.t.
  tt..1...xxx....t..t.11.t.tt...t1.ttt..t...
.t1.t.........1...tt.1.tt.tt..t.tttt...t..tt
1.t1.t1.1..1.......t%.t.t.1tt.t11..t.t.51ttt
tt.11..1.11..1.1  .1t.ttt      .t.ttt..1tt
.1t   .1  111. .     tt        tt.t ttt.tt
ENDMAP

NAME:   wad_woods_tower
DEPTH:  D:2-, Lair
ORIENT: float
FTILE:  q13%OG. = floor_woodground
: wad_woods_setup(_G, "large", 2, true, 21, 2, 36)
FTILE:  '*+T4 = floor_dirt
MAP
   tttt....   .tt1   tt.t    tttt  ..t
t.1.tttt.tt.11O..t.11ttt..  15tttt....t
t..11xxx.t.tttt.tttt....t1t..11t.t..ttt.
 .t.xx4xxt.1ttt..t1t.tt.ttt.tttt.1.ttt1
 .1x+'*'+x..t....t..t..1.t..11tt...t....
  .txx4xx.....t.1ttt.1ttt.1..t.t...t.1
t.15txxx.t.t.t..tt1.1G...t.t.1tt..ttt.
 ..t.t...tt..t..1...'''%..1t..t..t...t.
  .tt.t1...1t.1t...G'T'G.tt......t......
 ...t..t.tt..111.t..'''.11.1..t.t.1..t.
 ....t.t.t.ttt1.tt.1.G1t.t....t.t.5ttt..
..t.tt.t.t..t1t..t.t1tt.ttt.t...1..ttt
.11O...t..5.t..11t..t....1..11tt.1.t..t.
t..t1t..t...11t..ttt..ttt....tOt...t.11t
  1..t..t.  t..tt. 1t..  tt..tt  ttt.tt
   t.t.1.   .t1.  ..     .11    .t.1...
ENDMAP

NAME:    wad_woods_stonehenge
DEPTH:   D:2-, Lair
ORIENT:  float
: wad_woods_setup(_G, "med", 2, true, 21, 2, 36)
SHUFFLE: 4% / '"
SUBST:   '" = .
MAP
       .....t..tt1.t  t.t    .. tt...
      tt1tt.1tOt.t.11ttt..1.15tttt.1..
     ttt%t.tttt.tttt....t1t..11t.t.1tt..
    ttttttt1ttt..t1t.tt.ttt.tttt.1.ttt1t
    ttttttt.t.t..t..t..1.t..11tt1..t.1.ttt
   tttttt1t.1.t.1ttt.1t..1..t.t...1t11..tt
  15tttttt1t.t...t1..G...t.t......tt..1t11
t.tt.t.t.tt..t..1......c...c...t..t..t.t
.t11t.t1.t.1t.1t.........%.......t..1...
t1..t1.t.tt.t111.t...c.04C40.c..1t.1.tt.t.
 .1t.t.11t.ttt1.t..1.....%......t.5tttt...
  t.tt.t.t..t1t......1.c...c...1.1..tt1.
  1O.ttt1.5.t..11t1....1.1..11tt.1.t1...
   t1tttt.1.11t..ttt1.tt11tt.tOt1.tt.11
    tt..t.t1   tt.11t1.1    .tt.1ttt.
      .t.t  .   .t..t        .t1.t
ENDMAP

NAME:   wad_woods_01
DEPTH:  Lair
: wad_woods_setup(_G, "small", 2, true, 21, 2, 8)
MAP
     tt.tt  tt.1ttt
    tt...tt1tOtt.1.t
   ..1ttt....tttt...
 t4t.ttt.tttttt4t.t.1t
 t.tt..1tt1.tt.t.tt.tt
 .tt.%1...tt.1ttt..t.tt
tO1.tt..tt.t.t.tttt4t1
t.t.tt.t.tt.tG..ttt.tt
tt.ttt.1..ttt..ttt.1.tt
t.tt.ttttt.tt1ttt1.t.tt
ttt.tt4ttt..%.4ttOttt
  ..1tt.t1t..G...t.t
   .tt..4t1t.t.tt1t
    .ttt  .t..ttt
ENDMAP

NAME:   wad_woods_02
DEPTH:  Lair
: wad_woods_setup(_G, "small", 2, false, 0, 0, 0)
MAP
   .1t1.t   .t.1t
   t.1...t.1t1tt.1
   151t.t.1..t1tt...
  1t.ttt.tt.1t1t..t1
 t.tt.11tt1....t.tt.t
t.tt.%4..WWW......1t.tt
tt1.....WWwWW..t.tt.t1.
.1t.tt...WWW...tt1.t.t4
 t.t.t.1..W.4..t1t.1.tt
t.tt.t1t..1..1t.t1.t.
...1t11t1t.1%.ttt...
 t1.1tt.t1t..G..1..
  t11..1tt    .1.1t
    .1..1       .1.
ENDMAP

NAME:   wad_woods_03
DEPTH:  Lair
: wad_woods_setup(_G, "rock", 3, false, 0, 0, 0)
FTILE:  '%0+14 = floor_dirt
MAP
          .t t.tt'xx
   .''t...tt'''''t.1x
@'''.t''''''ttttx11x1tx
  ttt..t.tttxttxx11xx1x
  ...1t.tttxxxxxxx+xxx1
  .t..tttxtx%'4x''''x1x
  t.tt.tttxx%'0+'''0xx1
  .tt.tttttxxxxxxxxxxxx
   ....tt..tttxxtxxxxxx
    ..tttt..1xtttxxxxxx
    ...t1.ttt.1ttxxxxxx
      ..t.tt1txxtxxxxxx
         ttxxxxxxxxxxxx
            t1txxtttxtx
ENDMAP

NAME:   wad_woods_04
DEPTH:  Lair
ORIENT: float
: wad_woods_setup(_G, "rock", 2, false, 0, 0, 0)
FTILE:  '+*0 = floor_dirt
MAP
            .tttttt.ttxtx
          t1t.tttxtt.tttx
      tt1t11tt11ttxxx.xxx
     tt.tt..tttttttx.x.xx
    tt1t..tt11txxtt.ttx..
    tttt.tttttxxxx.xxxxxx
   tt1t2tttx.xxxx....xxxx
   ttt11tt1.t..t.txxx.x.x
  ..tttt1t.ttxx.xxxxxx.xx
 .t.1.tt....ttxttxt..xx.x
.ttttt..tttttttt.xxx..1x.
tt1t.t.txx..xx..xxxxxxxxx
tt...tttttxx.t.xxtxxxxxxx
x.tt.x.xxxxx..xxxxx''*xxx
.xx1xxxxxxxxxxx101x'0'xxx
xxxx1.........4xxx+'''xxx
xxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   wad_woods_06
TAGS:   extra
DEPTH:  Lair
: wad_woods_setup(_G, "small", 2, false, 0, 0, 0)
MAP
    tt2ttt  1
   tt.ttttt1t
  tttt.ttt1tt
tt1tt.1.tttt
tttt0...2tt1
 tt...G0.1ttt
 ttt02..1ttt
tt1tt...ttttt
t1tt1ttt21tt
   tttttt.t
     tt1t.t
ENDMAP

NAME:   wad_woods_river_01
TAGS:   extra
DEPTH:  D:2-, Lair
ORIENT: float
: wad_woods_setup(_G, "med", 1, false, 0, 0, 0)
MAP
      tttt       ttttt
   t.tt1t.tt.   tt.t..tt
  t..t1ttt.t.t.tt11t.tt.t
 .1tt.ttttttt.t.t..t.t.t...
 .t.tttttt.t.tt1....t.t.t...
  t.t1tttt.1ttt.t.ttt.t.tt1t.
.ttt.t.tt1t.1t.tt1t0t.tt.t.ttt
t.1t5tt.tt.tt.t.ttt%t.t.t1tttt
ttt1t......0..1tWWWWWWWWWWWttt
 tt...tWWWWWWWWWWwwwwwwwwwWWWW
WWWWWWWWwwwwwwwwwwWWWWWWwwwwww
wwwwwwwwwwwWWWWWWWWW1.tWWWWWWW
WWWWWWWWWWWWWt....1.......ttt
tttt..tt.t..%.t.t..ttt1..t.tt
ttt5tt.t.tt1t1t.t%1tt.t5tttttt
 tt1t.tttttt.t.tttt.t.t1t1.ttt
  ttt.t.t1t.t.t.1tt.t.tt11tt
  tt.1tt1t.ttttt.t.t.t1t.ttt
    .t1tttttttttttt.ttt.t.tt
    .tttt   tt ttttt.ttttt
   .ttt           ttt.tt
ENDMAP

NAME:   wad_woods_river_02
TAGS:   extra
DEPTH:  Lair
: wad_woods_setup(_G, "small", 1, true, 32, 2, 24)
MAP
      tttttttttt1tt
   tt1ttt..WWWW..0tt
ttt1ttt0.WWWwwWWW..tt
t11t.WWtWWWwwwwwWWWtt
.tt.WWWWWWwww|twwwWWt
WWWWWWwwwwwww>OwwwWWt
wwwwwwwwwwwwwwwwwwWWt
WWWWWWwwwwwwwwwwWWW1t
..ttWWWwwwwwwwWWW..tt
tt.t.tWWWwWWWWW.t.ttt
ttt1ttt.WWWt.ttt0t1t
  tttt1t0.ttttttt1tt
    tttttttttttttt
ENDMAP

NAME:   wad_woods_river_03
DEPTH:  Lair
: wad_woods_setup(_G, "decor", 1, false, 32, 3, 24)
MAP
   1t.tWwW.t.t.t
   t.ttWwWt.tt1t
   t.ttWwW.t11tt
  t11.WWwWWt.t1t
tt1t.WWwwWW.ttt
t1ttWWwwWW.tttt
t.WWwwwWWtOttt
WWwwwWWtt.t.t
wwwWWtt.tttt.
WWWWt.t.t1t
.tt.t.t1tt
ENDMAP

NAME:   wad_woods_river_04
TAGS:   no_vmirror no_rotate
DEPTH:  D, Lair
TILE:   X = wall_brick_dark_leak
TILE:   x = wall_brick_dark
SUBST:  X = x
: wad_woods_setup(_G, "decor", 1, false, 0, 0, 0)
MAP
   ttttxxxtttt
 tt1txxxxxxxtt
ttt1xxxxXxxxx1tt
tttt1xxxWxxx1tt
ttt.t.1tWt.1t1tt
tt.t1tt1WW1tt.tt
.1ttt1tWWtt1tt.t
ttt11tttWWttt1t1
tt.ttt1WWWtt*ttt
t.ttttWWWttttt1t
 tttt.WwWttt.tt
   tttWwW1tttt
   tttWwW..ttt
    ttWwWt..t
ENDMAP

NAME:   wad_woods_road_01
DEPTH:  Lair
: wad_woods_setup(_G, "decor", 2, true, 32, 3, 24)
FTILE:  @' = floor_dirt
MAP
    t1t.t1  tt.1tt   .@
  .1tt1.1   tOtt.1.tt.'
 tt..2ttt.1..tttt...%'.
 t2t.ttt.ttt1tt2t.t.'.
1t.tt..1tt1.tt.t.tt'.1
t.tt.%1..1tt.1ttt''t1tt
.........G.....1'...1..
@'''''''''''''''''''''@
.1...1...T3............
t.t.tt.t.tt.tG..t.t.ttt
tt.ttt.1..ttt..ttt.1.tt
 .tt.t2ttt.tt1t1t1.t.t
 tt.tt2ttt..%.2ttOttt
 t..1tt.t1t..G...t.t
  t.tt..2 1t.t.tt1t
  t21t      ..tttt
ENDMAP

NAME:   wad_woods_road_02
TAGS:   extra
DEPTH:  Lair
: wad_woods_setup(_G, "small", 2, false, 32, 0, 0)
FTILE:  @' = floor_dirt
MAP
      ttt      t
   ttttt1t  111ttt
 t.tttt1ttttt1t1t.t
t1t.tt1ttttttt1ttt.t
t....t.'''''0t....t.
@'''''''.G%''''''''@
t....t0'''''.t....t.
ttt..ttt1tt11tt.t.tt
tt.tt.t1tt1tt1ttttt
tt1tt1ttt303tttttt
 ttt1ttt3.U.3t1ttt
   tttt1t3.3ttt1tt
     tt ttttt1 tt
ENDMAP

NAME:   wad_woods_road_03
DEPTH:  Lair
: wad_woods_setup(_G, "decor", 2, false, 0, 0, 0)
FTILE:  @' = floor_dirt
MAP
       tt..@.tt
     1tt..'..t.t
   ttt1t..'.t.ttt
 tt1ttt..'.t0t.t
tt1tt...'.tttt
ttt..'''.t1t
....'..11ttt
.'''..ttt1t
@....tt1t
...1tttt
tttt1tt
ENDMAP

NAME:   wad_woods_road_04
DEPTH:  Lair
KMONS:  P = oklob plant
: wad_woods_setup(_G, "small", 1, false, 0, 0, 0)
FTILE:  @'+T = floor_dirt
MAP
  ttt..@..ttttttttt
 t11...'.ttt1ttP11t
 tttt1..'.tttt1t*1tt
ttt1tttt.'..ttttt1t
  ttttttt.'..1tt1ttt
   tt1t...'tttt..t..
  t1tttt.''''''''...
  ttttt..'.t1.tt.''@
   ttt1t.'tttttttttt
   tt1ttt.'.ttttttt
  tt1tttttt'..ttttt
  ttt1tt1..'.ttttt
   ttt1tt..@ttt
ENDMAP

NAME:   wad_woods_road_05
DEPTH:  Lair
KMONS:  * = 9
KITEM:  * = *
: wad_woods_setup(_G, "small", 2, false, 0, 0, 0)
FTILE:  @'*+T = floor_dirt
MAP
       .ttttt1.@.tt
     .1ttttt..'t1tt
    .tt..1t.''tttttt
   tt1tttt.'.t.tW1tt
ttt.tt....'.t1t1WWtt
tt.t.tt..'..tttttWWW
 tttt...'..t1tttxtWw
 t.1t.''tt1t1ttxxxtW
 ttt.'.t1tttt1x+*xxt
ttt.'.tttt   t1xxxtt
tt.@t1ttt    tttxttt
ENDMAP

NAME:   wad_woods_road_06
DEPTH:  Lair
: wad_woods_setup(_G, "decor", 1, false, 0, 0, 0)
FTILE:  @'*+T = floor_dirt
MAP
   tt.'@@..tt1ttttt..@@@..ttt
  tttt.'..ttttt1t11..'...1t11t
 tt1tt..'...tt1t1t...'..tt1tx1t
 tttt1t..'....tttt...'..tttxxx1
 ttttttt..''...ttt..'...ttttx1t
  tttttt1t..'...t..'..1.tttt%tt
   tttt.t1tt.''.%.'....t1tt1ttt
     t1ttttttt.'''...tt111t1tt
      ttttttttt1....tt1ttt1tt
       tttttttttttt1tttttt
           tttttttttttt
ENDMAP

NAME:   wad_woods_minihive
TAGS:   uniq_beehive
DEPTH:  D:8-, Lair
ORIENT: float
MONS:   killer bee, queen bee
KMONS:  8 = meliai
KITEM:  8 = %
KFEAT:  a = x
: wad_woods_setup(_G, "med", 5, false, 0, 0, 0)
: if you.in_branch("Lair") and you.depth() < 4
:  or you.in_branch("D") and you.depth() < 12 then
SUBST:  8 = 6
: end
KMASK:  W = no_monster_gen
COLOUR: a = yellow
TILE:   a = wall_wax
MAP
        ttttttt..t    tt.
      .ttt.t.tt...t  ttt..
    ttt.tt..tt.1t.t.1t...t...
 t.t1ttt....1WW..t....t1...t...
t..t..t.1..tWWW.t...1..t.tt..tt.
ttt.t1...t...tWW.1t.t...tt...ttt
tttt....aaamaaa1Wt.t...t..tt1ttt
t.t1.t1aa6.a66aaWWt1.1t.ttttttt
 tt.ttaaa.aba.aaaWW.t..ttttt1ttt
  tt.aa86a7a.a.6aaWtt1t...tt.tt
  t.aaaaaab|baaaaaa.t.......ttt
 t1.1aa66a.a.a.8aa.t...t.t.ttttt
tt.1..aaa.aba6aaa.1..t..tttt%ttt
t.t....aa.8a6.aaWW.t.tt.tt..t
tt.t.1.1aaaaaaaWWwW1.t..t.tt
 tt.t1.1....t1WWwW.....1ttt
  1..t.tt..tt.tWWt1.1tt...
    t.tttxtttt1ttttttxx.
      .txxxt   ttxxtttt.
ENDMAP

NAME:   wad_woods_structure_01
TAGS:   no_monster_gen
DEPTH:  D:10-, Lair
ORIENT: float
: wad_woods_setup(_G, "large", 5, false, 0, 0, 0)
FTILE:  "2T = floor_grass
FTILE:  @'0+ = floor_dirt
MAP
   ttxcxxxxxxxxxxxxxxxxxxxxxxxcxxxxxct
 ttttxc''''+''0'xxxxxx'''+''0'cx0'0'ctt
 t.ttxc''0'xxxx'x''00x'''x''''cx''''ctt
 tt.txc'0''x''x'x''''x''0x''''cx''''ct1
tt.t.xc''''x''+'+'''0x'''x''''cc+cc+ct1tt
t.t.txccc++ccccccxcxcxcxcc++cccx'x2'2tt1tt
tttt.t.tt''tttttttcttttttt''ttx''x"'"ttt1t
  ttt..tt''''''tttcttt''''''ttxxxx2'2tt1tt
 ttt.tt..ttttt''ttctt''t...t.ttt.2"'"2.tt
 t.tt.t.t.t..tt''tct''ttt..tttx22""'""22tt
 tt.tt.ttt...t.t''c''t..t.t..tx2""'''""2tt
 ttt.ttt..t.t.t..'''tt.t.ttt..x"2''T''2"tt
  ttt...ttt.tt...0'0t.tt...tt.x2""'''""2t
  ttt.t.t..t.t...'''ttt..tt..tx22""'""22tt
tcccccccccccccccc+c+ccccccccccccccc+ccccct
 tttttt.111ttt.1x'x'xtttttttttttttt1ttttt
 ttt%1.tttt1..tt.'''.ttttttttttttt1.1tt
  ttt.tt..1txxxc.'''.cxxxttt1tttttt.tttt
 tt.tttt%.ttt1tt.'''.tttttt.t1ttttt.%*tt
  tt.1ttt.tt1txx.'''.xxtt..ttt%tttttt..t
  ttt.%.tt.tttcG.'''.Gct1tttttt.tttt..ttt
 ttt.t1t1t.tttxx.'''.xx1ttttttt.ttttt.ttt
 tt.tttt*.tt1ttt.'''.11ttttttt.tt1t.1tttt
 ttt1tttttttt1xx.'''.xxtttttt.t.%t1tt
 ttt..ttttttttcG.'''.Gcttttttt%.t.
  tttt1.%tt   xx..'..xxtttt
   ttttttt     1t.@.tttt
ENDMAP

###############################################################################
# A set of vaults converted from the ultimately-dispersed Forest.

NAME:   grunt_forest_stairs_basic
TAGS:   transparent extra luniq_staircase decor
DEPTH:  Lair
MONS:   plant
SUBST:  1 = 1.
: if you.depth() == dgn.br_depth(you.branch()) then
SUBST:  ) = (
: end
MAP
.........
..t...t..
.t11.11t.
..1t.t1..
....)....
..1t.t1..
.t11.11t.
..t...t..
.........
ENDMAP

NAME:    grunt_forest_small_clearings
TAGS:    transparent extra decor
DEPTH:   Lair
MONS:    plant / bush
KPROP:   G = no_tele_into
SHUFFLE: Ww. / ''` / ''`
SUBST:   t = t.., '` = 1:49 .:405
SUBST:   G = w-, W = WW., w = wwW
KMASK:   w- = no_monster_gen
KMASK:   w- = opaque
MAP
 tt@@@tt
t.......t
t..WWW..t
@.WwwwW.@
@.WwGwW.@
@.WwwwW.@
t..WWW..t
t.......t
 tt@@@tt
ENDMAP

NAME:   grunt_forest_stairs_clearing
DEPTH:  Lair:2-, !Lair:$
MONS:   wolf, black bear, polar bear, spriggan
KMONS:  P = plant / bush
NSUBST: t = 2:t / * = t.
NSUBST: Q = 3:1 / 1:2 / 1:3 / 1:4 / *:.
MAP
.tt...tt.
t..Q.Q..t
t.t.Q.t.t
.Q.P.P.Q.
..Q.).Q..
.Q.P.P.Q.
t.t.Q.t.t
t..Q.Q..t
.tt...tt.
ENDMAP

# A secluded grove.
NAME:   forest_entry_grove
DEPTH:  Lair:2-, !Lair:$
MONS:   centaur w:4 / spriggan
MONS:   wolf, black bear, polar bear
KMONS:  P = plant / bush
NSUBST: Q = 2:1 / *:.
NSUBST: R = 3:2 / 1:3 / 1:4 / *:.
MAP
   xxxxxxxxx
  xxxttttxxxx
 xxxttttttttxx
xxtttt...tttxxx
xttt..Q.Q..ttxx
xttt.Q.R.Q.tttx
xtt.........ttx
xtt.R..)..R.ttx
xtt..R...R..ttx
xttt..R.R..tttx
xttt.......tttx
xxtttt...ttttxx
 xxxtt..ttxxxx
  xxxtt..ttxx
   xxtt@@ttx
ENDMAP

NAME:   grunt_forest_small_clearing_treed
TAGS:   transparent patrolling
DEPTH:  Lair
MONS:   plant / bush
NSUBST: t = 2:t / * = t..
SUBST:  T = t, * = **t
KPROP:  * = no_tele_into
KMASK:  * = opaque
MAP
 tt@@@tt
t.......t
t.1...1.t
@..TTT..@
@..T*T..@
@..GTT..@
t.1...1.t
t.......t
 tt@@@tt
ENDMAP

# Previously large_clearing_fruit, _statues, _slash, _guards
NAME:    grunt_forest_large_clearings
TAGS:    transparent no_pool_fixup
DEPTH:   Lair
WEIGHT:  15
KMONS:   p = plant / bush
MONS:    wolf, black bear / polar bear, spriggan / centaur w:4
KMONS:   4 = spriggan rider / faun w:4
KMONS:   9 = 9
KITEM:   94 = *
KFEAT:   94 = W
SHUFFLE: wW'"-9 / ''GG'4 / '''0'% / ````1G
SUBST:   t = t.., '. = p:49 .:405, W = WW., "w = wwwW
NSUBST:  1 = 3=1 / 2=2 / 3 / .
MAP
      tt@@@tt
    ttt.....ttt
  ttt.........ttt
  tww...........t
 ttwww..........tt
 t..www..'.......t
tt...w"w....'....tt
t.....ww-.-.......t
@......-.W--......@
@....'..W9W..'....@
@......--W.-......@
t.......-.-ww.....t
tt....'....w"w...tt
 t.......'..www..t
 tt..........wwwtt
  t...........wwt
  ttt.........ttt
    ttt.....ttt
      tt@@@tt
ENDMAP

NAME:   grunt_forest_large_clearing_hut
TAGS:   transparent
DEPTH:  Lair
MONS:   plant / bush, spriggan / centaur w:2
SUBST:  t = t..
SUBST:  . = 1 .:90
COLOUR: -*29 = lightgrey
FTILE:  -*29 = floor_normal
MAP
      tt@@@tt
    ttt.....ttt
  ttt.........ttt
  t.............t
 tt.............tt
 t...............t
tt...............tt
t......ccccc......t
@......c-9*c......@
@......+-*2c......@
@......c-9*c......@
t......ccccc......t
tt...............tt
 t...............t
 tt.............tt
  t.............t
  ttt.........ttt
    ttt.....ttt
      tt@@@tt
ENDMAP

###############################################################################
# Some "beast lair" vaults, originally submitted as a serial vault.
NAME:   beast_lair_carwin_large_1
TAGS:   transparent luniq_beast_lair
ORIENT: float
: beast_lair_populate_mons_large(_G)
: beast_lair_randomise(_G)
MAP
                E.EEJ
      1     1  ..E.ME
...........1.xxx.ME.
 .Axxxxx..xxxx.xxxA..
..xxJ..xx.xx.B.FFxx1.E
 ..xxx.B........GGxx...
 .xxA.....FFxxG..Gxxx.
 .x...423...xGGG.GGGx.
..x.AxxxFFFxxG4223Axx.1
..xx..AFFFxx%LL4xxxx..
..Axx..MFxxxxxxxx.xxx.
 ..x..xxxxAxx......A..
 .A.............  .
      .            ..
ENDMAP

NAME:   beast_lair_carwin_large_2
TAGS:   transparent luniq_beast_lair
ORIENT: float
: beast_lair_populate_mons_large(_G)
: beast_lair_randomise(_G)
MAP
  ..1.. 1
   .x........
  ...xxxxxxx.
. ..xxxLxxJxx.
 ..Ax44....Ex.
 .Gxx%4xx..xx.
 GGGxLxxxE.xx.
 .GGxxxx...xx.
 .Gxxxx..EEx..A
..xx31xx..xx....
1.x32..x.xx..  A
 .xxx....xx1.
 ..xxxxEMExx..
 .............
ENDMAP

NAME:   beast_lair_carwin_large_3
TAGS:   transparent luniq_beast_lair
ORIENT: float
: beast_lair_populate_mons_large(_G)
: beast_lair_randomise(_G)
MAP
            ..
        .......
 .........Mxxx...
 x  xxx.xxxxxxxxx
 xxxxM...A......xx
 .xxA......xx..M.xx.
..x...xxAA..x22.Mx...
..xx.xxxxxx.xxx..xx..
 .xx.xx44LA...x.......
 .x..xx%4...x.xxxxx.
......xxxxLx......x..
..xx.MM.2xxx....xxxx.
   x...24x....xxx  ..
   xxxxxxx.xxxxxx x
    ................
   ...         .
ENDMAP

# This vault is kinda neat because if the Fs become walls (1/4th of the time)
# it's a maze-like warren, but if they become floors it's an open "village".
NAME:   beast_lair_carwin_large_4
TAGS:   transparent luniq_beast_lair
ORIENT: float
: beast_lair_populate_mons_large(_G)
: beast_lair_randomise(_G)
SUBST:  T:5 6:3
MAP
  .          .A1
.........  ........x    .
 ...xxxA.....xxxx.......x
 ...x3xxFFFAxx4x...xxxx..x.
 ..xx.xx..Fx...xFFxx24xA.....
...x3..........2xF....x...x
..FxxF11..FFxxx.x.....xxx.
.......Fx...LF....xx.xx  .
.x...xxx..x4Tx.F...F...D 1.
x.Mxxx...xxxxxxx.FFF.D.2WWW
xxxx....x.24xxxxxF...MWWWW
2....xx...Mxxxxx.D..3WWWWWWW
4..       .  Ax ..M1WWW W
ENDMAP

NAME: beast_lair_carwin_1
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
     ..
  1......
 ..xxxxx..
 .xxM3Axx1..
 .xAMJ4xFx.
.Axx.xxxFF.1
..1x..x...
 ..xx..x...
  .....
ENDMAP

NAME:   beast_lair_carwin_2
TAGS:   transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
ITEM:  gold
SUBST: ? : .
MAP
  ...
 ..2..
..3d2..
 ..2..
  ...
ENDMAP

NAME: beast_lair_carwin_3
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
  1
   ..
....B..
 .xxxx..
..x33xx.1
.xxM.Ax.
A.xx.xx.
 ..B...B
ENDMAP

NAME:   beast_lair_carwin_4
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
  ...  A
 ..x....
A.xxxFA..
..x32FFB.
..xxM1x...
.xx..x1.
....FxA
ENDMAP

NAME:   beast_lair_carwin_5
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
 .
 ...1...
..xxxx......
 ...3x.xBA.
 .x2xx.xxxB
 .xJ.2...
1.xxBxxxA
 ........A
ENDMAP

NAME:   beast_lair_carwin_6
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
  .........
   .Axxxx.1
 .....GGxx.
 ..xxxxGGx...
..1xxGG.Gxx.
 .xxD24Jxx..
 ..xx32xxA.
 .A.FFFFF..
  ......
ENDMAP

NAME: beast_lair_carwin_7
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
.x....
...x....
..1x.x....
 .xx.xx.x..
..xPPxxxxx..x .
Exx3PPx1Jx..x.
E.xxxxx....x.
 E.EEx42Pxxx..
 ..E.xxxxx.x...1
  ...........
     A
ENDMAP

NAME:   beast_lair_carwin_8
TAGS:   transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
. .. . ..   1   .......   1
 ..Axxxx.... .  xxxxxx....
..xxGGGxx.xxxxxxA.1.xxx.
..xGGGGG..M243.....F..x..
.xxxGGxxxxxxxxxxxx...xxx..
....G..1         FFA......
ENDMAP

NAME:   beast_lair_carwin_9
TAGS:   transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
 .   1    .
 ........  .
...xxxxx.....
 .AAxxxxxxxx.
 ..1xxxx4Lx....
..xxx.M44xx.
 x.....xxx..
...xxxxx... A
...xxxx..x.s
      .
ENDMAP

NAME: beast_lair_carwin_10
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
  AA
 .......
 .x..xx.xx
...x..xx.
 .Axx.4x.
 ..Jx3xx.
...xxxx1x
  .x43xx.1
 .xxx.Ax..
 .xxx.xx.1
1.........
ENDMAP

NAME: beast_lair_carwin_11
TAGS: transparent luniq_beast_lair
: beast_lair_populate_mons_small(_G)
: beast_lair_randomise(_G)
MAP
     .E
. .......xx
 ..xxxxx..E
..xx2x4xE..
.xx...2xx.
..B.xxxxxx..
 ...    .....E
ENDMAP

###############################################################################
# Remaining ungrouped decorative Lair vaults.

# "Pointless plantage" by Lemuel.
# Three separate decorative bubbles mixed into one vault.
NAME:   lemuel_fruit_fields
TAGS:   allow_dup extra transparent decor
DEPTH:  Lair
ORIENT: float
WEIGHT: 9
MONS:   plant, butterfly
ITEM:   gold
KFEAT:  ^~ = .
: local size = crawl.random2(9)
: if size > 7 then
SUBST:  '`"- = ^:20 ~:15 ., . = d:3 .:150 1:10 2:4
: elseif size > 3 then
SUBST:  "` = ^:20 ~:15 ., . = d:5 .:50 1:8 2:4
: else
SUBST:  '" = ^:20 ~:15 ., . = d:5 .:50 1:8 2:4
: end
CLEAR:  `'"-
COLOUR: ^ = green
FTILE:  ^ = floor_grass
COLOUR: ~ = brown
FTILE:  ~ = floor_dirt
MAP
       -------
     -----------
   -``------------
 -``````-----------
 ```````"'''-------
-`````"""'''''-``----
--```"""'''''""````--
----`"''''''"""`````-
-----'''''''"""`````-
-----'""'''''""````--
----``""""''''-``----
 --`````"""'--------
 --````````---------
   -``````--------
     -``--------
       -------
ENDMAP

# Two separate small decorative vaults mixed into one:
NAME:   lemuel_fruit_tree
TAGS:   extra transparent decor
DEPTH:  Lair, Snake
ORIENT: float
MONS:   plant, fungus
KITEM:  a : stone
: if crawl.one_chance_in(5) then
SUBST:  '"~ = . 1
SUBST:  0`-. = .:90 a:2 2:1
SUBST:  _ = .:90 a:4
: else
CLEAR:  '-_
SUBST:  `" = . a 2:1
SUBST:  ~. = .:90 a:2 2:1
SUBST:  0 = 1
: end
MAP
   ________
  _--------_
 _---..~..--_
_--'.......--_
_---..`"`.~--_
_---..`0`..--_
_---..`"`..--_
 _--~....~.-_
  _--.....-_
   ________
ENDMAP

####

# A trio of precisely-mirrored pools.
NAME:    nicolae_quartered_pool_little
TAGS:    transparent extra decor uniq_qpool
DEPTH:   Lair
SHUFFLE: Aa, Bb, Cc, Dd, Ee, Ff, Gg, Hh, Ii, Jj, Kk, Ll, Mm, Nn, Oo, Pp, Qq
SUBST:   abcdefghijklmnopq = ., ABCDEFGHIJKLMNOPQ = W
NSUBST:  7 = 1:@ / * = t@@@
MAP
    777777
   7qolLOQ7
  7pnkiIKNP7
 7pmjhfFHJMP7
7qnjgedDEGJNQ7
7okhecbBCEHKO7
7lifdbaABDFIL7
7LIFDBAabdfil7
7OKHECBbcehko7
7QNJGEDdegjnq7
 7PMJHFfhjmp7
  7PNKIiknp7
   7QOLloq7
    777777
ENDMAP

NAME:    nicolae_quartered_pool_medium
TAGS:    transparent extra decor uniq_qpool
DEPTH:   Lair
SHUFFLE: Aa, Bb, Cc, Dd, Ee, Ff, Gg, Hh, Ii, Jj, Kk, Ll, Mm
SHUFFLE: Nn, Oo, Pp, Qq, Rr, Ss, Tt, Uu
SUBST:   abcdefghijklmnopqrstu = ., ABCDEFGHIJKLMNOPQRSTU = W
NSUBST:  7 = 1:@ / * = t@@
MAP
      7777
    77spPS77
   7urolLORU7
  7tqnkiIKNQT7
 7uqmjhfFHJMQU7
 7rnjgedDEGJNR7
7sokhecbBCEHKOS7
7plifdbaABDFILP7
7PLIFDBAabdfilp7
7SOKHECBbcehkos7
 7RNJGEDdegjnr7
 7UQMJHFfhjmqu7
  7TQNKIiknqt7
   7UROLloru7
    77SPps77
      7777
ENDMAP

NAME:    nicolae_quartered_pool_super
TAGS:    transparent extra decor uniq_qpool
DEPTH:   Lair
SHUFFLE: Aa, Bb, Cc, Dd, Ee, Ff, Gg, Hh, Ii, Jj, Kk, Ll, Mm
SHUFFLE: Nn, Oo, Pp, Qq, Rr, Ss, Tt, Uu, Vv, Ww, Xx, Yy, Zz
SHUFFLE: 12, 34, 56
SUBST:   abcdefghijklmnopqrstuvwxyz135 = ., ABCDEFGHIJKLMNOPQRSTUVWXYZ246 = W
NSUBST:  7 = 1:@ / * = t@
MAP
      777777
    771xtTX277
   75zwspPSWZ67
  73yvrolLORVY47
 75yuqnkiIKNQUY67
 7zvqmjhfFHJMQVZ7
71wrnjgedDEGJNRW27
7xsokhecbBCEHKOSX7
7tplifdbaABDFILPT7
7TPLIFDBAabdfilpt7
7XSOKHECBbcehkosx7
72WRNJGEDdegjnrw17
 7ZVQMJHFfhjmqvz7
 76YUQNKIiknquy57
  74YVROLlorvy37
   76ZWSPpswz57
    772XTtx177
      777777
ENDMAP

NAME:    nicolae_quartered_pool_impasse
TAGS:    transparent extra decor no_pool_fixup uniq_qpool
DEPTH:   Lair
SHUFFLE: DN, EO, FP, HQ, JR, KS, LZ, M-
SUBST:   DEFHJKLM = w, NOPQRSZ- = l
MAP
  ......
 ..LHQZ..
..MKFPS-..
.LKJEORSZ.
.HFEDNOPQ.
.QPONDEFH.
.ZSROEJKL.
..-SPFKM..
 ..ZQHL..
  ......
ENDMAP

NAME:    nicolae_lair_grove_arrangements
TAGS:    transparent decor extra
DEPTH:   Lair
SHUFFLE: abcdefghi/''''T''''/T'''''''T/T'''T'''T/T'T'''T'T/T'T'T'T'T/\
         TTT'''TTT/'T'T'T'T'/T'T''''T'/'T'TTT'T'/'T'''''T'/TTTT'TTTT/\
         T'TTTTT'T/TT'TTT'TT/'''TTT'''/T'TT'TTTT/TT'T'T'TT/TT'''''TT/\
         TT''T''TT/TT''TT'T'/T''''T'T'
SUBST:   abcdefghiT = ttttt., ' = ., _ = ._
CLEAR:   _
MAP
__________________
_................_
_..aa...bb...cc.._
_.aaaa.bbbb.cccc._
_.aaaa.bbbb.cccc._
_..aa...bb...cc.._
_................_
_..dd...ee...ff.._
_.dddd.eeee.ffff._
_.dddd.eeee.ffff._
_..dd...ee...ff.._
_................_
_..gg...hh...ii.._
_.gggg.hhhh.iiii._
_.gggg.hhhh.iiii._
_..gg...hh...ii.._
_................_
__________________
ENDMAP

####

NAME:    bh_autumn_forest_stairs
TAGS:    extra luniq_staircase decor
DEPTH:   Lair
WEIGHT:  5
COLOUR:  t = lightred / red w:3
SHUFFLE: Aaq / Bbr / Ccs
SUBST:   q = @
SUBST:   A = ., bBcCdDrs = t
COLOUR:  t = lightred / red w:3 / green w:3 / lightgreen w:1
TILE:    t = dngn_tree_lightred / dngn_tree_red w:4 / dngn_tree_yellow w:4
COLOUR:  a = lightred / red / green / lightgreen
TILE:    a = dngn_tree_lightred / dngn_tree_red / dngn_tree_yellow / dngn_tree
SUBST:   a = t
MAP
  aaaa qqq aaaa
 caaaaaAAAaaaaab
cccaaaaAAAaaaabbb
ccc...........bbb
ccc...........bbb
 cc..xxxxxxx..bb
sCC..x.....x..BBr
sCC..x..{..x..BBr
sCC..x.....x..BBr
 cc..xV...Vx..bb
ccc..xx+++xx..bbb
ccc...........bbb
ccc...........bbb
ccctttttttttttbbb
 cctttttttttttbb
  ctttt    tttb
ENDMAP

# Not very randomized, but the unusual shape, wall-plant use,
# and location should be variable enough. Intentionally lacks
# the transparent tag, to minimize niches in walls behind plants.
NAME:    hangedman_lair_unloving_vines
TAGS:    extra decor
DEPTH:   Lair
KMONS:   P = plant
KMASK:   ` = no_monster_gen
SHUFFLE: xP'. / xP'. / .'xP
SUBST:   '` = .
MAP
           xPx
         xxPxPxx    ````..@
        xPP'.'PPx   ....'''
      xxP''.'.''Px...'''PPP
   xxxPP'```.``'Px.''PPPxxx
xxxPPP''.xP'``.```'PPxxx
PPP'''...xP''.'.''Pxx
'''....   xPP'.'PPx
@..````    xxPxPxx
             xPx
ENDMAP

NAME:    cheibrodos_lair_caveside_slide
TAGS:    extra decor
DEPTH:   Lair, !Lair:$
MONS:    fungus w:3 / nothing, plant w:3 / nothing
SUBST:   1 : 12, " = x.
MAP
    ...xx
  ....xxx
 xx..1Wxxx
 xxx.1Wxxx
 xxx".WWxxx
  xxx.1Wxxx
  xxx.1WWxxx
  xxx".1WWxx
 xxxx"".1Wxx
xxxx""".1Wxxx
xxx"""..1WWxx
xxW1....1WWxx
xxWW(111WWxxx
xxWWWWWWWxxx
xxxWWWWWxxx
 xxxxxxxxx
  xxxxxx
ENDMAP

# Someone hasn't taken care of their garden, but occasionally it takes care of itself.
NAME:    pdpol_lair_neglected_garden
TAGS:    extra decor transparent no_trap_gen
DEPTH:   Lair
SHUFFLE: ac"` / pbbp
SUBST:   ab = D, cp = P
: if crawl.one_chance_in(5) then
MONS:    plant, bush
SUBST:   V = T, D = 2, P = 1
FTILE:   ' = floor_dirt, 12`" = floor_grass
:else
MONS:    withered plant / plant w:1, fungus
SUBST:   P = 1, D = 122
:end
SUBST:   '`" = .
MAP
.....@.....
..`P"'"P`..
.`Pac'caP`.
.``c'''c``.
.`"''D''"`.
@`"'DVD'"`@
.`"''D''"`.
.``c'''c``.
.`Pac'caP`.
..`P"'"P`..
.....@.....
ENDMAP

###############################################################################
# Remaining non-grouped regular Lair vaults.

NAME:   beargit_carnivore_pack
ORIENT: float
DEPTH:  Lair:2-
KMONS:  1 = komodo dragon band
KMONS:  2 = skyshark band
KMONS:  3 = Grum, komodo dragon
KMONS:  4 = Snorg, skyshark
SUBST:  1 : 111122222234, 1 = 11., 2 = 2.
NSUBST: 3 = 3 / ., 4 = 4 / ., . = ..`
KPROP:  ` = bloody
{{
if crawl.coinflip() then
    dgn.delayed_decay(_G, 'a', "dire elephant skeleton")
else
    dgn.delayed_decay(_G, 'a', "dire elephant corpse")
end
}}
MAP
.....
..1..
.1a1.
.....
ENDMAP

# Rats! (Lemuel) [combined both Lair and D versions]
NAME:    lemuel_ratsnest
ORIENT:  northeast
DEPTH:   D:5-8, Lair:1-3
MONS:    rat, quokka, river rat, hell rat
ITEM:    gold / stone
SUBST:   d = d$$$........., e = d$$$
SHUFFLE: 234 / 324 / 243
: if you.in_branch("Lair") then
NSUBST:  4 = 1:4 / * = 40, 3 = 2:3 / * = 34.
NSUBST:  2 = 2:2 / * = 224., 1 = 2:1 / * = 13.
CLEAR:   "
: else
SUBST:   " = x
NSUBST:  1 = 2:1 / * = 1., 2 = 2:2 / * = 2., 3 = 2:3 / * = 3.
:   if you.absdepth() > 6 then
SUBST:   4 = 430
:   else
SUBST:   4 = 30
:   end
: end
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx.eexxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx343dxx.xxxxxxxx.334433xxxxxxxxx23..exx
xxd222...xxxxxxxx..224422xxxxxx1111...xxx
x..111..xxxxxxxxx..111111.xxx.111...xxxxx
xx.111..xxxxxxxxxx.11111..x......xxxxxxxx
xxxx..xx.x.xxxxxx.xx..........xxxxxxxxxxx
xxxxx.xxx.x..x.xx.x.xx....x.xxxxxxxxxxxxx
xxxxx...x.xxx.x33xx.xxxx.xxxxxxxxxxxxxxxx
xxxxxxx.x.xxxx221x.xxx...xxxxxxxxxxxxxxxx
xxxxxxxx.xxxxx111.xxxx.xxxxxxxxxxxxxxxxxx
"""""""xx..xxx.x.x.xxx.xxxxxxxxxxxxxxxxxx
"""""""xxx..x.xx.x.xx.xxxxxxxxxxxxxxxxxxx
"""""""xxxxx..xx..x.x.xxxxxxxxxxxxxxxxxxx
"""""""xxxxxxxx.xxxx.xxxxxxxxxxxxxxxxxxxx
"""""""""""""xx.xxxxxxxxxxxxxxxxxxxxxxxxx
"""""""""""""xxx.xxx"""""""""""""""""""xx
"""""""""""""xx.x.xx"""""""""""""""""""xx
"""""""""""""xxx.x.x"""""""""""""""""""xx
"""""""""""""xxxx.xx"""""""""""""""""""xx
"""""""""""""xxxx@xx"""""""""""""""""""xx
ENDMAP

# A comfortable, reclusive cottage for the summer holidays (Eino)
NAME:    pond_and_an_island_with_a_cottage
ORIENT:  float
DEPTH:   Lair:3-, !Lair:$
MONS:    necromancer, elephant zombie
MONS:    basilisk zombie / komodo dragon zombie
SHUFFLE: 23
NSUBST:  2 = 1:2 / * = 2., 3 = 1:3 / * = 3.
SUBST:   % = %%%%%$$$**|
MAP
             wwwwwwwww
        wwwwwwwwwwwwwwwww
     wwwwwwwwwwwwwwwwwwwwww
    wwwww..........wwwwwwwww
  wwwwww.xxxxxxxxxx.wwwwwwwww
 wwwwwww.x.3.2+.1.x..wwwwwwww
 wwwwwww.x+xxxx2.3x..wwwwwwwww
wwwwwwww.x.%%%x.32x..wwwwwwwww
wwwwwwww.xxxxxxx+xx..wwwwwwwww
wwwwwwwww...........wwwwwwwwww
 wwwwwwwww....WW....wwwwwwwww
  wwwwwwwwww..WWW..wwwwwwwww
  wwwwwwwwwww..W..wwwwwwww
   wwwwwwwwwww...wwwwwww
    wwwwwwwwwww..wwwww
     wwwwwwwww...www
       wwwwww.@.www
         www
ENDMAP

# Ice dragon lair with assorted imp pets
NAME:   bobbens_ice_dragon_lair
TAGS:   no_monster_gen
DEPTH:  Lair:4-
MONS:   ice dragon
MONS:   white imp
SUBST:  $ = $:3 *:2, _ = %:1 `:3
SUBST:  3 = 2:9 .:1
SUBST:  ' = w:15 x:12 `:1, ; = x:2 .:3, G = G:1 .:3
KPROP:  %` = no_tele_into
MAP
;;..;..;;;.;;.;;;
;;...wwww.;;..ww.;;
;..ww'''ww..wwwww;;;;
;.ww'xxxwwwwwwwww;....
;.ww'x$xx''''''w...ww.
;..wwx$$xxxxxx'w..www.
;;..wx$1x..>xx'wGwww.;
;;;.wx$$.3x2.x'wwww.;
;;;wwxxw3.xW.''www.;;
;..www'xxxxxxw'wwww.;;
..wwww''xxxxwww''ww.;;
.wwwwwww...www'_'ww.;
..wwwww....www'''w.;;
.;www...V..wwwwww.;;
;............www.;;;
;;   ;;;....w..;
ENDMAP

# Dragon lair embedded in wall
NAME:   bobbens_dragon_lair_wall
TAGS:   no_monster_gen
DEPTH:  Lair:2-
MONS:   steam dragon, acid dragon, rime drake, lindwurm, fire dragon
ITEM:   any good_item
: if you.absdepth() > 13 then
SUBST:  A = 4:1 5:9, B = 3 4:2 .:4
: else
SUBST:  A = 12, B = 3:2 .:3
: end
SUBST:  d = $:3 d:2
SUBST:  ' = l:15 x:9 c:3
SUBST:  z = x:3 c:1
SUBST:  ; = x:3 c:1 .:4
SUBST:  y = l 1:3 .:1
SUBST:  % = %:1 .:3
MAP
xxxxxzzzzzzzzzxxxxx
xxxzzzzz..yyzzzxxxx
xxzzz'...yzydzzzzxx
xzzz;.B.yzzzddzzzxx
xzz;.A..yzzzddzzzxx
xzz;...y'zzzzd>zzxx
xzz;'...y'zzzzzzzxx
xzzz;y..zzzzzzzxxxx
xzzzzzz;.zzzzzxxxxx
xxzzzzz.;zzzzzxxxxx
xxzzzz.yzzzzzzxxlxx
xxzzzz.;%zzzzxxxlxx
xxz.y'.Byllzzzxzxlx
xzyy..y.yyyyxzzxlyx
..%....yy..yyzxyy..
..y.y...G.y..yy....
.y.........y.......
ENDMAP

# Drake nest (minmay)
NAME:   minmay_lair_drake_nest
TAGS:   transparent
DEPTH:  Lair:4-
MONS:   rime drake, plant w:20 / fungus w:1 / bush w:1
NSUBST: 1 = 2:1 / * = 1.., ' = 4:2 / * = ., . = 1:2 / 1:% / * = ..%2
MAP
   .'.
  '...'
 '.....'
...111...
'..111..'
...111...
 '.....'
  '...'
   .'.
ENDMAP

# Venomous thicket (minmay)
NAME:   minmay_lair_venomous_thicket
TAGS:   ruin_lair
DEPTH:  Lair
ORIENT: north
MONS:   black mamba / cane toad / wolf spider
MONS:   basilisk / komodo dragon / hornet
MONS:   adder
KMONS:  P = plant / fungus w:3
KMONS:  B = bush
SUBST:  4 = PPP. B:2, . = ...P B:2
SUBST:  1 = 1., 2 = 2., 3 = 3.
MAP
xxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxx
xxxxxxxPPPPxxxxxxx
xxxxxPPP1%%3Pxxxxx
xxxxPPP%3.1.PPxxxx
xxxxP.31.3.3.Pxxxx
xxxP.2.3PPP.1PPxxx
xxx.3.PPPPPP32Pxxx
xxx2..PPPPPPP.Pxxx
xxxP3.PPPPPPP3Pxxx
xxxPP2.PPPPPP.Pxxx
xxPPP..3PPPP3..Pxx
xxPP..........3.xx
..3..3....3.......
ENDMAP

# Hibernating monster in a tunnel, can be pretty dangerous
NAME:   hibernation_bobbens
DEPTH:  Lair
TAGS:   no_monster_gen no_item_gen
MONS:   ice dragon / fire dragon / swamp dragon / anaconda w:5
MONS:   swamp dragon / hydra / catoblepas
MONS:   swamp drake / w:20 cane toad / w:20 komodo dragon /\
        w:20 basilisk / w:20 black mamba
KMONS:  P = plant
: if you.absdepth() > 14 then
SUBST:  M = 1:1 2:9 3:20
: else
SUBST:  M = 2:1 3:4
: end
SUBST:  ; = x:3 .:1
MAP
xxxxxxxxxx
xxx....xxx
xx$....%xx
xxPPxx%Mxx
xxx..xxxxx
xxx;.;xxxx
xxx;..xxxx
xxxx..;xxx
xxx....xxx
ENDMAP

# Catoblepas lookout (blackcustard)
NAME: lookout_lair_type
TAGS: extra no_pool_fixup transparent
DEPTH: Lair:4-
MONS: w:1 generate_awake patrolling catoblepas / w:4 nothing
SUBST: a = w W .
SUBST: ' = W .
MAP
  a'a aa
 a'wwwWa
 a'w1.wa
a'aw..ww
 a'w...Wa
  'wwwww@
  a''a''
     'a
ENDMAP

# Two stream minivaults, combined.
NAME:   guppyfry_lair_drakes
DEPTH:  Lair
: if you.depth() > 3 and crawl.coinflip() then
MONS:   rime drake / swamp drake / acid dragon
MONS:   steam dragon
MONS:   plant
SUBST:  -_ = wwWW..%
SHUFFLE: .t
: else
SUBST:  12 = 0, _ = wW.%, 3- = .
: end
MAP
.3WW-3.....
.ttWW-ttt..
.3ttW-tt.t.
.ttWWtt...t
tt1Wttt2.tt
.ttWW-t3.t.
..ttWW_-1t.
.tt1_WWttt.
..tt-_Wtt3.
.tt3.tWWttW
.ttt.ttWWW-
....3.3-W-.
ENDMAP

NAME:   kennysheep_rathole
TAGS:   no_monster_gen
DEPTH:  Lair
MONS:   river rat band, hell rat, river rat / rat
KMONS:  P = plant / fungus w:2
NSUBST: ' = 1:1 / 2:P / 2:2 / 2:3
MAP
 xxxx
 xxxxxx
xxd.'xxxx
xx..'''xx
xx'''.''xx
xxx'''''xx
  x'x'.''x
  xxx'...x
     @  @
ENDMAP

# Contains gold and one ok item to make the hell rats a little more worth it.
NAME:   kennysheep_abandoned_house
TAGS:   ruin transparent
DEPTH:  Lair
MONS:   rat, river rat, hell rat
KITEM:  d = gold
NSUBST: d = 1:d / 1:* / 1:9 / 1:3 / * = d11223.......
MAP
      .......
.......ccccc.........
.ccccccccccccccccccc.
.cccccccdddccccccccc.
.ccdddccdddcc..dddcc.
.ccdddccdddcc..dddcc.
.cc...cc...+...dddcc.
.cccc.cccc.ccccccccc.
.cccc+cccc+ccccccccc.
.cc.....+...+...ddcc.
.ccddddcc...cc..ddcc.
.ccddddcc...cc..ddcc.
.cccccccc+++cccccccc.
.ccccccc.....ccccccc.
.....................
ENDMAP

# A sealed arena. The walls are usually thick enough
# to make this only accessible from the floor below.
NAME:   kennysheep_catoblepas_arena
TAGS:   no_monster_gen ruin no_descent
DEPTH:  Lair:3-, !Lair:$
MONS:   catoblepas
NSUBST: d = 4=%* / 3:0 / *:.
MAP
xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx
xxxxxxxdd1ddxxxxxxx
xxxxxcdddddddcxxxxx
xxxxxdcccccccdxxxxx
xxxddcdddcdddcddxxx
xxxddcdddcdddcddxxx
xxxccdcccdcccdccxxx
xxx..c...c...c..xxx
xxx..c...c...c..xxx
xxxxx.ccc.ccc.xxxxx
xxxxxc.......cxxxxx
xxxxxxx..}..xxxxxxx
xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   kennysheep_basilisk_garden
TAGS:   transparent
DEPTH:  Lair:3-
MONS:   basilisk
NSUBST: . = 2:1 / 3 = 111G / *:.
MAP
   .....
 ....G....
 .G.....G.
.....G.....
...........
.G.G.*.G.G.
...........
.....G.....
 .G.....G.
 ....G....
   .....
ENDMAP

NAME:   kennysheep_snail_temple
DEPTH:  Lair
MONS:   torpor snail
KFEAT:  a = altar_cheibriados
NSUBST: 1 = 1:1 / * = 1.
MAP
 @
x.x   xxxxxxxxx
x.x  xx...1....@
x.x xx.xxxxxxxx
x.x x.xxbbbbbbxxxx
x.xxx.xbbWWWWW...xx
x.xx.xbbWbbbbbbxx.xxx
x...1.WWW1a1WWW..1...@
xxx.xxbbbbbbWbbx.xxxx
  xx...WWWWWbbx.xx
   xxxxxbbbbbxx.x
   xxxxxxxxxxx.xx
  @.......1...xx
   xxxxxxxxxxxx
ENDMAP

# A den of bears.
NAME:   gammafunk_lair_bear_cave
TAGS:   patrolling no_monster_gen
DEPTH:  Lair
MONS:   black bear / polar bear
KFEAT:  " = W
KMONS:  " = electric eel w:40 / nothing
KITEM:  % = gold / stone
SUBST:  % = %., * = *:40 |, B = 1., E = tE
CLEAR:  E
MAP
EEEEEEEEEEEEEEEEEEEEEEEEE
EtttttxxtttxxxxxxttxxtttE
EttxxxxxxxxxxxxxxxxxxxxxE
Etxxxxxxxxxxx..xxxxxxxxtE
Etxxxxx"Wxx......x.xxxttE
Exxx%...1.....x....xxxxtE
Exxx%B.1...xxxxx.....xxtE
Exxxx%%%*xxxxxxxxxxx..xtE
Etxxx*xxxxxxxtxxxxxxx...@
Etxxxxxxxxxxtttttttxxx..@
EttxxxxxttttttttttttttttE
EEEEEEEEEEEEEEEEEEEEEEEEE
ENDMAP

# A hidden river runs under a mountain, feeding into an enchanted lake.
NAME:   gammafunk_lair_enchanted_lake
TAGS:   no_pool_fixup
DEPTH:  Lair
ORIENT: north
KMONS:  pq = plant / fungus / toadstool
KMONS:  1 = electric eel / rime drake / elephant / wyvern
KMONS:  2 = lindwurm / dire elephant / catoblepas
KITEM:  2 = * / |
KFEAT:  q = W
KFEAT:  1 = w
KFEAT:  T = t
SUBST:  p = p., q = qW, r = tx, E = tE, * = *|, i : GT, j = GTx-
NSUBST: . = 2=9 / 3=0 / ., 1 = 3=1 / 1ww
KMASK:  Ww = no_monster_gen
CLEAR:  E
COLOUR: -|*2 = brown
FTILE:  =-|*2GT = floor_pebble_brown
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxx
ttccccccccccccccccccccccctt
Etci-WWWWW1jxxwWW1xxjww1ctE
Etc*2-WWxWWxxwWWwWWxxwwwctE
Etc*2-wxxWWxWWWjjwwWWwWWctE
Etci-wwjxxWWW1xxxx1wWWWwctE
EtccnncccccnncccccccccWqxtE
Etxxx.xxxxxx.xxxxxxxxxx=xtE
Ettttx.trrrtt.ttrrrrttWWttE
Etttt.ttWWwWWttWtwwwqWWwttE
Ettt...qWwWwWwWwWwwwWwwwttE
Ettp..WWwwwqqWwqqWWWqqqtttE
Ettp..WqwwwttqqtttqqtttttE
Ettp..WqwwwttttttttttttttE
Ettp...WwwwwWqqqttttttttE
Ett.....Wwwwwqq..pttttttE
Etttp....qWwwwWq..ppttttE
Etttp......WwwWW...ptttttE
Etttp.....WWwwWW....pptttE
Ettttp...WWWwwwWW....ptttE
Ettttp...WWwwwwWW.....pttE
Ettttt...WWwwwwWW....ptttE
 Ettttp...WWwwWWW...pptttE
  Ettttp..WWWWWW...pttttE
  Etttttp..WWWW....pttttE
   Ettttp.........ptttEE
    Etttt........tttttE
     EEEE..@@@@..EEEEE
ENDMAP

NAME:   nicolae_lair_yak_garden
TAGS:   no_monster_gen no_item_gen no_trap_gen transparent
DEPTH:  Lair:4-
KMONS:  Y = yak
KMONS:  D = death yak
KMONS:  C = catoblepas
KMONS:  P = plant
KITEM:  f = stone
SUBST:  P = P., f = f...
NSUBST: D = 1:D / *:.
MAP
        .@@@.
      .........
    tt...P.P....tt
   tttttPPPPPPPtttt.
  .ttDfPP.Y....tDtt...
 .PPttP..P.P.PP.ftP...
 .P....PPP...PPP.PP..@
..PP..PPPwwwC.P..PPP.@
......Y.wwwwww.Y.ttP.@
.@.PP..Pwwwwww...fttt.
 @..P..PP.wwwPP.ttttt
  @.PP.PPP..PP..PPttt
  ...Ptt.P.PPPPPP....
  ...ttfDttPP.......
    .tttttt......@
     ..tt.......
        .....
ENDMAP

# Snail & Pal
NAME:   pf_torpor_hydra
TAGS:   no_monster_gen no_item_gen
DEPTH:  Lair:3-, !Lair:$
MONS:   torpor snail, hydra
# A decent item visible from the door, a superb item not visible,
# and a couple of floor items anywhere
NSUBST: . = * / ., - = | / ., . = 2=% / .
MAP
x xx  x
 xxxxxx x
xx.2..xxx
x--x1..=xx
x------x@x
xx--x-xx
 xxxxxx
   x  x
ENDMAP

NAME:    hangedman_lair_generics_rect
TAGS:    no_monster_gen
DEPTH:   Lair
MONS:    plant / fungus w:6
NSUBST:  ' = 2:c / 2:. / * = c+....
SHUFFLE: yY / yY / Yy
SUBST:   y = ., Yz = xxxx1., Z = xx`
CLEAR:   `
MAP
.............xZZ
.c'c'c'c'c'cxxxZZ
.'...........zxxZ
.c..0.....0..zxxx
.'...Wxxxx...xx%x
.c...xxxxx...x9.x
.'...xxxxW..xx.9x
.c..0......Y.x..x
.x........x.y.xxx
xxzzzzzzxxxx..%xx
Zxxxxxxxx9..x%0xx
ZZxxxxxx%.9.xxxzx
 ZZZZZxxxxxxxxxxx
ENDMAP

NAME:    cheibrodos_lair_reptile_den
TAGS:    no_item_gen no_monster_gen transparent
DEPTH:   Lair, !Lair:$
MONS:    adder / water moccasin, komodo dragon / black mamba
KMONS:   P = plant / fungus w:5
SHUFFLE: "', ABC
SUBST:   A = ., BC = x, D = x .:2
NSUBST:  " = 7:1 / *:., ' = 2:2 / *:.
NSUBST:  - = 6:P / *:., ; = 5:P / *:.
MAP
  ...........
 ..DDDDCDDDD..
..DxxxxCxxxxD..
.Dxxx"""""xxxD.
.Dxx";;;;;"xAD.
.Ax";;;;;;;"xA.
.DA";;---;;"xD.
.Dx";;-(-;;"xD.
.Dx";;---;;"xD.
.Dx";;;;;;;"xD.
.Dxx";;;;;"BBD.
.Dxxx"""""BBBB.
..DxxxAxxxBBB..
 ..DDADDDDDB..
  ...........
ENDMAP

NAME:    minmay_guarded_unrand_snakebite
TAGS:    ruin
DEPTH:   Lair
ORIENT:  southeast
ITEM:    snakebite no_pickup
KMONS:   A = adder
KMONS:   B = water moccasin
KMONS:   C = black mamba
SUBST:   1 = A B:2 .:48, 2 = A B:5 .:60, 3 = A B C:2 .:88, 4 = A:2 B C:4 .:64
SUBST:   5 = A:1 B C .:84, 6 = B:5 C .:60, 7 = B.
MAP
xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxx222xxxx
@11xxxxxx222xxx3xxx
xxx1xx112xxxxxxx3xx
xxxx11xxxxxxxxxx3xx
xxxxxxxxxxxxxxxx3xx
xxxxxxxxxx44xxx3xxx
xxxxxxx444xx433xxxx
xxxx554xxxxxxxxxxxx
xxx5xxxxxxxxxxxxxxx
xx5xxxxxxxxxxxxxxxx
xx5xxxxxxxxxx77xxxx
xxx5xxxxxxxx7xx7dxx
xxxx56xxx666xxxxxxx
xxxxxx666xxxxxxxxxx
xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   cheibrodos_lair_lostbears
TAGS:   no_monster_gen transparent
DEPTH:  Lair
MONS:   polar bear
KMONS:  p = plant
SUBST:  v = vvvvvpp..
NSUBST: - = 2:1 / 3=1., . = 4:p / 2=p.
MAP
       ....
      ..vv.
   ....vvv..
 ...vvvvvv..
..vvvvvvvvv..
.vvvv-.--vvv.
@...-.-.-...@
@....---.-..@
 ..vvvvvvvv..
  ..vvvvvv..
   ........
ENDMAP

NAME: cheibrodos_lair_overgrown_chateau
TAGS: no_item_gen no_monster_gen
DEPTH: Lair:2-, !Lair:$
ORIENT: float
MONS: water moccasin / black bear, hornet, yak, bullfrog / cane toad
MONS: black mamba / komodo dragon / w:3 rime drake, hydra / lindwurm
KMONS: PA = plant
KFEAT: A = W
SUBST: - = AAW, " = ccct, * = *%%.
NSUBST: ; = 1=1 / 1=1. / 1=5..
NSUBST: ' = 3:P / 4=P. / 1:t / 4=t. / 2=1234 / 2=1234.... / 1:5
NSUBST: p = 3=1234 / 1=5.., q = 2=1234, _ = 1=134.. / 1:3 / 1:4
MAP
  cccccccccccttcccccccc
  c6...+.ppptttt.cPtttc
  c...."Ppppptt.....Ptc
  c*..t"Ppppppp.P...ttc
  c**tt"tppppppPPc..ttt
  cccc"cc++cm''PPcP..tt
.cc.(.P"''.'''''Pct.Ptt
.cG...."-''.'''''ctP.tc
.cP...-"W-''.''''ctt.tc
@+...-W"WW''.''''ttt.Pc
@+...WWmWW''V''''ttt.Pc
@+..q-W"WW''.''''ct...c
.c.qqq-"W-''.'''-cP...c
.ctqqqq"-'''.''-WcW...c
.cctqqt"'''''.'WWcWW..c
  cc++"""""tt__WccWW6.c
  c...."PP_____WWcWW..c
  c;;..+._____WWWcW..Pc
  cP;;.+.___-WWWWc**Ptc
  ctP;;cttt-WWWWGcG|ttc
  ccccccttccccccccccccc
ENDMAP

NAME: cheibrodos_lair_river_kwai
TAGS: no_item_gen no_monster_gen
DEPTH: Lair
ORIENT: northeast
KMONS: P = plant
MONS: bullfrog / cane toad, water moccasin / black mamba, hydra
FTILE: _ = floor_dirt
SUBST: P = ..P, - = .:1 x
NSUBST: " = 1:3 / 4:P / 3=P. / 2:. / 2=.W / *:W
NSUBST: ; = 3=12 / 2=12.. / 2:. / 2=.W / *:W
NSUBST: ` = 1:1 . 1:2 / 1=12.., ' = 1=|* / 1=*% / *:%
MAP
xxxxxxxxxxxxxxxxxxxxxxxx
xwwwwxxxxxxxxxxxxxxxxxxx
PwwwwPPP;-;;+;;+."""""xx
PwwwwwPP;-;;-;;x".""""xx
PwwwwwwP;-+---;x".""""xx
@PwwwwwPP;;;-;;x""."""xx
.PwwwwwwP``;-;;x""".."xx
..Pwwwwww``;---xxxxxx.xx
..Pwwwwwww.P;;;;PPPx''xx
 ..Pwwwwww_wwwPPPPPx''xx
 @..Pwwwww_wwwwwwwwxxxxx
  ...Pwwww_wwwwwwwwwwwwx
   ...Pwww_wwwwwwwwwwwwx
    ...---`---wwwwwwwwwx
    ...-WW`WW-wwwwwwwwwx
    @..-````W-PPPwwwwwwx
     ..-````P-```PPPPPxx
     ..---+---........xx
      ....@.....@....@xx
                      xx
ENDMAP

NAME:     nicolae_lair_grazing_beasts
TAGS:     no_pool_fixup patrolling transparent
DEPTH:    Lair
KITEM:    H = % / * w:5
KMONS:    13 = plant
KMONS:    2 = bush
KMONS:    H = plant / nothing w:25
KMONS:    L = yak band w:25 / elephant band w:25 / death yak band / \
              catoblepas / dire elephant w:5 / dream sheep band w:5
KFEAT:    12 = W / .
SUBVAULT: Q : nico_grazesub
SUBVAULT: R : nico_grazesub
SUBVAULT: S : nico_grazesub
SUBVAULT: Z : nico_grazesub
NSUBST:   D = 2=W / wW / w, ' = 1=L
SUBST:    H = H ':15, ' = L:5 .:250 3:100, J = .:20 W:20 1:20 2w, w = wt
MAP
     .......
    ..J...J..
   ..QDDDDDR..
  ..QwQ'''RwR..
 ..QwQ'''''RwR..
..QwQ'''''''RwR..
.JwQ'''''''''RwJ.
.JwJ'''HHH'''JwJ.
.JwJ'''HHH'''JwJ.
.JwJ'''HHH'''JwJ.
.JwZ'''''''''SwJ.
..ZwZ'''''''SwS..
 ..ZwZ'''''SwS..
  ..ZwZJJJSwS..
   ..ZwwwwwS..
    ..JJJJJ..
     .......
ENDMAP

NAME:   nicolae_sub_lair_graze_edge
TAGS:   allow_dup nico_grazesub no_pool_fixup unrand
KMONS:  1 = plant
KMONS:  2 = bush
KFEAT:  12 = W / .
NSUBST: D = w / J, E = w / J, F = w / J, H = w / J
SUBST:  J = .:20 W:20 1:20 2w, w = wt
MAP
 D
D E
 E F
  F H
   H
ENDMAP

NAME:  nicolae_lair_lakeside_cave
TAGS:  no_pool_fixup transparent
DEPTH: Lair
KITEM: DEF = % w:40 / * w:16 / | w:4 / nothing w:20
KMONS: 1D = alligator / anaconda / manticore / fire crab / polar bear / \
            torpor snail / komodo dragon / dire elephant
KMONS: 2E = hornet / hell rat / wyvern / cane toad / death yak / elephant / \
            steam dragon / rime drake / hydra
KMONS: 3F = basilisk / scorpion / wolf / black mamba / water moccasin / \
            black bear / yak / bullfrog
SUBST: K = xxw..., M = wW, N = WWwx, - = x_, H = D E:20 F:40, \
       p = 2:5 3:80 .:400, q = 1 3 2:80 .:360
CLEAR: _
MAP
                 @..Mw--
 -----------     ...Mww--
--xxxxxxxxxxx    ...Mwww--
-xxxKKKKKKKKxx    ...Mwwx-
-xxKKqqq.ppKKxx    ...Mwx-
-xKKqqqMMpppKxxxxxxxppMwx-
-xKqqqMMMMppppppxxppppMwx-
-xKqqMwwwwMMMppppppppMwwx-
-xKqMMwwwwwwwMMMppMMMwwwx-
-xKqMMwwwwwwwwwwMMwwwwwxx-
-xKqqMwwwwMxxxwwwwwwxxxx--
-xKqqqMMMM.+.xxxxxxxxxxx-
-xKKqqqMM.1x..HHHDxxxxx--
-xxKKqqq.1.xN.HHHDxxxx--
--xxKKKKKKxxNNNNxxxx---
 --xxxxxxxxxxxxxxx---
  -----------------
ENDMAP

NAME:   nicolae_lair_lil_pond
TAGS:   transparent ruin decor extra
DEPTH:  Lair
NSUBST: D = . / x
SUBST:  - = . / W
MAP
............
....xxxx....
..DDDxxxxx..
..x------x..
.xx-wwww-xx.
.xx-wwww-xx.
.xx-wwww-xx.
.xx-wwww-xx.
..x------x..
..xxxxxxxx..
....xxxx....
............
ENDMAP

NAME:  nicolae_lair_lindhole
TAGS:  transparent
DEPTH: Lair
KMONS: 1 = lindwurm
SUBST: K = LLLL., L = lx, ~ = 1.., - = x_, % = %%%$*.
CLEAR: _
MAP
-----------
-KKKKKKKKKK
-K....~...@
-K.~.......
-L..LLLLLLL-
-L..Lxxxxxx-
-L..LLLLLLx-
-L.~...%%Lx-
-L....1%%Lx-
-LLLLLLLLLx-
-xxxxxxxxxx-
------------
ENDMAP

NAME:  nicolae_lair_liquid_snakes
TAGS:  no_pool_fixup transparent
DEPTH: Lair
KMONS: 1 = lava snake
KMONS: 2 = electric eel
KFEAT: 1 = l
KFEAT: 2 = w
SUBST: L = ..D, M = ..E, - = xx_, D = 1 l:240, E = 2 w:240
CLEAR: _
MAP
        -----------
       --xxxxxxxxx--
--------xxDDD1DDDxx-
xxxxxxxxxDDLLLLLDDxx
xDDDDxxxDDLL...LLDDx
x.LLDDxDDLL.....LL.x
@..LLD1DLL.MMMMM...@
@...LLLLL.MME2EMM..@
x.MM.....MMEExEEMM.x
xEEMM...MMEExxxEEEEx
xxEEMMMMMEExxxxxxxxx
-xxEEE2EEExx--------
--xxxxxxxxx--
 -----------
ENDMAP

NAME:   nicolae_lair_run_with_the_wolves
TAGS:   ruin transparent
DEPTH:  Lair
KMONS:  1 = wolf spider
KMONS:  2 = wolf band
NSUBST: D = 1 / 12 / 2
MAP
         xxxxx
      xxxxxxxxxxx
   xxxxxxx...xxxxxxx
xxxxxxxx.......xxxxxxxx
...........D...........
@..........D..........@
...........D...........
xxxxxxxx.......xxxxxxxx
   xxxxxxx...xxxxxxx
      xxxxxxxxxxx
         xxxxx
ENDMAP

NAME:   nicolae_lair_time_for_slime
TAGS:   transparent patrolling
DEPTH:  Lair:4-
KMONS:  1 = slime creature
KMONS:  2 = azure jelly / quicksilver ooze
KMONS:  3 = jelly
# Places 2-6 slime creatures, 1 azure jelly or quicksilver ooze, and
# 3-5 jellies.
NSUBST: p = 1 / 3 / s, q = 1 / 3 / s, s = 4=1.. / 1=2 / 2=3. / .
SUBST:  ' = `:40 %, ` = x..., - = x__
CLEAR: _
MAP
  -------x.@.x-------
 --xxxxxxx`.`xxxxxxx--
--xx'''xxx`.`xxx'''xx--
-xx'.p.'x`...`x'.q.'xx-
-x'.ppp```...```qqs.'x-
-x'ppppp...3...qqqqq'x-
-x'.ppp`````````qqq.'x-
-xx'.p.'xxxxxxx'.q.'xx-
--xx'''xxxxxxxxx'''xx-
 --xxxxxxxxxxxxxxxxx--
  -------------------
ENDMAP

# Dead by dawn!
NAME:    pdpol_lair_cabin_in_the_woods
TAGS:    no_item_gen no_monster_gen
DEPTH:   Lair
# The last survivor
KMONS:   1 = human ; war axe ego:heavy good_item \
                       | war axe ego:flaming good_item \
                   . leather armour good_item | ring mail good_item \
                       | scale mail good_item
# Trying to get some good horror move trope representation
KMONS:   2 = Rupert / reaper / vampire mage / phantasmal warrior \
                 / tentacled starspawn \
             , reaper / vampire mage / phantasmal warrior / tentacled starspawn
NSUBST:  a = a / c, p = p / c, q = q / c
NSUBST:  r = r / c, s = s / c, u = u / c
# These are distinct to preserve 'a' for the rune door.
SHUFFLE: Er / ?u, Daqp / ?sur
NSUBST:  D = 2 / | / S / `, E = 1 / *%% / S / `
NSUBST:  T = 2=009 / * = .ttt
NSUBST:  aq = 1:= / c, p = +
SHUFFLE: rsu
NSUBST:  r = + / c, s = + / c
SUBST:   u = c, " = `.., `? = `..., _ = t_
KPROP:   ` = bloody
MARKER:  F = lua:fog_machine { cloud_type = "thin mist", pow_min = 1, \
         pow_max = 3, delay = 10, start_clouds = 1, size_min = 2, \
         size_max = 3, spread_rate = 33 }
: dgn.delayed_decay(_G, 'S', "human skeleton")
CLEAR:   _
MAP
   _____________________
   @ttttttttttttttttttttt_
 @..ttttTttttttttttttttttt_
 tTt.tt..ccccccccccccccctt_
ttt.tTt..cDDDDDq``rEEEEctt_
ttTt.TtF.cDDDDDq``rEEEEctt_
ttt.ttt..caaaaac``rEEEEctt_
ttTt..t."n`````p``cssssctt_
tTt..T'T"+`````p``u????ctt_
tt.ttt.F"n`````p``u????ctt_
ttT.tt...c`````p``u????ctt_
 tTt.tt..ccccccccccccccctt_
 @..ttttTttttttttttttttttt_
   @ttttttttttttttttttttt_
   ________________________
ENDMAP

NAME:   pdpol_lair_cavern_descent
TAGS:   no_pool_fixup
DEPTH:  Lair
KITEM:  * = *
KMONS:  1 = water moccasin / black bear / wolf / wyvern
KMONS:  2 = electric eel
KMONS:  3 = cane toad / black mamba / komodo dragon / polar bear
KMONS:  4 = hydra / boulder beetle / hornet / rime drake
KMONS:  5 = basilisk / torpor snail w:5 / manticore w:2
KFEAT:  5* = W
KFEAT:  2 = w
SUBST:  u = wW
NSUBST: ' = 2:1 / 2=1. / 3 / 2=3. / 4 / 4. / .
NSUBST: W = 5 / 2=5W / W
NSUBST: w = 2 / 2=2ww / w
MAP
   xxxxxxxxx
  xx'''x'''xx
 xx''x'''x''xx
 x''xxw'wxx''x
xx'xxwwwwwx''x
x''xwwuwuw'''x
xx'xwwuWWwxx'x
 x'''wwuWWx''x
xx..wwwuWW%%xx
x..xxwwW**Wxx
xx..xxxW**xx
 x....xxxxx
 xxxx@@x
ENDMAP

###############################################################################
# Lair endings - split in two types.
###############################################################################

###############################################################################
# Small Lair endings.
# If it's possible, the placement of one of these Lair ends vaults means
# the placement of a second small Lair end vault. Currently, there are five.
###############################################################################

# At some point long ago, this vault used to be about worms and slugs.
# As standards changed, it is now left with snails and wyrms. Oh well.
NAME:    wormcave
TAGS:    no_wall_fixup no_monster_gen no_rotate
PLACE:   Lair:$
ORIENT:  southeast
MONS:    torpor snail, tyrant leech, lindwurm, hornet
MONS:    patrolling fire dragon / patrolling ice dragon
KMONS:   p = plant
ITEM:    serpent talisman / serpent talisman randart w:2
SHUFFLE: ABC, GU, HhIi5 / JjKk6
NSUBST:  1 = 1:1 / *:., 4 = 3:4 / *:.
NSUBST:  A = 3:4 / 1:23 / * = ....4
NSUBST:  B = 2:2 / 1:1 / * = ....4
NSUBST:  C = 1:1 / 1:2 / 1:3 / *:., $ = 1:$$$$d / 1:R / *:$
SUBST:   Hi = -, h6 = $, I = p, JjK = x, k = c
SUBST:   0 = 1, P = pp-, X = x., z = x'
CLEAR:   '
NSUBST:  " = 1:x / *:p
KMASK:   -$d5 = no_trap_gen
: lair_small_ending(_G)
MAP
               zxxzzxxxzzxxxxxzzxx
             zzxxxxxxxxxxxxxxxxxxxx
           zzxxxxxxxxxxxxxXAxJJxxxxx
          zxxxxXXBBXxxxxxA*..xxJxxxxx
@.......@xxxxxP4B.1BXxxxXAA.%XxxJJJjxx
..PP.XX.Px..xxXB....Bxxx4AA..xxxxxxKxx
..PP.XX.PPxxxxx%...*XxxxxX.p..xxxKKxxx
........PPP.xxPpp.XPxxxxxxxxP.Xckkxxxx
..XxX.X......xxXp..xXxxxxXx...xc$ccxxx
Pxxxx.x...x.Xxxxx...x.xxxx...Gcc6$ccxx
zxxxxx..X..xxxxxXx...xXxx...xxc$$$$cxx
zxxxxxxxPPxxxxxxxxx.P..X.0.xXxc$$5$cxx
xxxxxxxX..XxxxxxXx......4xxxxxc$$$$cxx
xxxxxx...xxxxxxXx....P.xXxxCCUcc$$icxx
xxxxx...xxxxxxXx....XxxXxxCCC*xc$cixxx
xxxx...xxXxxxX.....xxxxxxx4C..1cccIxxx
xxxxxX.0.xxxx....x..xxxxxxxx..xHxxIxxx
xxxxxxX...xX...Xxx....pxxxX..%xHxxIxxx
 xxxxxxx.....Xxxxxx..........xxHxHhxxx
  xxxxxXxx.p.Xxxxxxxxxx....xxXxxHxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# Dogs by themselves get repetitive, so do bears. What if we combine them?...
# Previously "kennels" and "bearwithus", both by due.
NAME:    hangedman_lair_caniforms_friends
TAGS:    no_monster_gen no_rotate patrolling
PLACE:   Lair:$
ORIENT:  southwest
MONS:    wolf, warg, hell hound, raiju
MONS:    black bear, polar bear
KMONS:   8 = hell hog
KMONS:   P = plant
# The one big reward and the several smaller stacks of items
# are randomly split between the mostly-dog and mostly-bear sections.
KITEM:   % = any, any
KITEM:   *| = gold, gold, gold / maw talisman / maw talisman randart w:2, \
              any good_item
NSUBST:  2 = 2:22334 / *:3, 8 = 1:8 / *:.
SHUFFLE: %'*" / %'"|
SUBST:   X = xx., z = xx`, ' = ., " = x, p = PP.
SUBST:   H = 3:3 4:1, 0 = 2
CLEAR:   `
: lair_small_ending(_G)
MAP
xxxxxxxxxxxxxxxxxxxxzzz  @  @  @
xxxxxxxxxxxxxxxxxxxxxxxxxp..p..
xxxxxxxxxxxxxxxxxxxxxxxxxxp..p.
xxxxxxXxxxxxxxxxxxxxxxxxxxx....
xx%'56xxxxXXxxxxxxxxxxxxxxxP..p@
xx6..56xXx55xPxxxxxxxxxx...xP..
xxx9..xxx%...xPxx1x.x.x..1..xP.
xxXx...xxx...Px5x.........0..xp@
xxxxxx8......Px........x...Xxxx
xxxxXH.xx5...xP5..x2..x.xxxxxxx
xxxxxx1Hxx.%XXxx..xxxxxxxxxxxxxz
xxxxx"x06.Hxxxxx..xx1x.xx2xxxxxz
xxxxXx....5XxxxX....x.x....xHxxz
xxxxx%....xxxxxxx.............xz
xxxxx5....5xXxxxxx............xz
xxxxXx5....6xxxxxxxx1x...x2x..xx
xxxxxxP6.%6xXxxxxxxxxxx.xxxxx..x
xxxxxPxPxPxxxxxxxxxxxxxxxxxxx.Xx
xxxxxx6x6xxxxx1'xxxxxx2.x2x...xx
xxxxx...xxxxxx..xHx1x.........xz
xx*x1.....'xx1.....x.........xxz
xxx0.9......x.......8........xxx
xxH.%.1.xx....xx.....xx.1.2xxxxx
xxx2R0'xxxX..xxX2...xHxX1x1xxxxx
xxx.H.xxxxxx.xxxx'.xxxxxxxxxxxxx
xxx'.%xxxxxxxxxxxx2xxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# One of the three dragon's lair end vaults,
# and the most dragon-focused of them.
NAME:   guppyfry_lair_end_dragon
TAGS:   patrolling no_monster_gen no_pool_fixup
PLACE:  Lair:$
ORIENT: southeast
MONS:   rime drake / swamp drake / acid dragon / steam dragon
MONS:   basilisk / komodo dragon, iguana
MONS:   fire dragon / ice dragon, swamp dragon
KMONS:  P = plant
SUBST:  - = wwWW....%Ptt233, W = WWW., ? = 12**
: lair_small_ending(_G)
MAP
@..@..@..xxxxxxxxxxxxxxxxx
xPWW-P.xxxxttttttttttxxxxx
xttWW-ttttttttPWW-R.ttxxxx
xtttW-tt.tttt-WwwWP.1ttxxx
xtttWWtt...t--WwwwW-.tttxx
xtt1Wttt1.tt.WWttPWW.-tttx
xttWw-tP.t..Wttt--WWW.tttx
xxttWWt-1t..W--ttPWwwWttxx
xtt1-Wwttt.-wWtt.WwwwWttxx
xxtt--WttP.wWtttWwwwwWtttx
xttP.tWWttwWPtt.WWWwwWttxx
xttt.ttWww-.ttttPWwwwWtttx
xxttP.P-W-.tt%?$.WwwW.ttxx
xxtt...PWWttt*%.WwwW.ttxxx
xxttt.t.-Wtt45*.WwwW.ttxxx
xttttt..Wwttt*%..WW.tttxxx
xxxxtt..-WWtt%?$.WwWW.ttxx
xxxxxtt..-WWtttPWWwW..ttxx
xxxxxxtt..PWWttWWwW.tttxxx
xxxxxxxttt1.WWttWW..ttxxxx
xxxxxxxxttt.WwwwWP-ttxxxxx
xxxxxxxxxtt.-WwW..ttttxxxx
xxxxxxxxxttttWW-.tttxxxxxx
xxxxxxxxxxtttttttttxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# All-natural Lair spawns, in a condensed display.
NAME:    hangedman_lair_in_review
TAGS:    no_monster_gen no_item_gen patrolling
ORIENT:  float
PLACE:   Lair:$
# Compensate for the oblong floating status in the double vault set-up.
WEIGHT:  14
# Non-banded band monsters to highlight the vault, then
# four trio sets (mythological lizards, fast poison,
# duos of bovids / elephantae, fantasy hybrids), then bosses.
MONS:    wolf / blink frog / yak / hell rat w:2
MONS:    basilisk, rime drake, lindwurm
MONS:    wyvern, manticore, catoblepas
KMONS:   8 = water moccasin
KMONS:   9 : cane toad w:90 / hornet
KMONS:   0 : black mamba w:90 / wolf spider
KMONS:   A = elephant
KMONS:   B = death yak
KMONS:   C = dream sheep
KMONS:   D = hydra / torpor snail w:6 / dire elephant w:6
KMONS:   P = plant w:12 / fungus w:8
KITEM:   ~ = any good_item
SHUFFLE: 2d3e4f / 5g6h7i / 8j9k0l / AABBCC, $%*|
NSUBST:  J = 2:. / 1 = x:9 .:1 / *:x, K = 2:. / 1 = x:9 .:1 / *:x
NSUBST:  L = 2:. / 1 = x:9 .:1 / *:x
SUBST:   X = xx..., P = PP., defghijkl = ., E = 44700C
: lair_small_ending(_G)
MAP
     xxx  xx  xxxx   xxxx  xx  xxx
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxx.P.xxxxxxxxxxxxxxx.P.xxxxx
  xxxXXP.....PXXxxxxxxxXXP.....PXXxxx
 xxxXX.........XXxxxxxXX.........XXxxx
 xXX....xJxJx....XxxxX....xLxLx....XXx
xxX.....x...J.....XxX.....L...x.....Xxx
xxX....Xxdgjx.X..PxxxP..X.xfilxX....Xxx
xxP.c..Xx258J...xxx~xxx...L470xX..c.Pxx
xxx...xxxxxxxx...K369K...xxxxxxxx...xxx
xx..c..1.ExxP..X.xehkx.X..Pxx.|...c..xx
xx........xx.....K.D.K.....xx*~$....xxx
@..x.....1xxX....xxxxx....Xxx.%.E..xxx
  x.......XxxXX.........XXxxX.R9D3xxx
   .xx...PxxxxXXP.....PXXxxxxP..6xxx
   @xxxxxxxxxxxxxx.P.xxxxxxxxxxxxxxx
       xxxxxxxxxxxxxxxxxxxxxxxxxxx
           xxx  xxx xxx  xxx
ENDMAP

# Some of the most famously dangerous Lair animals are small, fast, and
# incidentally poisonous. Let's try a different approach to frog_pond...
# Inspired by minmay_lair_venomous_thicket.
NAME:    hangedman_lair_tendril_chambers
PLACE:   Lair:$
ORIENT:  float
MONS:    water moccasin / wyvern, hornet, cane toad
MONS:    black mamba, redback, wolf spider, guardian serpent
KMONS:   f = fungus
KMONS:   P = plant
# Connect the endpoints of two random quarters, open one of them to the center,
# rarely fray walls not between chambers, fringe the openings with plants.
SHUFFLE: AB / CD / EF / GH, DFH
SUBST:   P = P:35 @:25, z = x:49 f:1, BCDEG = x, AH = ., F : xxP
# A fixed number of chaff scattered throughout each eighth, and an even
# distribution of the various stronger spawns.
NSUBST:  1 = 6:1 / 4 = 11. / *:., 0 = 8:1 / 6 = 11. / 2:2 / *:.
NSUBST:  9 = 1:256 / 2:3 / 2:4 / * = 33445
NSUBST:  8 = 1:7 / 1:6 / 2 = 34 / * = 34 5:15 "
NSUBST:  ' = 1:R / *:"
NSUBST:  % = 10:% / 2 = %" / *:", x = 8:c / * = x
KMASK:   %*'" = no_monster_gen
: lair_small_ending(_G)
MAP
      PPPcccxxcccPPP
   PPPP.cc%cccc%cc.PPPP
  zz....c8$%**%$8c....zz
 Pzc....cc8$**$8cc....czP
PP.xx....c8"''"8c....xx.PP
P...xx1.0cc""""cc0.1xx...P
P....xx1.0c8""8c0.1xx....P
x....1xx1.cc""cc.1xx1....x
xzx.0.1xx%%c""c%%xx1.0.xzx
P.xzx0.%BB9cffc9DD%.0xzx.P
 P..xzx%9AAxffxCC9%xzx..P
 P....xxxAA""""CCxxx....P
  ......xc0"ff"0xx......
  ......xx""ff""cx......
 P....xxxEE"00"GGxxx....P
 P..xzx%9EExccxGG9%xzx..P
P.xzx0.%FF%9xx9%HH%.0xzx.P
xzx.0.1xx.%xxxx%.xx1.0.xzx
x....1xx1.0x..x0.1xx1....x
P....xx1.0xx..xx0.1xx....P
P...xx1...z....z...1xx...P
PP.xx....xx....xx....xx.PP
 Pzc.....z......z.....czP
  zz....xx......xx....zz
   PPPP.z..P  P..z.PPPP
      PPcPP    PPcPP
ENDMAP

###############################################################################
# Normal Lair endings.
###############################################################################

##############################################################################
# Vaguely Jungle Book (R. Kipling) inspired.
#
# This vault formerly released dire elephants from statues via a lua trigger
# after the anaconda died, which was spoilery. I've revised it to have a
# necromancy theme, with necromancers' Bind Soul being a somewhat analogous
# on-death effect compared to the old vault. -gammafunk
NAME:    due_jungle_book
TAGS:    no_pool_fixup no_wall_fixup no_monster_gen
PLACE:   Lair:$
ORIENT:  north
KMONS:   pq = withered plant
MONS:    elephant skeleton / elephant zombie / spectral elephant w:5 \
         / elephant simulacrum / spectral cane toad / cane toad simulacrum
MONS:    elephant, cane toad / death yak
MONS:    spectral death yak w:20 / death yak simulacrum w:20 \
         / dire elephant skeleton / dire elephant zombie \
         / spectral dire elephant w:5 / dire elephant simulacrum w:5
MONS:    dire elephant, patrolling necromancer, obsidian statue
# The anaconda's name is Kaa.
KMONS:   R = spectral anaconda
# A necromancy-themed loot item behind the obsidian statue.
ITEM:    rapier ego:pain w:5 / rapier ego:draining w:5 \
         / quickblade ego:pain w:5 / quickblade ego:draining w:5 \
         / demon blade ego:draining / sword of zonguldruk w:1 \
         / great sword ego:draining / triple sword ego:draining \
         / demon whip ego:pain w:5 / demon whip ego:draining w:5 \
         / eveningstar ego:draining / sceptre of torment w:1 \
         / great mace ego:draining / majin-bo w:1 / lajatang ego:draining \
         / broad axe ego:draining / battleaxe ego:draining \
         / executioner's axe ego:draining / shadow dragon scales \
         / cigotuvi's embrace w:1 / amulet of regeneration randart \
         / ring of positive energy randart / staff of death \
         / book of necromancy / book of death / book of unlife \
         / randbook owner:Kikubaaqudgha disc:necromancy \
         / necronomicon w:1
KITEM:   & = |, earthy gem
KFEAT:   R = deep_water
KFEAT:   s = closed_clear_door
# Thin out elephant/dire elephant bands of central necromancers a bit.
SUBST:   2 = 222.., 5 = 555..
# DE/FH/JK will always have a monster set, with one a guaranteed necromancer
# plus band, next a 50% chance to be a # necromancer band, 50% chance to be
# derived undead band, last guaranteed derived undead band. Necromancer band is
# 4 live monsters on average, mostly elephants, sometimes other beasts mixed
# in. Derived undead band is a stonger derived undead with 4 weaker ones on
# average.
SHUFFLE: DE / FH / JK
SUBST:   D = 6, E = 23...
SHUFFLE: FH / SZ
SUBST:   F = 6, H = 23..., JS = 4, KZ = 11...
# LM / NO / PQ each have 50% chance of being a derived undead band, 50% chance
# of nothing.
SHUFFLE: LM / NO / PQ
SHUFFLE: LM / SZ
SUBST:   L = 4, M = 11..., SZ = .
SHUFFLE: NO / SZ
SUBST:   N = 4, O = 11..., SZ = .
SHUFFLE: PQ / SZ
SUBST:   P = 4, Q = 11..., SZ = .
SUBST:   a = tttxxc, p = p-, q = q., r = xxx.., - = .:100 Z, Z = 12345
COLOUR:  t = brown
TILE:    t = dngn_tree_dead
TILE:    G = dngn_statue_elephant
: set_feature_name("tree", "dead tree")
MAP
   xxxcccccccc
  xxttrrrLrrrcc
 xxttqqqMMM.qrcc
xxqtq....MM..qrcc                           ccccc
xx...qrrqr..r..rcccccccccccccccccccccccccccccaaGttq.
xq.qttcccc++c++ccccccccccccccccccccccccccccaaaKKJttqq.
xt7ttccccG--c..OOGcc.WWccGqqqGccqqqccQQ.....qqGKKGttt.
cnsncccccp-pcq.OON+..WwW+.55%&cG.2..+QQQqqc.cq.Kaaatq.
cndnccccc-c-ccccOGcqWwwR+.56**c|$22.cPqcccc---caaccc..
cnnnccccc+cp--pccccqwwwwcG5qqGc*%22.cccc---pc+ccccccc.
ccccGEEqq.cccc---pcWWWWqccnnnccG62qqcp--pcccc.qqHHGcc.
xxxc*DE..qccccccc-cccWqcccGpGcccqqccc-cccccccq..HF*cc.
xxxcGEEqqqccttaccp-pcccccGpYpGccnncp-pccattccqqqHHGcc.
 xxcccccccctq..qccc-----------------cccq..qtcccccccc..
 .axacccatq..  .qtcccccccc+++cccccccctq.  .qqtcccatq.
 ..........     ..........@@@....a.....     ........
ENDMAP

##############################################################################
# Standard occultist works do make demons out of distorted animals, after all.
#
NAME:    evil_forest
TAGS:    no_pool_fixup no_wall_fixup no_monster_gen no_rotate
PLACE:   Lair:$
ORIENT:  southeast
WEIGHT:  5
MONS:    rime drake, hydra w:15 / dire elephant, arcanist / occultist
MONS:    red devil / ice devil w:15 / orange demon w:15
MONS:    hellwing / smoke demon, sun demon / sixfirhy / hell beast w:4
KMONS:   hH = hell hound
KMONS:   F = fungus
KITEM:   A = superb_item no_pickup, any good_item no_pickup \
             / no_pickup gold good_item w:15, % no_pickup \
             / nothing, % no_pickup / nothing
KITEM:   _ = earthy gem
KFEAT:   A = enter_hell
KFEAT:   _ = altar_makhleb
KFEAT:   L = endless_lava
NSUBST:  1 = 3 = 11122 / * = 1h, 4 = 5:4 / 1:4H / *:H
SUBST:   T = ttt.
KPROP:   ` = bloody
KMASK:   '"`456H = no_item_gen
FTILE:   "_A456H = floor_cage
COLOUR:  "456H = red
MAP
  ...TTTT....  .............................
 ..TttttttT.......Tt.TtT....TT..TT......Tt....
..TtttttttttT..TTtttttttT..TttttttTT..TTtttT...
..Tttttttttttt0ttttttttttttttttttttttttttttttT..
.Tttttttttttttt.ttttttttttttttttT.Ttttttttttttttt
..Ttttttttttttt.tttttttttttttttT.1.Tttttttttttttttxx
.....ttttttttt..tttttttttttttttT....ttttttttttttttxx
..Ttt0.tttttt....ttttttttttttttt..Tt..ttttttttttttxx
..Ttttt.......t.0.tttttttttttt...ttttt.0ttttttttttxx
..ttttttt..0tttt.t..ttttttttt.0.tttttttt..ttttttttxx
.Tttttttttttttt..ttt...ttt....ttttttttttT.1Tttttttxx
...Ttttttttttt..ttttt.......tttttttttttT....Ttttttxx
...tttttttttt.1ttttttt0ttFtttttttttcccccc++cccccccxx
..Tttttttttt..tttttttttttt+ccccccccc'''''''''''''clL
..Ttttttttt.0t..ttttttttttc''''''''c'''G````G''''clL
.Tttttttttt..tt..tttttttttc''G'G'''+'''''''''''''clL
..Tttttttt..tttt.tttttttttc'''c'G''ccccccccccccccclL
.Tttttttt..ttttt..ttttttttc''c'G'''c"""""""4lllllllL
..Ttttt.0ttttttt...tttttttc'''G'c''c""""""""44lllllL
....T..tttttttt....tttttttc''G'c'''+""""_""654AllllL
...T0tttttttttt*Q1ttttttttc'''G'G''c"""""4444llllllL
..Ttttttttttttttttttttttttc'''''''3c""""4llllllllllL
ttttttttttttttttttttttttttcccccccccccccllllllllllllL
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxllllllllllllllllllL
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxLLLLLLLLLLLLLLLLLLL
ENDMAP

##############################################################################
# Frog pond.
#
NAME:    minmay_lair_end_frog_pond
TAGS:    no_monster_gen
PLACE:   Lair:$
ORIENT:  float
KMONS:   1 = bullfrog
KMONS:   2 = cane toad
KMONS:   3 = vampire mosquito
KMONS:   4 = blink frog
KMONS:   5 = komodo dragon / hydra
KMONS:   6 = tyrant leech / skyshark w:5
KMONS:   7 = electric eel
KMONS:   8 = goliath frog
KMONS:   p = plant
ITEM:    any good_item
KITEM:   R = earthy gem, %
KFEAT:   123678p = W
# Previously 11.6 bullfrogs, 16.6 cane toads,
# and 7.1 vampire mosquitoes on average.
NSUBST:  XW = 3:1 / 5:2 / 5:3 / 7 = 11WWW / 11 = 22WWW / 7 = 44WWW
NSUBST:  W = 3 = 678 / *:W, 5 = 1:5 / *:4W
NSUBST:  % = 1:d / 1:* / 1:R / * = %%*|
SHUFFLE: AB, CD
SUBST:   AB = x, CD = w
SUBST:   X = x:80 W:15 .:10 p:10
SUBST:   W = W:80 w:25 p:10
SUBST:   . = .:85 W:20 p:10
KMASK:   d%*|R = no_monster_gen
MAP
          ............xxx
       .................xxx
   .........WWWWWW........xxxx
  .......WWWWWAWWWWWWWWW.......
 x.....WWWWWAAAWWWWWWWWWWW.....
 x...WWWWWWWWAAAWWWWWWWWWWW.....
 x..WWWWWWWWWWAAAAWWWWWWWWWW....
xxxxx..WWWWWWWAWWWWWWWWWWWWW....
x.XXxxxx..WWWWWWWWWWWWWDWWWWW...
x.WWXXXxxxxxxxpp4WWWWWWDWWWWW...
x.WWWWWXXXxxppppp5WWWWWDDWWWW...
..WWWWWWWW4pp%%%pp4WWWDDDDDWW...
..WWWWWWWW6pp%%%%pp6WWWWDDWWWW..
..WWWWCWWW4ppp%%%pp4WWWWWDWWWW..
.WWWWCCWWWW4ppppppxxXXWWWWWWWW..
.WWCCCCCWWWW5WppxxxxxxXXXWWWWW.x
.WWWCCWWWWWWWWWWWWW..xxxxXXXWW.x
.WWWCWWWWWWWWWBWWWWWWW..xxxxXX.x
..WWCWWWWWWBBBBWWWWWWWWWWWWxxxxx
..WWWWWWWWWWWBBBWWWWWWWWWWW...x
...WWWWWWWWWWWBBBWWWWWWWW.....x
....WWWWWWWWWWBWWWWWWWW.......x
 .....WWWWWWWWWWWWWW.........
  xxx......WWWWWW.........
    xxxxx..............
        xxxx.......
ENDMAP

##############################################################################
# A mock-up of Forest, made well before serious attempts at the branch.
#
NAME:   minmay_lair_end_enchanted_forest
PLACE:  Lair:$
ORIENT: northwest
MONS:   black bear / polar bear w:12, wolf, dream sheep / hornet w:20
MONS:   spriggan, spriggan rider, boggart
KITEM:  * = gold no_pickup, star_item no_pickup, star_item no_pickup
KITEM:  | = gold no_pickup, superb_item no_pickup, star_item no_pickup
KITEM:  $ = gold no_pickup, star_item no_pickup
KITEM:  R = earthy gem
SUBST:  T : T:20 .:1 t:1, T = tt..., E = t_
CLEAR:  _
NSUBST: . = 5:1 / 3 = 10 / 3:3 / 3 = 3.. / *:.
NSUBST: 2 = 8:2 / 18 = 2. / *:., 4 = 6:4 / 6 = 4. / *:.
NSUBST: 5 = 1:5 / *:6, 9 = 2:6 / 2 = 56 / *:4
NSUBST: * = 1:| / *:*
MAP
ttttttttttttttttttttttttttttttttttttttttttttttttttt
tttttttttttttttttttttttttttttttttttttttttttttttttt
tttttttttT*G*Ttttttt....ttttttttt.....ttTTtttttTT
ttttttttt4.*.9TTT....Tt.5..TTT....ttT.2222TTtt..@
tttttttTT.4R4....TTttttttT..4...TttttttTT222..ttT
tttttT.....9..4TtttttttttT4...4ttttttttt22ttttttt
ttttT..ttT4.4.Tttttttt..T....4.tttttttt..tttttttE
tttt.ttttttttttttttttt......tt..TttT...TT.tttttt
tttT2tttttttttttttttttT....ttttt.....ttttT.Tttt
ttT22tttT.9TtttttttT....tTTttttttTTttttttt..ttE
tt22ttt$.4..tttttT5.TTT..tttttttttttttttttt.tt
tt22tttT9.4.ttttT.TttttT.22tttttttttttttttT.tt
tt2tttttt..TtttT2TtttttttT22TttttttttttttT.ttt
tt2ttttttt.TtTT22tttttttttT222ttttttttttt.Tttt
tt..tttttTT..222Ttttttttttttt22ttTTTTtt..TtttE
ttT.tttt.....TTT222TttttttttttT...TT...TttttE
ttt..tt...TTttttttt..TTttttttttT..4...Tttttt
tttT....TtttttttttttT@   EEttttt49.49ttttttE
ttttT..tttttttttttttE      EEttttT.$TttttE
ttttT..TtttttttttttE          ttttttttt
ttttt...ttttttttttE            ttttttt
tttttT..TttttttE                 EEE
ttttttt.@ttE
ttttttE
tttE
tE
t
ENDMAP

##############################################################################
# Catoblepas ending by evilmike.
# Contains 3 catoblepas, with one being semi-randomly placed. The last
# one is likely to breathe on you in an area that is hard to escape from.
#
NAME:   evilmike_catoblepas_cave
TAGS:   no_monster_gen no_rotate no_item_gen
PLACE:  Lair:$
ORIENT: northwest
ITEM:   any good_item
KITEM:  R = earthy gem
MONS:   yak, death yak, manticore
KMONS:  4C = patrolling catoblepas
# These are still living plants for all intents and purposes...
KMONS:  P = plant perm_ench:petrified dbname:petrified_plant \
            col:lightgrey tile:mons_withered_plant
SUBST:  P = P.
NSUBST: 0 = 3:1 / 1:2 / * = 1112
NSUBST: 9 = 1:C / 2:2 / 2:3 / * = 11222
COLOUR: d|*$4c-R = lightgrey
FTILE:  d|*$4c-R = floor_cobble_blood
MAP
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxcccxxxxxxxxxxxxxxxxx
xxxxccc*cccxxxxxxxxxxxxxxxx
xxxxcd|$$4cxxxxxxxxxxxxxxxx
xxxxcc$R--ccxxxxxxxxxxxxxxxxxx
xxxxxcc----ccxxx%PxxPxxxxxxxxxxx
xxxxxxccc---cxxP......Pxxxxxxxxxxx
xxxxxxxxcc-ccxP.9.0.x...xxxxxxxxxxx
xxxxxxxxxc-cxx.0.9.xxxP..xxxxPP.%xxxx
xxxxxxxxxc-cxxP...xxxxx...xxxx0.9xxxx
xxxxxxxxxx.cxxxx..xxxxxxx...xx.1.0xxx
xxxxxxxxxx.xxxxxx...xxxxxxx......xxxx
xxxxxxxxxx.xxxxxxxx..xxxxxx...xxPPxxx
xxxxxxx.....xxxxxxx..Pxxxx..xxxxxxxxxx
xxxxxx90.x..xxxxxxP..xxxx..xxxxcccxxxx
xxxxxx0xxxx..xxxxxx..Pxxx.xxxccc4ccxxx
xxxxxxxxxx..xxxxxx0.......xxcc----ccxx
xxxxxxxxxP..Pxxxx01xxxP...Pcc------cxx
xxxxxxxxx.....xx..xxxxxxP..c------ccx
xxxxxxxxP.G.G.....xxxxxxx..---cc--cxx
xxx%xxx..G.P9.G.xxxxxxxxxxx-ccc---cxx
x%P9Pxx..9..G....xxxxxxxxxxxxc---ccxx
xx0..1....P..G..PPxxxxxxPPxxx...xxxx
xxxP1...xxxP..PxxxxxxxxxxP9....xxxxx
xxxxxPPxxxxxxxxxxxxxxxxxxx......xxx
xxxxxxxxxxxxxxxxxxxxxxxx......G...
xxxxxxxxxxxxxxxxxxxxxx....G.......
xxxxxxxxxxxxxxxx     ........G....
xxxxxxxxx             ..G........
xxx                   .........G.
x                           .....
ENDMAP

##############################################################################
# The beastmaster's lair.
# Inspired by discussions of deep troll professionals and the prospect of a
# "beastmaster"; here he lives, with packs of beasts and one powerful
# personal pet.
#
# On his own the boss shouldn't be *extremely* threatening - it's his pet
# and the inner welcoming party that add enough danger that this ending
# stands on its own.
#
NAME:    grunt_lair_end_beastmaster
TAGS:    no_monster_gen no_item_gen no_trap_gen patrolling
PLACE:   Lair:$
ORIENT:  northeast
MONS:    deep troll shaman, dire elephant / hydra / lindwurm
MONS:    catoblepas, death yak band
MONS:    elephant, wolf, black bear / polar bear
KMONS:   P = plant / fungus w:2 / bush w:1
KITEM:   R = earthy gem
SHUFFLE: 567
SUBST:   C = cx.., P = P .:9 t:1
NSUBST:  % = 2:| / 3:* / *:%
NSUBST:  5 = 2:5 / 3 = 5. / *:.
NSUBST:  6 = 3:6 / 4 = 6. / *:.
NSUBST:  7 = 1:7 / 2 = 7. / *:.
{{
  dgn.delayed_decay(_G, 'd', "human skeleton / orc skeleton / elf skeleton"
                             .. " / dwarf skeleton / ogre skeleton w:1"
                             .. " / naga skeleton w:1 / minotaur skeleton w:1"
                             .. " / merfolk skeleton w:1")
}}
MAP
                xxxxxxxxxxxxxx
          xxxxxxx5P.Pxxxxxxxxx
         xxP..5.5..P..xxxxxxxx
        xxP5d5.5.5P.P..xxP.xxx
       xx.5.5.5ccccccc....P..x
       x...5.ccc.d...ccc.P..xx
      xx.P.ccc..d......d...Px
     xx..ccc...G..C..3..d..xx
    xx..ccc.G....CcC..4..c.x
    x.P.ccc..d..CcCcC...cc.x
    x..ccc%.G..GRCcC...ccP.x
   xx..ccc%%.2.dG.C..d.c...x
   x...cccc%%.1.....G.ccP..x
   x.P.ccccc%%.Gd.G...c..P.x
  xx....ccccc%%.....ccc...xx
 xx.d..Pccccccc%cccccP.6..x
xx.P..7..cccccccc.P.6.6.Pxx
..7..7.7P..ccP..P6.6d6.Pxx
.P.7..7..d....P...6.6.xxx
d.P.7P..P.xxxx.P..P6.xx
.P.7..7..xx  xxx.P..xx
..P.P..xxx     xxxxxx
.P.P..xx
..P.dxx
@....x
ENDMAP

###############################################################################
# An ancient temple flooded with waters brought forth by a mystic avatar.
#
NAME:    gammafunk_lair_ancient_temple
TAGS:    no_pool_fixup no_monster_gen
PLACE:   Lair:$
ORIENT:  float
KITEM:   % = any
KITEM:   * = star_item
KITEM:   | = superb_item
: kitem("d = " .. dgn.loot_potions)
KITEM:   e = throwing net q:3 / rapier good_item / captain's cutlass w:2 \
         / trident randart / trident of the octopus king w:2 \
         / demon trident w:5 / phial of floods / ring of the octopus king w:2, \
         earthy gem
KMONS:   p = plant
KMONS:   1 = hornet / wyvern / blink frog / cane toad / steam dragon
KMONS:   2 = elephant / komodo dragon / polar bear / rime drake
KMONS:   3 = snapping turtle / sea snake / manticore / wind drake / harpy \
         / skyshark
KMONS:   4 = dire elephant / hydra / torpor snail
KMONS:   5 = patrolling merfolk avatar
KFEAT:   p12345de%*| = W
NSUBST:  % = 2=d / 2=d% / 1:e / %%*|
# Open up squares on the fixed portions of the temple walls, on the outer
# columns, and in the inner room.
SUBST:   c = c:20 .:1 W:1, a = ccc-, q = cccc'
# Each wall has a 50% chance of being broken open
SHUFFLE: DEFHJ / uuyzz
SUBST:   u = -, y = c, z = '
SHUFFLE: KLMNO / uuyzz
SUBST:   u = -, y = c, z = '
SHUFFLE: PQRSZ / uuyzz
SUBST:   u = -, y = c, z = '
# For broken wall areas, put four wall squares in the area, spread out in a way
# that prevents clumping. Also put some dry floor in these areas.
SHUFFLE: DE, HJ, KL, NO, PQ, SZ
NSUBST:  DFH = 4=c, DEF = 2=. / 2=.- / -, HJ = 2=. / 2=.' / '
NSUBST:  KMN = 4=c, KLM = 2=. / 2=.- / -, NO = 2=. / 2=.' / '
NSUBST:  PRS = 4=c, PQR = 2=. / 2=.- / -, SZ = 2=. / 2=.' / '
# Monsters of each tier are distributed across outer and inner portions.
NSUBST:  - = 12=1W / 8=2W / 4=3W / 2=4WWW / W, ' = 4=2W / 8=3W / 5 / W
# Ruin statues, possibly place inner chamber doors. Also replace some shallow
# water with floor and some with plants throughout the map.
SUBST:   G = GGGW., + : +.W, W = W:125 .:10 p:10, " = W.
COLOUR:  c = white
MAP
""""""""""""""""""""""""
"aa--aa--aa--aa--aa--aa"
"aa--aa--aa--aa--aa--aa"
"----------------------"
"----aa---a--a---aa----"
"aa--c------------c--aa"
"aa--c---LKLKLK---c--aa"
"----cG--KLKLKL--Gc----"
"----cccccMMMMccccc----"
"aa--cU''ONONON''Uc--aa"
"aa--c'''GONONG'''c--aa"
"--EDcHJ'qqqqqq'SZcPQ--"
"--DEFJH'q%%%%q'ZSRQP--"
"a-EDFHJ'q%ww%q'SZRPQ-a"
"a-DEFJH'q%ww%q'ZSRQP-a"
"--EDFHJ'q%%%%q'SZRPQ--"
"--DEcJH'qq++qq'ZScQP--"
"aa--c'''G''''G'''c--aa"
"aa--cU''''''''''Uc--aa"
"----ccccc----ccccc----"
"----cG----------Gc----"
"aa--c-a-a-GG-a-a-c--aa"
"aa--c------------c--aa"
"----aa-aaa--aaa-aa----"
"----------------------"
"aa--aa--aa--aa--aa--aa"
"aa--aa--aa--aa--aa--aa"
""""""""""""""""""""""""
ENDMAP

###############################################################################
# A mini-volcano! No fire clouds and twice as many enemies, though.
#
NAME:    cheibrodos_lair_end_hotspot
TAGS:    no_item_gen no_monster_gen
PLACE:   Lair:$
ORIENT:  float
MONS:    black mamba, steam dragon
MONS:    hell hound, molten gargoyle
MONS:    komodo dragon / wyvern w:7 / basilisk w:7 / hydra w:2
MONS:    lindwurm / fire crab w:3, fire dragon
KMONS:   8 = hell hog
KMONS:   Y = lava snake
KFEAT:   Y = lava
KITEM:   R = earthy gem, gold
# Generate one of two paths leading to central chamber
SHUFFLE: ABCD= / HIJKL
SUBST:   A = @, BH = x, CI = ., K = ", J = l, L = c
# Generate one of two perches for dangerous enemies
SHUFFLE: MN / OP
SUBST:   M = 6, N = ., OP = l
# Monster and loot placement
SHUFFLE: ';`, -~ / -~ / ~-
NSUBST:  ' = 3:3 / 2 = 3. / 1:5 / 2 = 15. / 1:2. / *:.
NSUBST:  ; = 3:5 / 3 = 15. / 1:2. / *:., ` = 3 = 5 / 3 = 15. / 1:2. / .
NSUBST:  - = 1:7 / *:", ~ = 2:8 / *:"
NSUBST:  D = 1:R / 1:|* / 2 = *% / 3 = $% / 2:$ / *:"
NSUBST:  G = 2:4 / 1:4. / *:G, l = 5:Y / l
KMASK:   "$%*|7 = no_trap_gen
MAP
                xxxxxxx
             xxxxxxxxxxxxx
            xxxxxxxxxxxxxxx
           xxxxllxllxllxxxxxxx
         xxxxxxxlllllllllxxxxxxx
       xxxxxxxlllllxxx.llllxxxxxxxx
      xxxxlxxllxxxxxx'.'.lllGxxxxxxx
      xxxlllxllxGxGx'.'.'..llxxxlxxxx
       xxxxlxlxxx....'.'.xxxlllxllxxx
       xxxxlllxxG.'.'.'.'.Gxxllllxxxx
        xxxxlllxx'.'.'.'.'xxxxxlxxxx
        xxxxxllx'.'.'.'.'..Gxxxlxxxx
      xxxxxxxxll.x.'.'.'.'.xxxllxxxx
     xxxxxxxGxx..x'.'.'.'.xxlllllxxx
     xxxGxG.;x..xxxJJl..xxIllllllxxxx
   xxxxxx..;.;.lPllJJllxxlIIllxxllxxxx
  xxxxxx;.;.;.xllPlJJllxllIIllxxllxxxx
 xxxx....;.;.;llPccLLccllllIIxxxxxxxxx
 Ax.....;.;.xllPccDDDDccllxx'xxGxGxxx
 x.....;.;xxlllOcDD--DDcllx'.'...xxxx
xAxxxx..;.;.;.lln"----"nlx`.`...xGxxx
 xxxxxx..;.;.;xln"----"nlN.`.`.`xxxx
   xxxxx;.;.;.xlcKK--KKcNl`.`.`.xxxx
   xxxxG...;.xxlccKKKKccNlx`.`.`xxxxx
    xxxx..;.BBlllcc==ccMllx.`.`..xxxxx
    xxxGxG.xxBBllllCCllllx.`.`.....xHx
     xxxxx;llBBxxllCCll.`.`.`.`.....x
     xxxxxlllxBx;.lCCl.`.`.`.`...xxxH
    xxxxxllllxx;.`..`.`.`.`.`.xxxxxxx
    xxxlllxllll.;.`..`.`.llllxxxxxxx
   xxxxllxxxxxllll.`..`llllxxxxxxx
   xxxllxxxxxxxlllll.`lllxxxxxxx
   xxxxxxxxxxxxxGxllllllllxxxxx
    xxxxxx  xxxxxxxGxGxxxllxxxx
              xxxxxxxxxxxllxxx
                 xxxxxxxxxxxx
                     xxxxxxx
ENDMAP

###############################################################################
# An abyssal version of the forest ending
# monster set drawn from weaker abyss spawns and lair branch abyssal visitors
NAME:    hellmonk_lair_end_abyssal_woods
PLACE:   Lair:$
ORIENT:  northwest
MONS:    blink frog / basilisk w:3, small abomination
MONS:    shapeshifter / chaos spawn / smoke demon / ynoxinul
MONS:    raiju, ugly thing / large abomination, thrashing horror
KMONS:   7 = spriggan ; rapier ego:distortion
KITEM:   R = earthy gem, %
KFEAT:   u = demonic_tree
KFEAT:   N = enter_abyss
KFEAT:   _ = altar_lugonu
SUBST:   " = '.
COLOUR:  '%M = magenta
FTILE:   '%MN_u = floor_nerves_magenta
NSUBST:  %d = 1:R / 2:| / 3:* / *:%
NSUBST:  1 = 5=1 / 1.., 2 = 4=2 / 2..
NSUBST:  4 = 4 / 3, ' = 2:6 / 2 = 56 / 3:O / 5 = 5543O. / .
SUBST:   7M = 7O
# 33% chance for an additional opening at the south.
SHUFFLE: yzD / JKL / JKL
SUBST:   y = @, zD= ., JK = t, L = p
# 33% chance for an additional opening at the north east.
SHUFFLE: EFH / JKL / JKL
SUBST:   E = @, FH= ., JK = t, L = p
SUBST:   a = tt..., q = pp..., p = tttu, s = rr..., r = tu
{{
  dgn.delayed_decay(_G, 'O', "spriggan skeleton / wolf skeleton w:3"
                             .. " / polar bear skeleton w:2"
                             .. " / black bear skeleton w:2")
}}
MAP
ttttttttttttttttttttttttttttttttttttttttttttttttttt
tttttttttttttttttttttttttttttttpppppppppppttpppptt
ttttttttttttttttttttttttttttppppdd7..pp.2ppppFFFE
ttttttt..tttt.tttatttttttpppp22...pp.....222HHHFF
tttttta.aa..4....attttttppq......pppppp1....24ppt
ttttt.......O...tatttttpp1...11ppppppppp..ppppptt
tttt...tt..aa11atttttppp2.....1pppppqqp..rrtttttt
ttt...tttttttt1..ppppp..1111pp222pp......2rrtttt
ttt..ttttttttttt.2.pp.4.1pppppp2....qqrss..rrt
tta......tttttttt..q..1pppuuuupppp4ppprrrr12rtt
tt..t.....ttttttt...2qppuuuMNuuuupppttttrrs4rt
tt11ttt22...tttt..2pppppu%%''%%uuutttttrr..rrt
tt1attttt...ttt...ppppdpuu'''_''%utttttr..rrtt
ta1ttttttt2.tt...pppd54ppu%''''uurrrrrrrs..rtt
tt11ttttt....111qpppa.2ppuuuu''urr"".rr.41rrtt
tt..ttttttt.111....tt..qppttr'''''"s....ssrtt
ttt..tttttttttttpp...2..qpttrr''''sss.rrrrrt
ttta...atttttttttppDD..qpptttrrrr'""..rttttt
tttt..atttttttttppzzpppppttttttr''""rrrtt
tttta..attttttttpzzzttttttt   trrrrrrttt
ttttt...ttttttttppzy          tttttttt
ttttta...tttttttttt               ttt
ttttttt.@ttt
ttttttt
tttt
tt
t
ENDMAP
