###############################################################################
# float.des: This is the place where floating regular vaults should go. These
#            are defined as vaults with an ORIENT: float line. Vaults with
#            other ORIENT arguments (encompassing, north, northwest etc.)
#            are considered big and reside in large.des. Vaults without any
#            ORIENT line are minivaults and behave somewhat differenty; these
#            are stored in mini.des.
#
#            All maps dealing with the Vault branch system, including Vaults:8
#            reside in vaults.des.
###############################################################################

{{
function callback.ancient_champions_mu_skele_death(data, triggerable,
                                                    triggerer, marker, ev)
  data.skele_number = data.skele_number + 1

  -- Only 7 skeles!
  if data.skele_number > 7 then
    return
  end

  local function get_slave (slavenum)
    local myslaves = dgn.find_marker_positions_by_prop("skele_slave", slavenum)
    return myslaves[1]
  end

  local wall_pos = get_slave(data.skele_number)
  if wall_pos == nil then
    crawl.mpr("Couldn't find a slave!")
  end

  dgn.terrain_changed(wall_pos.x, wall_pos.y, "floor", false, false, false)

  if you.see_cell(wall_pos.x, wall_pos.y) then
    crawl.mpr("As the champion is destroyed, a metal wall slides away!")
  else
    crawl.mpr("As the champion is destroyed, you hear a distant grinding noise.")
  end
end

function callback.cathedral_bats (data, triggerable, triggerer, marker, ev)
  if triggerer.type ~= "turn" or triggerer.sub_type ~= "countdown" then
    return
  end

  if data.bat_count > 10 then
    return
  end

  local x, y = marker:pos()
  local you_x, you_y = you.pos()

  if (you_x == x and you_y == y) then return end
  if dgn.mons_at(x, y) then return end

  if (not dgn.create_monster(x, y, "generate_awake bat name:megabat n_rpl n_spe / generate_awake w:2 fire bat")) then
    return
  end

  data.bat_count = data.bat_count + 1

  if you.see_cell(x, y) then
    crawl.mpr("A bat flies out of a crevice!")
  end
end
}}

# Set the default depth for vaults. Be sure to adapt the DEPTH of particulary
# easy or tough vaults. Also, exclude unthemely branches with !Lair etc.
default-depth: D:12-26

##############################################################################
# Dummy probability balancer vault for depths 1-11.
#
# Why this is necessary: there are very few vaults in the 1-11 range (entries
# are not considered here); to avoid too much repetition of the existing vaults,
# we use this dummy vault.
#
NAME: dummy_balancer
DEPTH: D:1-11
# Vaults tagged "dummy" are no-ops when the dungeon builder is looking for maps
# by depth.
TAGS: dummy
ORIENT: float
WEIGHT: 100
MAP
x
ENDMAP

##############################################################################
# Dummy probability balancer vault for non-dungeon branches.
#
NAME: dummy_balancer_other
DEPTH: 1-, !D, !Zot:1-4
# Vaults tagged "dummy" are no-ops when the dungeon builder is looking for maps
# by depth.
TAGS: dummy
ORIENT: float
WEIGHT: 60
MAP
x
ENDMAP

################################################################################
# Elevator
#
NAME:    lemuel_elevator
DEPTH:   D:2-26, Vault:2-7, Elf:2-4, Crypt:2-4, Zot:2-4, Tar:2-6, Dis:2-6, Geh:2-6, Coc:2-6
ORIENT:  float
TAGS:    allow_dup
SUBST:   m:mn
SHUFFLE: {}, ]}) , [{(
MAP
mmmm
m{}m
mmmm
ENDMAP

##############################################################################
# Kobold bridge
# Could perhaps use colour.
#
NAME:   minmay_kobold_bridge
TAGS:   no_monster_gen
DEPTH:  D:1-2
ORIENT: float
WEIGHT: 3
MONS:   kobold / nothing w:3
MAP
xxxxxx@xxxxxx
xxxx.....xxxx
xxx.......xxx
xxxw.....wxxx
xxxww..1wwxxx
xxxww...wwxxx
xxxww1..wwxxx
xxxww..1wwxxx
xxxww.1.wwxxx
xxxww...wwxxx
xxxww1..wwxxx
xxxw.....wxxx
xxx.......xxx
xxxx.....xxxx
xxxxxx@xxxxxx
ENDMAP

##############################################################################
# Rooms
#
NAME:    minmay_opposing_rooms
DEPTH:   D:4-
ORIENT:  float
SHUFFLE: 0%
MAP
xxxxxxxxxxxxxxxxxxxxx
xxxx........xxx%.%xxx
xx......x...xx....%xx
xx..9..xx...x......%x
x......xx...+.......x
@....xxxx...x......%x
xxxxxxxxx...xx....%xx
xxx0.0xxx...xxx%.%xxx
xx0....xx...xxxxxxxxx
x0......x...xxxx....@
x.......+...xx......x
x0......x...xx..9..xx
xx0....xx...x......xx
xxx0.0xxx........xxxx
xxxxxxxxxxxxxxxxxxxxx
ENDMAP

##############################################################################
# Klotski a.k.a. what we learned from the elders.
#
NAME:    minmay_klotski
SHUFFLE: }])>
DEPTH:   D:6-12
ORIENT:  float
SUBST:   0 = 0.., 9 = 9., 8 = 88.
MONS:    bush
MAP
xxxxxxxxxxxxxxxxxxxxx
x....+.........+...9x
x1...x...0.0...x....x
x...1x..0.0.0..x.0..x
x1...x.0.....0.x..0.x
x...1x..0...0..x.0..x
x1...x.0.....0.x..0.x
x...1x.........x.0..x
x1...x.9.9.9.9.x....x
x...1x8.8...8.8x9...x
x+xxxxxxxx+xxxxxxxx+x
x...9x$$$$$$$$$xG...x
x.0..x$$$$$$$$$x....x
x..0.x$$$$$$$$$x....x
x.0..x$$$$$$$$$x....x
x..0.xxxxxxxxxxx....x
x.0..+....x0...+....x
x..0.x..T.x.0..x....x
x.0..x.T..x..0.x....x
x9...x....x...0x...Gx
xxxxxxxxx+x+xxxxxxxxx
     x....x....x
     x....x....x
     x....x....x
     x}...x...]x
     xxxxxxxxxxx
ENDMAP

##############################################################################
# Statue pair
#
NAME:    minmay_separated_statues
DEPTH:   D:8-16
ORIENT:  float
MONS:    silver statue, orange crystal statue, ice statue
SHUFFLE: 123
MAP
     ......
    ......xx
   xxx.....xx
  xx*xx.....xx
 xx...xx.....xx
xx*.1..xx..2.*xx
 xx.....xx...xx
  xx.....xx*xx
   xx.....xxx
    xx......
     ......
ENDMAP

##############################################################################
# Statue gallery
#
NAME:    minmay_statue_hallways
DEPTH:   D:8-
ORIENT:  float
MONS:    orange crystal statue / silver statue / ice statue
MAP
       xxx            xxx            xxx
       x1x            x1x            x1x
       x*x            x|x            x*x
      xx.xx          xx.xx          xx.xx
      x...x          x...x          x...x
     xx...xx        xx...xx        xx...xx
   xxx.....xxx    xxx.....xxx    xxx.....xxx
xxxx.........xxxxxx.........xxxxxx.........xxxx
@.............................................@
...............................................
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
...............................................
@.............................................@
xxxx.........xxxxxx.........xxxxxx.........xxxx
   xxx.....xxx    xxx.....xxx    xxx.....xxx
     xx...xx        xx...xx        xx...xx
      x...x          x...x          x...x
      xx.xx          xx.xx          xx.xx
       x*x            x|x            x*x
       x1x            x1x            x1x
       xxx            xxx            xxx
ENDMAP

##############################################################################
# Stone golems
#
NAME:   minmay_stone_box
DEPTH:  D:10-16
ORIENT: float
KMONS:  " = stone golem
KITEM:  " = any scroll / any potion
MAP
cccccccccc
c{......>c
c........c
c........c
c...""...c
c...""...c
c........c
c........c
c<......}c
cccccccccc
ENDMAP

##############################################################################
# Wavy paths in crystal walls
#
NAME:   minmay_wavy_crystal
DEPTH:  D:10-
ORIENT: float
MAP
bbbbbbbbbbbb@.@bbbbbb
@...bbbbbbbb...bbbbbb
......bbbbbb...bbbbbb
@......bbbbb...bbbbbb
bbbb...bbbbb...bbbbbb
bbbbb...bbbbb...bbbbb
bbbbb...bbbbb.....bbb
bbbbb...bbbbbb.....bb
bbbbb...bbb..bbb...bb
bbbbb...bb9bb.bb....b
bbbbb...bb|bb.bb....b
bbbbbb...bbb.bb....bb
bbbbbb.............bb
bbbbbbb...........bbb
bbbbbbbbb.......bbbbb
bbbbbb..bbb...bbb..bb
bbbbb.bb9bb...bb9bb.b
bbbbb.bb|bb...bb|bb.b
bbbbbb.bbb.....bbb.bb
@...................@
............b........
@.........bbbbb.....@
bbbbbbbbbbbbbbbbbbbbb
ENDMAP

##############################################################################
# A traditional vault
#
NAME:    minmay_two_paths
ORIENT:  float
DEPTH:   D:12-26
MAP
cccccccccccccccc
c.9.c......c.9.c
c.c.c.c88c.c.c.c
c.c.c.c$$c.c.c.c
c.c.c.c%%c.c.c.c
c.c.c.c**c.c.c.c
c.c.9.c||c.9.c.c
c.cccccccccccc.c
c.cccccccccccc.c
c.9.c......c.9.c
c.c.c.c..c.c.c.c
c.c.c.c..c.c.c.c
c.c.c.c..c.c.c.c
c.c.c.c..c.c.c.c
c9c.9.c00c.9.c9c
ccccccc..ccccccc
ENDMAP

##############################################################################
# Skeleton sneak attack
#
NAME:   minmay_skeletal_surprise
TAGS:   no_monster_gen no_item_gen
DEPTH:  D:18-26
ORIENT: float
MONS:   skeletal warrior
KMONS:  $ = skeletal warrior / large skeleton / bone dragon w:1 / nothing w:40
KITEM:  $ = $
MAP
ccccccccccccc
c$$$ccccc$$$c
c$$$ccccc$$$c
c$$$ccccc$$$c
cccc1ccc1cccc
ccccc...ccccc
ccccc.}.ccccc
ccccc...ccccc
cccc1ccc1cccc
c$$$ccccc$$$c
c$$$ccccc$$$c
c$$$ccccc$$$c
ccccccccccccc
ENDMAP


################################################################################
# Staircase flavor vaults.
#
NAME:    minmay_staircase_windowed_small
TAGS:    extra luniq_staircase
DEPTH:   D:2-26
ORIENT:  float
WEIGHT:  5
SHUFFLE: )]}([{
SUBST:   ? = cn
SUBST:   c : c x:2 v:1 b:1
SUBST:   n : n:18 G:1 .:1
SUBST:   G : ...G
MAP
ccccccccc
cG.GcG.Gc
c...+.).c
cG..c...c
cc+cc?n?c
cG..c...
c...+...
cG.Gc...
ccccc
ENDMAP

NAME:    minmay_staircase_windowed_large
TAGS:    extra luniq_staircase
DEPTH:   D:2-26
ORIENT:  float
WEIGHT:  5
SHUFFLE: )]}([{
SUBST:   c : c x:2 v:1 b:1
SUBST:   n : n:18 G:1 .:1
SUBST:   G : ...G
MAP
ccccccccccccc
cG...GcG...Gc
c.....c.....c
c.....+..)..c
c.....c.....c
cG...GcG...Gc
ccc+ccccnnncc
cG...Gc.....
c.....c.....
c.....+.....
c.....c.....
cG...Gc.....
ccccccc
ENDMAP

NAME:    minmay_staircase_statues
TAGS:    extra luniq_staircase
DEPTH:   D:2-26
ORIENT:  float
WEIGHT:  5
SHUFFLE: )]}([{
MAP
G.G
.).
G.G
ENDMAP

NAME:    minmay_staircase_statues_hall_small
TAGS:    extra luniq_staircase
DEPTH:   D:2-26
ORIENT:  float
WEIGHT:  3
SHUFFLE: )]}([{
SUBST:   c : c x:2 v:1 b:1
MAP
   ccccc
   cG.Gc
   c...c
cccc...cccc
cG.......Gc
c.).......+
cG.......Gc
cccc...cccc
   c...c
   cG.Gc
   ccccc
ENDMAP

NAME:    minmay_staircase_statues_hall_large
TAGS:    extra luniq_staircase
DEPTH:   D:2-26
ORIENT:  float
WEIGHT:  2
SHUFFLE: )]}([{, AB
SUBST:   A = .
SUBST:   B = G
SUBST:   C = G.
SUBST:   c : c x:2 v:1 b:1
MAP
     ccccccc
     cB.A.Bc
     c.....c
     c.....c
     c.....c
cccccc.....cccccc
cB.............Bc
c................
cA.)....C.......@
c................
cB.............Bc
cccccc.....cccccc
     c.....c
     c.....c
     c.....c
     cB.A.Bc
     ccccccc
ENDMAP

NAME:    minmay_staircase_bubble
TAGS:    extra luniq_staircase
DEPTH:   D:2-26
ORIENT:  float
SUBST:   m = mmmm.
MAP
 .......
..bb.bb..
.bb...bb.
.b.....b.
.m..)..m.
.b.....b.
.bb...bb.
..bbmbb..
 .......
ENDMAP

##############################################################################
# Cavepeople
#
NAME:   erik_1
ORIENT: float
WEIGHT: 5
TAGS:   no_monster_gen
DEPTH:  D:7-11, Lair
#
SHUFFLE: rR/sS/uU/vV/wW/yY/zZ, uU/nN
SUBST: r=n, R=N, s=n, S=N
SUBST: n=., N=@
SUBST: u=x, v=x, w=x, y=x, z=x
SUBST: U=x, V=x, W=x, Y=x, Z=x
#
SUBST: 1 = 1:20 ., 2=2., 3=23, 4=24
MONS:  jackal/hound, human, Edmund/Jessica/Sigmund, Ijyb/Psyche
MONS:  sheep/nothing
MAP
         xSxxxxx    xxxxxxxxxxUx
         xxssxxx    xx1xxxxxxuxx
xxxxxxxxxxxxxssx    x111xxxxxuxx
xxxzzzxxxxxxxxxsxxxxxx1xxxxxxuxx
Zzzxzxzxx555xxsxxxxxxx1xxxxxuxxx
xxxxxxxzxx5xxx.xxx..x1xxxxxuxxxx
   xxxxzxx5xxxx......xxxxxuuxxxx
   xxxzxxxx5xx...2...cccxxxux
   xxxzxxxx....2224..+$cxxuxx
   xxxxz.......2ll22.cccxxxux
   xxxxxx......3222.xxxxxxuxxxxxxxxx
   xxxxxxyxxxx2.......xxuuxxvvvvxxxx
   xxxxxyxxxx.......xx..vxvvxxxxvxxx
xxxxxxyyxxxxxrxxxxx.xxwxxvxxxxxxxvvx
xxxyxyxxxxxxrxxrxxxx.xxwxxxxxxxxxvxx
xyyyyxxxxxxxxrrxrrxxxxxxwxxxxxxxvxxx
xyxxxx     xxxxrxrrxxxxxxwwxxxxxxvvxxxxx
Yxxxxx     xxxxxxxrxxxxxxxxwxxxxxxxvvxvV
xxxxxx   xxxxxxxrrx       xxwxxxxxxxxvxx
         xxxrrrrxxx       xxwxxxxxxxxxxx
         xxRxxxxxxx       xxWxx
ENDMAP

##############################################################################
# Old Forge (1KB)
#
NAME:    old_forge
DEPTH:   D:4-12
ORIENT:  float
KITEM:   ? = long sword unrand:singing_sword, damaged short sword, \
             damaged long sword, damaged hand axe
KITEM:   ! = damaged executioner's axe, damaged short sword, \
             damaged long sword, damaged morningstar
KITEM:   + = damaged eveningstar, damaged short sword, \
             damaged long sword, damaged war axe
KITEM:   & = damaged hammer / nothing
MONS:    fungus, plant
MONS:    giant mite, scorpion
MONS:    rat / porcupine, green rat / orange rat
MONS:    bat
SHUFFLE: ?!+
SUBST:   c:cccvvb , b=cc.
SUBST:   1 : 1112
SUBST:   1=1. , 2=2.... , 3=3. , 4=4. , 5=5. , 6=6.
SUBST:   ':.x''' , '=.x , .=........17
MAP
              xxxxxxxxxxxxxxxx
             xxx11'cccccccxxxx
            xxx'...c..?v3cx1xx
           xx111.3.c&'.v3c14xx
           x111'.......&&c4xxx
           xxx3.11..1xxccc.44x
             xxx.1.1113x..'xxx
              xxx'&..11.'xxx
               x1xxx'..xxx
               xxx xx'.'xx
                    xxx44xxxx
                      xx'.44xx
                       xxxx.'x
                          xx@x
ENDMAP

##############################################################################
# Sometimes You Just Gotta Run
# Moved deeper and minor changes.
#
NAME:    erik_ogre
DEPTH:   D:6-10
ORIENT:  float
SHUFFLE: 1X / 1X / 2l / 3Y
SUBST:   X=x, Y:x.
MONS:    ogre, iron devil, nothing
ITEM:    potion of heal wounds / potion of speed / potion of berserk rage /\
         scroll of blinking
MAP
        xx@xx
        x...x
        xX.Xx
        xX1Xx
        xX.Xx
        xx.xx
        xx.xx
        xx.xx
        x...x
        x...x
        x...x
        x.d.x
        x...x
        x.d.x
        x...x
     xxxx...xxxx
     x....[....x
xxxxxx..x(.{x..xxxxxx
x...x...x...x...x...x
x....x..xx]xx..x....x
xxxxxx...xxx...xxxxxx
     xxxxx xxxxx
ENDMAP

################################
# Starter slime pit
#
# The slime creature or amoeba may seem too tough for the level where this appears,
# but since they are normal speed with no range attacks, they can be escaped.
#
NAME:   slime_lemuel
DEPTH:  D:6-16, Lair
ORIENT: float
MONS:   w:20 ooze / jelly / fungus
MONS:   slime creature / giant amoeba / oklob plant
MAP
xxxxxxxxxx
xxxx111xxx
xx1111111x
@+1112111x
xx1111111x
xxxx111xxx
xxxxxxxxxx
ENDMAP

##############################################################################
# Beware the mummy's curse (Lemuel)
#
NAME:    MiniTomb
ORIENT:  float
DEPTH:   D:15-26, Crypt
MONS:    large zombie / nothing
MONS:    mummy, patrolling guardian mummy, patrolling greater mummy
MONS:    large zombie
MONS:    mummy / nothing
SHUFFLE: 2F, cbv
SUBST:   F = G:99 F:1
KMONS:   F = orange crystal statue / silver statue / ice statue
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxx3$$xxxxxxxxxxxxx
ccxxxxxxxxccc=cccccccccxxxx
cccxxxxxxxc.....c...1$cxxxc
@Fcx6$.xxxc..1..c...25ccccc
cccccc=cccc.62..c...15c$$$c
@+111.....+.63..=..F11=4||c
cccccc=cccc.62..c...15c$$$c
@Fcx6$.xxxc..1..c...25ccccc
cccxxxxxxxc.....c...1$cxxxc
ccxxxxxxxxccc=cccccccccxxxx
xxxxxxxxxxx3$$xxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

####################################
# An old-fashioned vault, by Lemuel
#
NAME: traditional_vault_lemuel
DEPTH: D:12-27, Vault
ORIENT: float
SUBST: 9 = 9 0 8:2
SUBST: 0 = 0 .
KFEAT: $ = ^
KITEM: $ = gold
MAP
........................
wwwwwwwwwwwwwwwwwwwwwwww
wcccccccccc==ccccccccccw
wc$..................$cw
wc.........99.........cw
wc..cccccccccccccccc..cw
wc0.c$....9999....$c.0cw
wc..c.....9999.....c..cw
wc..c..cccc++cccc..c..cw
wc..c..c$......$c..c..cw
wc..c..c...99...c..c..cw
wc..c..c..cccc..c..c..cw
wc00c..c..c||c..c..c00cw
wc00c..c..c||c..c..c00cw
wc..c..c..c++c..c..c..cw
wc..c..c..9889..c..c..cw
wc..c..c$.9889.$c..c..cw
wc..c..cccccccccc..c..cw
wc..c......99......c..cw
wc0.c$............$c.0cw
wc..ccccccc++ccccccc..cw
wc.........00.........cw
wc$........00........$cw
wccccccccccccccccccccccw
wwwwwwwwwwwwwwwwwwwwwwww
........................
ENDMAP

#############################################################################
# Anthole (zaba)
# Intentionally used ORIENT: float in order to enforce rooms+corridors.
#
NAME:   zaba_anthole
ORIENT: float
TAGS:   allow_dup
DEPTH:  D:3-9, Lair
MONS:   worker ant / nothing w:5
MAP
   @
 xx+xx
xx...xx
x.111.x
x.111.x
xx...xx
 xx+xx
   @
ENDMAP

#############################################################################
# Insect pit (Lemuel)
#
NAME:   insect_pit
TAGS:   no_rotate
ORIENT: float
DEPTH:  D:5-12, Elf, Vault
SUBST:  1 = 1:70 2:60 3:25
MONS:   goliath beetle w:20 / giant cockroach w:30 / butterfly w:20
MONS:   bumblebee / giant centipede / giant mite w:30
MONS:   killer bee / scorpion / redback w:5
MAP
cccccccc+cccccccc
c...............c
c...............c
c....vvvvvvv....c
c....v11111v....c
c....=11111=....c
c....v11111v....c
c....vvvvvvv....c
c...............c
c...............c
cccccccc+cccccccc
ENDMAP

#############################################################################
# Troll bridge (Lemuel)
#
NAME:   troll_bridge
DEPTH:  D:9-18
ORIENT: float
TAGS:   no_pool_fixup patrolling
SUBST:  1 = 1:50 2 3:5
MONS:   troll
MONS:   rock troll
MONS:   iron troll
MAP
xxxxx...........................xxxxxx
xwwwx...........................xxxxxx
xwwwx...........................xxxxxx
xwwwx...........................xxxxxx
xwwwwwwwwwwwwwwwww.wwwwwwwwwww..xxxxxx
xxwwwwwwwwwwwxxxxw.wwwwwwwwwwwwwwwwxxx
xxwwwwwwwwwwwx11xw.wxxxxwwwwwwwwwwwwxx
xxwwwwwwwwwwwx11=...=11xwwwwwwwwwwwwwx
xxxwwwwwwwwwwxxxxw.wx11xwwwwwwwwwwwwwx
xxxxxwwwwwwwwwwwww.wxxxxwwwwwwwwwwwwwx
xxxxx...wwwwwwwwww.wwwwwwwwwwwwwwwwwwx
xxxxx...........................xwwwwx
xxxxx...........................xxwwwx
xxxxx...........................xxwwwx
xxxxx...........................xxxxxx
ENDMAP

#################################
# An Ice Statue vault
#
NAME:    ice1_lemuel
MONS:    ice statue
TAGS:    no_pool_fixup
ORIENT:  float
DEPTH:   D:7-20, Elf
SUBST:   * : *$
SUBST:   * = |:5 * .
SUBST:   T = TU
SHUFFLE: xb/cc, ABC
: if crawl.coinflip() then
KFEAT:   X = < / >
KITEM:   X = any good_item
SUBST:   A=., B=., C=.
: else
SUBST:   X=*, B=., C=.
KFEAT:   A = teleport trap
: end
MAP
xxxxxxxxxxxxxxxxx
xbbbbbbbbbbbbbbbb
xb**....www.....T
xb**..A.www......
xbX*..B.w1w.....@
xb**..C.www......
xb**....www.....T
xbbbbbbbbbbbbbbbb
xxxxxxxxxxxxxxxxx
ENDMAP

#####################################################
# Lions and Tigers and Bears, oh my! (or at least bears)
#
NAME:   lemuel_bear_cage
ORIENT: float
DEPTH:  D:7-21
MONS:   black bear / grizzly bear / polar bear
MONS:   hippogriff / griffon
MONS:   yak / sheep / weight:3 death yak
MONS:   hound / wolf / hog
SUBST:  1 = 1:30 2 3 4 .
MARKER: + = lua:props_marker { \
            door_open_prompt="This door is covered in warnings. Open " .. \
                             "it anyway?", \
            door_description_prefix="warning-scrawled " \
        }
MAP
cccccccccc
c.1.1.1.1c
c1.1.1.1.c
c.1.1.1.1c
c1.1.1.1.c
c.1.1.1.1c
cnn++++nnc
..........
@........@
..........
xxxxxxxxxx
ENDMAP

##################################
# Vampire Tower by Lemuel Pitkin
#
NAME:    vampire
ORIENT:  float
DEPTH:   D:12-26, Vault, Crypt
MONS:    rat / porcupine / w:6 green rat / w:3 orange rat / w:20 bat
MONS:    flying skull, human zombie
MONS:    vampire, vampire mage, vampire knight
KITEM:   > = any good_item
KFEAT:   > = >
KFEAT:   ; = altar_yredelemnul/altar_kikubaaqudgha
SHUFFLE: defg
SUBST:   d = =, e = x, f = x, g = x
SUBST:   s = =, ! = x, ? = x
SUBST:   1 = 1 .:20
SUBST:   1 : 1:30 2
SUBST:   + = +=
SUBST:   w:w.
NSUBST:  ? = 2:L / *:?
SUBST:   ? = L:1 x
SUBST:   ? = x
SUBST:   L = |*$
MAP
F..wwwwwwwwwwwwwwwww..F
..wwwwwwwwwwwwwwwwwww..
.www111xxxx+xxxx111www.
www111xxx22322xxx111www
ww111xx.+23432+.xx111ww
ww11dx..ccccccc..xe11ww
ww1xx..ccc|>|ccc..xx1ww
wwxx..ccccc6ccccc..xxww
wwx..ccc33+4+33ccc..xww
wwx.ccccccc+cccc?cc.xww
wwx.c***x.....x???c4xww
wwx.c***=..5..x???c.xww
wwx4cc**x4.;.4x??cc.xww
wwx..ccxx.....x?cc..xww
wwxx..ccx..4..xcc..xxww
ww1xx..cc.....cc..xx1ww
ww11fx..ccc.ccc..xg11ww
ww111xx..cc+cc..xx111ww
www111xx..333..xx111www
.www111xxxxxxxxx111www.
..wwwwwwwwwwwwwwwwwww..
F..wwwwwwwwwwwwwwwww..F
ENDMAP


#############################################################################
# Oklob gauntlet
# average of 2.3 oklobs, and at most 5 of them
NAME:    oklob_2
DEPTH:   D:18-26, Lair, Snake, Elf
MONS:    plant, oklob plant
ORIENT:  float
SHUFFLE: ]}) / def
NSUBST:  ' = 5:2 *:1
NSUBST:  2 = 1:2 *:112
SUBST:   1=1w, "=ww.
SUBST:   d=|*, e=|*, f=|*
MAP
xxxxxxxxxxxxx
xxxxx]})xxxxx
xxxxx...xxxxx
x'ww.....ww'x
x'"......."'x
x'"......."'x
x'"......."'x
x'"......."'x
x'ww.....ww'x
xxxxxx+xxxxxx
ENDMAP

#############################################################################
# Oklob shooting range
#
# Disallowing this vault on branch starts, as brown stairs can't help there.
# Chance for a plant to turn oklob based on dungeon level. Elf:5 is hard, but
# considered okay. Has between 1 and 3 oklob plants.
# Single oklob at absolute depth 10, expect 2 oklobs at depth 20.
# Rarely (2.5% chance) the whole vault is enclosed. This is the hardest case,
# and the walls are always diggable then.
#
NAME:    oklob_3
DEPTH:   D:18-26, Lair:2-, Elf:2-5
WEIGHT:  2
ORIENT:  float
SHUFFLE: ab" / AB'
SUBST:   a=[, b=(, A=., B=., '=., "=>
#
SUBST:   x : y:1 x:5 .:34
SUBST:   x = x:2 .
SHUFFLE: xcv
SUBST:   y = x
#
NSUBST:  1 = 1:2 1:3 *:1
: wt = (you.absdepth()-10)/2
: mons("oklob plant w:" .. wt .. " / plant")
MONS:    plant, oklob plant
MAP
xxxxxxxxxxxxxxx
xxxx...1...xxxx
xx...........xx
xx...........xx
x......"......x
x......'......x
x1...aA{Bb...1x
x......'......x
x......"......x
xx...........xx
xx...........xx
xxxx...1...xxxx
xxxxxxxxxxxxxxx
ENDMAP

#############################################################################
# Swampy vault
#
NAME:    onia_ninara_012_swampy_vault
TAGS:    no_pool_fixup no_monster_gen
DEPTH:   D:16-20, Lair:3-, Snake
ORIENT:  float
SHUFFLE: AB@
SUBST: x = .:30 W x:4
SUBST: A : x, B : x
SUBST: D = .:30 W
KFEAT: E = w:20 . / x / w:50 W / w:30 w / ~
KFEAT: F = w:150 w / w:70 W / ~ / . / x
KFEAT: G = x / . / w / W
KFEAT: H = . / W
KMONS: D = Plant / w:200 nothing
KMONS: E = w:2 slime creature / swamp worm /\
           w:2 vampire mosquito / w:1 electric eel / w:1000 nothing
KMONS: F = w:2 slime creature / swamp worm /\
           w:2 vampire mosquito / w:2 electric eel / w:1000 nothing
KMONS: H = swamp drake / swamp dragon / hydra / w:20 nothing
KITEM: H = any good_item / any potion / w:20 nothing / gold
MAP
xxxxxxxxxxxxxxxxx@xxxxxxxxxxxxxxx
xxxxxxGGGxxxxxxGEDEExxxxGGxxxxxxx
xxxxGHHFFGGGGFFFEEDEEGGFFFxxGGxxx
xxFFFHHFFFFFGFFFFEEDEEFFFFFFFFGxx
xGGFFFFDDEEFFFFFEEDEEFFFFFFFFFFGx
xxGFFFFEEDDEEFFEEDEEFFFEEEFFFFGxx
xGFFFFFFFEEDEEEDDEEEEEEEDDEEEFFGx
xGGFFFFFFFEEDEDEEEEEEEDDEEDDDEEDB
xxGFFFFFFFFEEDEDDEDDDDEEEEEEEDDxx
xxxGFFFFFFEEDEEEEDEEEEEFFFFFFFFxx
xxxxFFFFFEEDEEFFFFDDFFFFFFFFFGGGx
xxxGFFFFEEDEEFFFFFFEDEFFFFFFFxxxx
xGGFFFFFFDEEFFFFFFFFEDFFFFFFGGxxx
xGFFFFFFEEDEEFFFFFFFFEDEFFFGxxxxx
xxGxxxGFEEDEEFFFFGGGFFHHHGxxxxxxx
xxxxxxxGFEEDEEGGxxxxxGFHGxxxxxxxx
xxxxxxxxGFDEGGxxxxxxxxxGxxxxxxxxx
xxxxxxxxxxAxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

###########################
# Another low-level vault - LP

NAME:    reptile_caves
DEPTH:   D:10-13, Lair, Snake
ORIENT:  float
MONS:    giant gecko / giant newt, crocodile, iguana
MONS:    fire drake / swamp drake
MONS:    snake, water moccasin, viper
SUBST:   4 = 34
SUBST:   3 = 3:20 2
SUBST:   2 = 2:20 1
SUBST:   1 = 1.
SHUFFLE: ab/cd
SUBST:   a = w, b = x, c = x, d = .
SHUFFLE: 123/567
SUBST:   X=x.
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxXW**wXxxxxxxxxxxxxxxX**XXx
xXwWwwwXxxxxxxX33xxxxxX423Xx
xXWww232XxxxxX121xxxxX.13Xxx
xXXWww2XxxxxxX.1xxxxxw222Xxx
xxXXWwwwaaxxxxXWxxaaaw1121Xx
xxxXWww1XaaaaaWwaaaxXWw211Xx
xxxxXW23xxxxxaWwwxxxXww11XXx
xxxxXX1XxxxxxxxWwwxxxxX.Xxxx
xxxxxxX.XxxxXwWwwwxxx...Xxxx
xxxxxxx..Xxxx2xWwxxX..XXxxxx
xxxxxxxX.12111xw3X211bxxxxxx
xxxxxxxxxxXXXxxW2xxxxbbxxxxx
xxxxxxxxxxxxxxxw1Xxxxxbbxxxx
xxxxxxxxxxxxxXww1Xxxxxxbxxxx
xxxxxxxxxxxXwwww111@...Xxxxx
ENDMAP

##############################################################################
# A guard of gargoyles
#
# ORIENT: float ensures correct stair generation.
#
NAME:    gargoyle_guard
ORIENT:  float
TAGS:    patrolling no_monster_gen
DEPTH:   D:10-18
# you should be able to arrive both via stairs and via corridor
SUBST:   { = {([)]}
MONS:    gargoyle, metal gargoyle / gargoyle
MAP
xxxxxxxxxxxxxxxxxxx
xxxxxxxxx2xxxxxxxxx
xxxxx1x1x.x1x1xxxxx
xxxxx.........xxxxx
xxxx...........xxxx
xxxx...........xxxx
xxx...G..{..G...xxx
xxxx...........xxxx
xxxx...........xxxx
xxxxx.........xxxxx
xxxxx1x1x.x1x1xxxxx
xxxxxxxxx.xxxxxxxxx
xxxxxxxxx.xxxxxxxxx
xxxxxxxxx.xxxxxxxxx
xxxxxxxxx@xxxxxxxxx
ENDMAP

##############################################################################
# Ogre Cave, by Lemuel
#
NAME:    lemuel_ogre_cave
ORIENT:  float
DEPTH:   D:9-15, Orc
TAGS:    no_pool_fixup
MONS:    ogre, two-headed ogre, ogre mage / Erolcha, plant / fungus
MONS:    ogre zombie, two-headed ogre zombie
SHUFFLE: WX/ZY , 12/12/67
SUBST:   W:ww. , X:. , Z:x , Y:+.=
SHUFFLE: *5/WW
SUBST:   *=. , W=wW , !:$.
SUBST:   5 = 5 6 = ^:5 I:5 F:5
MAP
              xxxxx
          xxxxxx12xx
         xx*..x.122xx
 xxxxxxxxx5xxx...11xx
xxWxxxxxxx*xxxxx....xx
xxWWxxxxxx.xxxxxx**xxxx
xWWWxxxxxx.xxxxxxx**xxxxx
WWWW**xxxxx.xxxxxxx5xxxxxxxx
xWWWW..xxxxx.xxxxxx.xccccccx
xxWW....1xxx.xxxxx.xxc$$$$cx
@..X...111..xxxxxx.xxc$$$$cx
xxWWW...11xxxxxxx.xxxc!!!!cx
xWWW....*xxxxxxx*..xxc+ccccx
xxWWW..**xxxxxx*....x..xxxxx
 xxWWWW*xxxxxxx*.11.Y.xx
  xxWWWWWxxxxxxx1221xxx
  xxxxWWWWxxxxxxx23xx
  xxxxxWWxxxxxxxxx|xx
  xxWWWWxxxxxxxxxxxx
  WWWWxxx
ENDMAP

##############################################################################
# Slaugherhouse (Zaba)
#
# Butchers have either knives or hand axes. They have some chance of opening
# the doors so animals can go for a walk, that's intended.
#
NAME:   slaughterhouse
DEPTH:  Lair:7-, D:11-18
TAGS:   no_monster_gen
ORIENT: float
WEIGHT: 5
MARKER: F = lua:fog_machine { \
                pow_max = 10, delay_min = 10, delay_max = 40, \
                size = 4, size_buildup_amnt = 4, \
                size_buildup_time = 25, cloud_type = "freezing vapour" \
            }
MONS:   death yak w:5 / sheep w:3 / yak w:7
MONS:   generate_awake human ; dagger | hand axe
SUBST:  F=d, 2=2.
ITEM:   meat ration w:5 / sausage / nothing
MAP
 cccccc       ccccccc
 cddddcxxxxxxxxcddddc
 cdFdd+..+..+..+ddFdc
 cddddcxxx..xxxcddddc
 cccccc..x..x..cccccc
.........x2.x.........
.nnnnnn..x..x..nnnnnn.
.n1111nxxx..xxxn1111n.
.n1111+..+..+..+1111n.
.n1111nxxx..xxxn1111n.
.nnnnnn..x..x..nnnnnn.
.........x.2x.........
 xxxxxx..x..x..xxxxxx
 x...2xxxx..xxxx2...x
 x..2.+..+..+..+.2..x
 x...2xxxx..xxxx2...x
 xxxxxx  x..x  xxxxxx
         x++x
          @.
ENDMAP

##############################################################################
# The Shining One Protects a Powerful Item 1 (by abrahamwl)
#
# The basic theme of this vault is that the the Shining one has placed a
# powerful item under the guard of an angel or daeva
#
NAME:    protected_by_tso_1
ORIENT:  float
TAGS:    patrolling no_monster_gen no_item_gen no_pool_fixup allow_dup luniq_protected_by_tso
WEIGHT:  4
DEPTH:   23-27
MONS:    generate_awake angel / generate_awake daeva / w:1 angel / w:1 daeva
COLOUR:  - : yellow
SUBST:   - : +
KMASK:   + = no_secret_doors
MARKER:  ! = lua:message_at_spot ( "You almost think you hear a voice: \
                                   \"Seek not undue power, mortal.\"", \
                                   "warning" )
SUBST:   ! : .
MAP
         xxxxx
   xxxxxxxXXXxxxxxxx
   xXXXXXXX1XXXXXXXx
   xX|...-...-...|Xx
   xXXXXXX...XXXXXXx
   xxxxxXX...XXxxxxx
     xxxXG...GXxxx
    xxxxXX...XXxxxx
    xXXXXX...XXXXXx
    xXxxxx---xxxxXx
    xX...........Xx
    xX...........Xx
    xX..G.....G..Xx
    xX...........Xx
    xX.....1.....Xx
    xX...........Xx
    xX..G.....G..Xx
    xX...........Xx
    xX...........Xx
    xXXXXXX-XXXXXXx
    xxxxxxx!xxxxxxx
       xxxx+xxxx
           @
ENDMAP

##############################################################################
# The Shining One Protects a Powerful Item 2 (by abrahamwl)
#
# The basic theme of this vault is that the the Shining one has placed a
# powerful item under the guard of an angel or daeva
#
NAME:    protected_by_tso_2
ORIENT:  float
TAGS:    patrolling no_monster_gen no_item_gen no_pool_fixup allow_dup luniq_protected_by_tso
WEIGHT:  4
DEPTH:   18-27
MONS:    generate_awake angel / generate_awake daeva / w:1 angel / w:1 daeva
KFEAT:   A = altar_shining_one
KITEM:   A = w:1 acquire:the_shining_one any / nothing
: if crawl.one_chance_in(3) then
SUBST:   | = .
SUBST:   % = |
SUBST:   ? = =
: else
SUBST:   % = X
SUBST:   ? = X
: end

COLOUR:  _ : yellow
SUBST:   _ : .
SUBST:   T = T F:1
COLOUR:  - : yellow
SUBST:   - : +
KMASK:   + = no_secret_doors
MARKER:  ! = lua:message_at_spot ( "You almost think you hear a voice: \
                                   \"Seek not undue power, mortal.\"", \
                                   "warning" )
SUBST:   ! : .

MAP
    xxxxxxxxxxxxxx
  xxxXXXXXXXXXXXXXxxx
  xXXX_____A_____XXXx
  xX%?Wwwww_wwwwW=|Xx
  xXXXxWwww_wwwWxXXXx
  xxxXxxWWw_wWWxxXxxx
   xXXxxxx._.xxxxXXx
   xxXxxxx---xxxxXxx
    xX...........Xx
    xX...........Xx
    xX..G.....G..Xx
    xX...........Xx
    xX.....1.....Xx
    xX...........Xx
    xX..G.....G..Xx
    xX...........Xx
    xX...........Xx
    xXXXXXX-XXXXXXx
    xxxxxxx!xxxxxxx
       xxxx+xxxx
           @
ENDMAP

##############################################################################
# The Shining One Protects a Powerful Item 3 (by abrahamwl)
#
# The basic theme of this vault is that the the Shining one has placed a
# powerful item under the guard of an angel or daeva
#
NAME:    protected_by_tso_3
ORIENT:  float
TAGS:    patrolling no_monster_gen no_item_gen no_pool_fixup allow_dup luniq_protected_by_tso
WEIGHT:  4
DEPTH:   18-27
MONS:    generate_awake angel / generate_awake daeva / w:1 angel / w:1 daeva
KFEAT:   A = altar_shining_one
KITEM:   A = w:1 acquire:the_shining_one any / nothing
: if crawl.one_chance_in(3) then
SUBST:   | = .
SUBST:   % = |
SUBST:   ? = =
: else
SUBST:   % = X
SUBST:   ? = X
: end
COLOUR:  _ : yellow
SUBST:   _ : .
SUBST:   T = T F:1
COLOUR:  - : yellow
SUBST:   - : +
KMASK:   + = no_secret_doors
MARKER:  ! = lua:message_at_spot ( "You almost think you hear a voice: \
                                   \"Seek not undue power, mortal.\"", \
                                   "warning" )
SUBST:   ! : .
MAP
      xxxxxxxxxxx
     xxxxxXXXxxxxx
    xxxxxxX|Xxxxxxx
    xXXXXXX=XXXXXXx
   xxXWWWWTATWWWWXx
  xxxXW.._____..WXx
  xXXXWt..___..tWXx
  xX%?W...___...WXx
  xXXXWt..___..tWXx
  xxxXxxxx---xxxxXx
    xX...........Xx
    xX...........Xx
    xX..G.....G..Xx
    xX...........Xx
    xX.....1.....Xx
    xX...........Xx
    xX..G.....G..Xx
    xX...........Xx
    xX...........Xx
    xXXXXXX-XXXXXXx
    xxxxxxx!xxxxxxx
       xxxx+xxxx
           @
ENDMAP

###########################################################################
# Eyes! by Minmay
NAME:   minmay_eyes
DEPTH:  D:14-24
ORIENT: float
MONS:   eye of devastation / great orb of eyes w:2
MONS:   golden eye / shining eye w:2
MONS:   giant orange brain
MAP
...................................
.cccccccccccc.........cccccccccccc.
.c.............................n2c.
.c.1.............1.............nnc.
.c...............................c.
.c...cccccccccnnnnnnnccccccccc...c.
.c...c.......................c...c.
.c...c.1.........1.........1.c...c.
.c...c.......................c...c.
.c...c...ccccccnnnnncccccc...c...c.
.c...c...c...............c...c...c.
.c...c...c.1.....1.....1.c...c...c.
.c...c...c...............c...c...c.
.n...c...c...cccnnnccc...c...c...n.
.n...n...c...c3.....3c...c.......n.
.n...n...n...c..%.%..c...n.......n.
.n...n...n.....%|*|%.n...n.......n.
.n.1.n.1.n.1....*|*..n.1.n.1...1.n.
.n...n...n.....%|*|%.n...n.......n.
.n...n...n...c..%.%..c...n.......n.
.n...n...c...c3.....3c...c.......n.
.n...c...c...cccnnnccc...c...c...n.
.c...c...c...............c...c...c.
.c...c...cnn.....1.....1.c...c...c.
.c...c...c2n.............c...c...c.
.c...c...cccccc.....cccccc...c...c.
.c...c.......................c...c.
.c...c.1.........1.........nnc...c.
.c...c.....................n2c...c.
.c...cccccccccnnnnnnnccccccccc...c.
.c...............................c.
.c.1.............1.............1.c.
.c...............................c.
.ccccccccccccnnnnnnnnncccccccccccc.
...................................
ENDMAP

##############################################################################
# Elemental Laboratory (by Mu.)
#
NAME:   elemental_lab_mu
DEPTH:  D:13-26, Elf:1-4
ORIENT: float
TAGS:   no_monster_gen no_item_gen no_pool_fixup
MARKER: ! = lua:fog_machine { \
                pow_max = 10, delay_min = 10, delay_max = 40, \
                size = 2, size_buildup_amnt = 5, \
                size_buildup_time = 25, cloud_type = "flame" \
            }
MARKER: ? = lua:fog_machine { \
                pow_max = 10, delay_min = 10, delay_max = 40, \
                size = 2, size_buildup_amnt = 5, \
                size_buildup_time = 25, cloud_type = "thin mist" \
            }
MARKER: * = lua:fog_machine { \
                pow_max = 10, delay_min = 10, delay_max = 40, \
                size = 2, size_buildup_amnt = 5, \
                size_buildup_time = 25, cloud_type = "black smoke" \
            }
KMONS:  1 = fire elemental
NSUBST: ; = 3:2 / *=.ll
KMONS:  2 = molten gargoyle
KMONS:  e = earth elemental
SUBST:  E = exxx....
NSUBST: ' = 3:3 / 3:W / *:.
KMONS:  3 = clay golem
NSUBST: w = 3:4 / *:w
KMONS:  4 = water elemental
KFEAT:  4 = deep_water
NSUBST: " = 3:5 / *:.
KMONS:  5 = vapour
KMONS:  6 = air elemental
KMONS:  7 = fire vortex
#
: if you.in_branch("elf") then
KMONS:  Z = col:flash deep elf sorcerer \
        name:deep_elf_elementalist n_rpl n_des \
        spells:iron_shot;summon_air_elementals;sticky_flame_range;\
        summon_water_elementals;haste;blink actual_spells \
        ; robe ego:fire_resistance race:elven | \
        robe ego:cold_resistance race:elven | \
        robe ego:resistance race:elven . dagger ego:freezing race:elven | \
        dagger ego:flaming race:elven | dagger ego:electrocution race:elven
: else
KMONS:  Z = col:flash wizard hd:15 name_descriptor \
        name:master_elementalist name_replace \
        spells:iron_shot;summon_air_elementals;sticky_flame_range;\
        summon_water_elementals;haste;blink actual_spells \
        ; robe ego:fire_resistance | robe ego:cold_resistance | \
        robe ego:resistance \
        . dagger ego:freezing | dagger ego:flaming | \
        dagger ego:electrocution
: end
KITEM:  B = randbook disc:air / randbook disc:fire / randbook disc:ice / \
            randbook disc:earth
KITEM:  | = staff of fire / staff of cold / staff of earth / staff of air / \
            quarterstaff unrand:elemental_staff
MAP
       ccccccccc
      ccE+'''cwcc
     ccEEc'''cwwcc
    ccEEEc'''cwwwcc
   ccEEEEc'''cwwwwcc
  ccEEEEEc'''cwwwwwcc
 ccEEEEEEc''Wcwwwwwwcc
ccEEEEEEEc'WW+wwwwwwwcc
cEEEEEEEEcccccwwwwwwwwc
ccccccc+ccB|Bcccccccc+c
c;;;;;;;c$...$c"""""""c
c;;;;;;;c$.Z.$c""?"?""c
c;;;;;;;c$...$c"""""""c
c+cccccccc...cc+ccccccc
c........c+++c........c
cc..!1.!1c...c.6..6..cc
 cc......c7.7c......cc
  cc.....c...c.....cc
   cc.1!.c.*.c.6..cc
    cc...c...c...cc
     cc..c.7.c..cc
      cc.c...+.cc
       c+ccccccc
        @
ENDMAP

##############################################################################
# Ancient Champions (by Mu., lua by due)
#
NAME:   ancient_champions_mu
DEPTH:  D:15-26, Vault:1-7, Crypt:1-4
ORIENT: float
TAGS:   no_item_gen no_monster_gen
KFEAT:  ABCDEFG = metal_wall
 ## This is for Gretell's benefit, not actually used.
 KMONS: Z = col:gold skeletal warrior name:ancient_champion name_replace \
 name_descriptor spells:iron_shot;.;haste;pain;.;. \
 spells:bolt_of_draining;.;haste;throw_frost;.;. \
 spells:venom_bolt;.;haste;haunt;.;. \
 spells:iskenderun's_mystic_blast;slow;haste;.;.;. actual_spells
KMONS:  1 = col:gold skeletal warrior name:ancient_champion name_replace \
        name_descriptor spells:iron_shot;.;haste;pain;.;. actual_spells \
        ; plate mail ego:fire_resistance | plate mail ego:cold_resistance . \
        great sword ego:pain | great sword ego:draining | great sword \
        ego:flaming | w:3 triple sword ego:vorpal
KMONS:  2 = col:gold skeletal warrior name:ancient_champion name_replace \
        name_descriptor spells:bolt_of_draining;.;haste;throw_frost;.;. \
        actual_spells ; plate mail ego:fire_resistance | plate mail \
        ego:cold_resistance . great mace ego:vorpal | great mace ego:draining
KMONS:  3 = col:gold skeletal warrior name:ancient_champion name_replace \
        name_descriptor spells:venom_bolt;.;haste;haunt;.;. actual_spells \
        ; plate mail ego:fire_resistance | plate mail ego:cold_resistance . \
        battleaxe ego:vorpal | battleaxe ego:pain | \
        w:3 executioner's axe ego:vorpal
KMONS:  4 = col:gold skeletal warrior name:ancient_champion name_replace \
        name_descriptor spells:iskenderun's_mystic_blast;slow;haste;.;.;. \
        actual_spells ; plate mail ego:fire_resistance | plate mail \
        ego:cold_resistance . great sword ego:pain | great sword ego:draining \
        | great sword ego:flaming | battleaxe ego:vorpal | battleaxe ego:pain \
        | triple sword ego:vorpal | executioner's axe ego:vorpal
SHUFFLE: 123
KPROP:  ]v.1234+ABCDEFG!n$wr|" = no_tele_into
KITEM:  w = acquire weapon
KITEM:  r = acquire armour
NSUBST: $ = 1:w / 1:r / 4:| / *:$
COLOUR: " = yellow
KFEAT:  " = .
{{

-- First off, slave marker magic.
lua_marker("A", portal_desc { skele_slave=1 })
lua_marker("B", portal_desc { skele_slave=2 })
lua_marker("C", portal_desc { skele_slave=3 })
lua_marker("D", portal_desc { skele_slave=4 })
lua_marker("E", portal_desc { skele_slave=5 })
lua_marker("F", portal_desc { skele_slave=6 })
lua_marker("G", portal_desc { skele_slave=7 })

local skele_death_marker = TriggerableFunction:new {
  func="callback.ancient_champions_mu_skele_death",
  repeated=true,
  data={skele_number=0} }

skele_death_marker:add_triggerer(DgnTriggerer:new {
  type="monster_dies",
  target="ancient champion" })

lua_marker("]", skele_death_marker)
}}

MAP
vvvvvvvvvvvvvvvvvvv
v..".1v.."..v.."..v
v.""".v.""".v.""".v
v"""""C"""""B"""""v
v.""".v.""".v.""".v
v.."..v..".3v..".2v
vvvDvvvvvvvvvvvAvvv
v..".2v$$$$$v.."..v
v.""".v$$$$$v.""".v
v"""""v$$.$$v"""""v
v.""".v$$.$$v.""".v
v.."..v$...$v1."..v
vvvEvvvvvGvvvvv+vvv
v3."..v.."..v.."..v
v.""".v.""".v.""".v
v"""""F"""""v""]""v
v.""".v.""".v.""".v
v.."..v4."..v.."..v
vvvvvvvvvvvvvvvvvvv
ENDMAP

# Guardian serpents guard a snake-like passage. (nrook)
NAME:    guardian_serpent_snake_passage
ORIENT:  float
DEPTH:   D:9-27
TAGS:    no_monster_gen no_rotate
MONS:    patrolling guardian serpent
SHUFFLE: yY/zZ
SUBST:   y=., Y==, Z=x, z=b
COLOUR:  *. = lightgreen
SUBST:   ' = .
MAP
            xxxxxxxxxxxxxxx
            xxxxbbbbbbbbxxx'
            xxbbb..*...bbbx'
            xbb...bbbb...yY1
            xb..bbbbbbbbbbx@
            xb.bbxxxxxxxxxx'
            xb..bbbbxx
            xbb.*..bbx
            xxbbbb..bx
 xxxxxxxxxxxxxxxxbb.bx
'xbbbbxxxxxxxxxxxbb.bx
1Zz..bbbxxxxxxxbbb..bx
@xbb...bbbbbbbbb.*.bbx
'xxbbb...*.......bbbxx
 xxxxbbbbbbbbbbbbbxxxx
ENDMAP

##############################################################################
# Shantytown, noun: An area containing a collection of shacks,
#                   shanties or makeshift dwellings. By Core Xii
NAME:   corexii_shantytown
DEPTH:  D:4-13
ORIENT: float
TAGS:   no_monster_gen no_item_gen
NSUBST: + = 1:+ / *:=
SUBST:  = = + x:100
NSUBST: A = 1:+ / *:x, B = 1:+ / *:x, C = 1:+ / *:x, D = 1:+ / *:x
NSUBST: E = 1:+ / *:x, F = 1:+ / *:x, G = 1:+ / *:x, H = 1:+ / *:x
NSUBST: I = 1:+ / *:x, J = 1:+ / *:x, K = 1:+ / *:x, L = 1:+ / *:x
NSUBST: M = 1:+ / *:x, N = 1:+ / *:x, O = 1:+ / *:x, P = 1:+ / *:x
NSUBST: Q = 1:+ / *:x, R = 1:+ / *:x, S = 1:+ / *:x, T = 1:+ / *:x
NSUBST: U = 1:+ / *:x, V = 1:+ / *:x
# There are 111 - glyphs, which leads to about 27 monsters
SUBST:  - = 2:20 d .:50
ITEM:   any food / any weapon / any missile / w:5 any armour / \
        w:5 any potion / w:5 any scroll, w:1 any misc
MONS:   plant / w:40 nothing, goblin / hobgoblin / kobold / orc / w:5 gnoll
MAP
.......................
..1..x++x..1..x+++++x..
.1x++x--x++x++x-----+..
..+--A--B--C--E-----+..
..+--A--B--C--E-----+..
.1xxAxxBxCCx--xEExEExx.
..1+--R....xDDx..F---+.
..1+--R..........F---+.
.1xxRxx.xSSSxTTx.xFx+x.
..+--Q..S---T--T...+1..
..+--Q..S---T--T...+1..
.xxPxx.xxSSxxTxx.xGxx1.
.+--P..V---U--U..G--+..
.+--P..V---U--U..G--+..
.xxOxx.V---xUUx..xHHxx.
..+--O.xVVVx.....H---+.
..+--O........xJJx---+.
.xxNNxMMx..xKKx--xIIxx.
.+---N--xLLx--J--I--+..
.+---N--M--L--x++x--+..
.x+++x++x--L--+11+--+..
.1...1..x++x++x..x++x1.
.......................
ENDMAP

# Cluster of small buildings with basic monsters and loot, by Core Xii
NAME:   corexii_shack_village
DEPTH:  D:3-9
ORIENT: float
TAGS:   no_monster_gen no_item_gen
NSUBST: A = 1:+ / *:x, B = 1:+ / *:x, C = 1:+ / *:x, D = 1:+ / *:x
NSUBST: E = 1:+ / *:x, F = 1:+ / *:x, G = 1:+ / *:x, H = 1:+ / *:x
# 39 - glyphs, leading to about 10 monsters.
SUBST:  - = 2:20 d .:50
SUBST:  T = T:50 V G 1 .:20
ITEM:   any food / any weapon / any missile / w:5 any armour / w:5 any potion
MONS:   plant / w:40 nothing, goblin / hobgoblin / kobold / orc
MAP
....................
.1xAAx1.xxxxx111111.
.1x--x1.B---xxxxxxx.
.1x--x1.B---C--D--x.
.1xAAx1.xBBBx--D--x.
............xCCxDDx.
..........T.........
.11.xFFFx...........
.xEEx---xGGx1.xHHx1.
.x--E---G--x1.H--x1.
.x--E---G--x1.H--x1.
.xxxxxxxxxxx1.xxxx1.
....................
ENDMAP

# Ice Spiral I (Lemuel)
#
# There is a path to the center that the freezing clouds never appear on.
# It's pretty obvious. -LP
NAME:    ice_spiral
WEIGHT:  1
ORIENT:  float
TAGS:    no_item_gen no_monster_gen
MONS:    ice beast / nothing
ITEM:    nothing, nothing
SHUFFLE: 1ef
SUBST:   + : +=
SUBST:   * : *$
SUBST:   * = ***.|
MARKER:  1 = lua:fog_machine { cloud_type = "freezing vapour", \
             pow_min = 2, pow_max = 4, delay = 17, start_clouds = 1, \
             size = 2, walk_dist = 0, spread_rate= 0 }
MARKER:  e = lua:fog_machine { cloud_type = "freezing vapour", \
             pow_min = 2, pow_max = 4, delay = 19, start_clouds = 1, \
             size = 2, walk_dist = 0, spread_rate= 0 }
MARKER:  f = lua:fog_machine { cloud_type = "freezing vapour", \
             pow_min = 2, pow_max = 4, delay = 23, start_clouds = 1, \
             size = 2, walk_dist = 0, spread_rate= 0 }
MARKER:  G = lua:props_marker { stop_explore = "a frost-covered granite \
             statue.", feature_description = "frost-covered granite statue" }
MAP
mG++Gmmmmmmmmmmmmmmmmmm
m......f..1..1...e...fm
m....1...f..e..f...1..m
m......e..............m
m....f...............em
m......1..............m
m....1.....e.1.f......m
m...........f.e.1....1m
m......e..............m
m....e......***.......m
m......1....***.f....fm
m.....................m
m....f1..e1.f..1e.....m
m....................em
m.....................m
m.....................m
m....................1m
mf..1..e..f..e..f..e..m
mmmmmmmmmmmmmmmmmmmmmmm
ENDMAP

# Ice Spiral II (Lemuel)
#
# Wait for the freezing cloud to disappear, then run to the next gap,
# then wait. It creates an agreeable sense of tension. -LP
NAME:    ice_spiral_2
ORIENT:  float
DEPTH:   D:5-27, Vault
TAGS:    no_item_gen uniq_spiral layout_rooms layout_city
MONS:    nothing
ITEM:    nothing, nothing
SHUFFLE: Bb/Mm/Mm/Mm
COLOUR:  B = blue
SUBST:   M=. , m=n, B=. , b=c
SUBST:   + : +=
SUBST:   * : *$
MARKER:  1 = lua:fog_machine { cloud_type = "freezing vapour", \
              pow_min = 5, pow_max = 5, delay = 120, start_clouds = 1, \
              size = 2, walk_dist = 0, spread_rate= 0 }
MARKER:  e = lua:fog_machine { cloud_type = "freezing vapour", \
              pow_min = 9, pow_max = 9, delay = 200, start_clouds = 1, \
              size = 2, walk_dist = 0, spread_rate= 0 }
MARKER:  G = lua:props_marker { stop_explore = "a frost-covered granite \
             statue.", feature_desc = "A frost-covered granite statue." }
MAP
mG+Gmmmmmmmmmmmmmmmmm
mBBB111B111BeeeeeeeBm
mmmmmmmmmmmmmmmmmmmBm
m*****eeeeeee111B111m
mmmmmmmmmmmmmmmmmmmmm
ENDMAP

NAME:   Flame_loot_2_lemuel
DEPTH:  D:9-27
ORIENT: float
ITEM:   nothing
SUBST:  * = |**...
SUBST:  * : *$
SUBST:  L = ll.
MONS:   molten gargoyle / fire drake / lindwurm / nothing w:20
MARKER: d = lua:fog_machine { cloud_type = "flame", \
             pow_min = 10, pow_max = 10, delay = 10, \
             size = 2, walk_dist = 0, spread_rate= 0 }
MAP
ccccc...ccccc
ccccc...ccccc
ccccc...ccccc
ccccc.d.ccccc
ccccc...ccccc
ccccc...ccccc
ccccc.d.ccccc
ccccc...ccccc
ccccc...ccccc
ccccc...ccccc
c...LLlLL...c
c..LLlllLL..c
c.LLll*llLL.c
cLLll***llLLc
cLll**1**llLc
cLlll***lllLc
cLLlll*lllLLc
c.LLlllllLL.c
c..LLlllLL..c
ccccccccccccc
ENDMAP

NAME:    lemuel_firewalk_3
DEPTH:   D:16-27
TAGS:    uniq_firewalk abyss ruin_abyss
WEIGHT:  2
ORIENT:  float
ITEM:    nothing, nothing, nothing
SHUFFLE: def
MARKER:  d = lua:fog_machine { cloud_type = "flame", \
             pow_min = 2, pow_max = 4, delay = 39, start_clouds = 1, \
             size = 2, walk_dist = 2, spread_rate= 0 }
MARKER:  e = lua:fog_machine { cloud_type = "flame", \
             pow_min = 2, pow_max = 6, delay = 59, start_clouds = 1, \
             size = 2, walk_dist = 2, spread_rate= 0 }
MARKER:  f = lua:fog_machine { cloud_type = "flame", \
             pow_min = 2, pow_max = 8, delay = 79, start_clouds = 1, \
             size = 2, walk_dist = 2, spread_rate= 0 }
MARKER: G = lua:props_marker { stop_explore = "a scorch-marked granite statue."\
        , feature_description = "scorch-marked granite statue" }
MAP
xxxxxxxG@Gxxxxxxx
x...............x
x...............x
x.d..e.....f..d.x
x...............x
x...............x
x...............x
x.e..f.....d..e.x
x...............x
x...............x
x...............x
x.f..d.....e..f.x
x...............x
x...............x
x...............x
x.d..e.....f..d.x
x...............x
x...............x
x......$$$......x
x.e.f..$$$..d.e.x
x......$$$......x
xxxxxxxxxxxxxxxxx
ENDMAP

#############################################################################
# The Elephants' Graveyard (by Mu.)
#
NAME:   elephants_graveyard_mu
ORIENT: float
TAGS:   no_monster_gen no_rotate no_vmirror
DEPTH:  D:13-26, Lair:1-7

  # next: we generate more dire elephants at greater depths
  # we also turn the shallow water into deep water at the lowest depths,
  # just in case elephants are ever allowed to drown the unwary
: if you.absdepth() < 18 then
MONS:   elephant, fungus, plant
: elseif you.absdepth() < 22 then
MONS:   elephant / dire elephant, fungus, plant
: else
MONS:   w:1 elephant / dire elephant, fungus, plant
SUBST: W : w
:end

: dgn.delayed_decay(_G, '%', 'w:1 elephant corpse / w:5 elephant skeleton / nothing')
SUBST:  . = .:69 1:1
SUBST:  P = 3
SUBST:  a = .2
SUBST:  b = 23
SUBST:  c = 3tt

MAP
............................
............................
............................
............................
........tttttttttttt........
......tttccccccccccttt......
.....ttcccbbbbbbbbccctt.....
....ttccbbbaaaaaabbbcctt....
....tccbbaaa...1aaabbcct....
...ttcbbaa...%%...aabbctt...
..ttccbaa..%%%%%%..aabcctt..
..tccbba..%%%%%%%%..abbcct..
..tcbbaa.%%.PPP%%%%.aabbct..
..tcbaa..%%.PWPP%%%..aabct..
..tcba1.%%%11WPP%%%%..abct..
..tcba.%%%%11WWP%%%%%.abct..
..tcba.%%%%.WWWP%%%%%.abct..
..tcba..%%%.WWWP%%%%1.abct..
..tcbaa.1%%..WWP.%%..aabct..
..tcbbaa.%%%..WP.%%.aabbct..
..tccbba..%%%.WW....abbcct..
..ttccbaa......WW..aabcctt..
...ttcbbaa......W.aabbctt...
....tccbbaaaa..aaaabbcct....
....ttccbbbba..abbbbcctt....
.....ttccccca..accccctt.....
......tttttta..atttttt......
............................
............1..1............
............................
.............@@.............
ENDMAP

NAME: megacathedral
ORIENT: float
DEPTH: D:8-14
MONS: wraith / freezing wraith w:2
MONS: eidolon
TAGS: no_rotate no_vmirror no_hmirror
NSUBST: C = 5:C / *:.
SUBST: X = C
SUBST: D = V..
MARKER: = = lua:restrict_door()
{{
local cathedral_bats = TriggerableFunction:new {
    func = "callback.cathedral_bats",
    repeated = true,
    data = {bat_count=0},
}

cathedral_bats:add_triggerer(DgnTriggerer:new {
    type="turn",
    delay_min=500,
    delay_max=800
})

lua_marker('C', cathedral_bats)
lua_marker('V', cathedral_bats)
}}
MAP
             cccc.cccc
          ccccccG.Gcccccc
         ccc...cc+cc1..ccc
      ccccc..C..c.c..D..ccccc
     ccc.ccc...cc.cc...ccc.ccc
     cc1..ccc+cc...cc=ccc...cc
  ccccc.D.ccc.........ccc.C.ccccc
 cccccc...=c..ccc+ccc..c+...cccccc
 cc...cc.cc..ccc...ccc..cc.cc..1cc
cc.....ccc..cc.......cc..ccc.....cc
cc..C...+....+...X...+....=...D..cc
cc.....ccc..cc.......cc..ccc.....cc
 cc...cc.cc..ccc...ccc..cc.cc...cc
 cccccc...=c..ccc+ccc..c+...cccccc
  ccccc.D.ccc.........ccc.C.ccccc
     cc1..ccc=ccG.Gcc+ccc...cc
     ccc.ccc...cc=cc...ccc.ccc
      ccccc..D..c.c..C..ccccc
         ccc..1cc2cc...ccc
          cccccc|||cccccc
             ccccccccc
ENDMAP
