###############################################################################
# overflow.des: This is the place where vaults containing overflow altars go.
#
# Altar vaults do not just provide flavour. They are crucial for ensuring
# that granted gods without altars in the Temple will be present in the
# early part of the dungeon. Such altars are called "overflow temples".
# Sometimes, ordinary altar maps featuring a single C glyph (random altar)
# are used. However, there are also vaults dedicated to a special god.
# These look much more interesting, of course.
#
# The following "standard_overflow_setup(_G)" is to be always used for specified
# gods and single-altar generic vaults, to properly and conistently apply:
#
# TAGS: temple_overflow_# temple_overflow_[god]
#       Says the map will be used for overflow temples to only # number of
#       specified gods.
# TAGS: temple_overflow_generic_1
#       For generic Allows any of the overflow temple altars to be used.
#       For this, use one B glyph in your map.
# TAGS: buniq_altar_[god]
#       This allows the map to be placed randomly, and also adds a limit to
#       place a vault themed after that one god only once per branch. Random
#       placement occurs only after the deepest possible overflow depth- D:10.
#       (This tag _does not_ place for multiple altar or generic altar vaults.)
# TAGS: extra_post_overflow
#       This relies on the boolean parameter at the end of the function call,
#       and will tag vaults as not using a minivault slot past D:10. Pass this
#       as "true" by default, and only use "false" for fighting multiple scaling
#       monsters.
#
# A purely decorative vault for Trog, with the altar on '_', would use the line:
# : standard_overflow_setup(_G, { { "trog", "_" } }, true)
# A vault to Sif Muna containing scaling monsters would use the line:
# : standard_overflow_setup(_G, { { "sif_muna", "_" } }, false)
# A decorative vault to both Zin and Gozag would use the line:
# : standard_overflow_setup(_G, { { "gozag", "A" }, { "zin", "B" } }, true)
#
# Vaults for one specific god should use _ for their altar glyph, while generic
# vaults should use a number of Bs matching the tagged overflow count to access
# a random needed overflow altar instead.
#
# If you want to check overflow temple placement in wizard mode, use the &:
# command. The levels overflow temples are placed on, and which gods are
# in them, are chosen at new-game time.
#
###############################################################################

: crawl_require('dlua/vault.lua')

{{
function standard_overflow_setup(e, gods, extra)
  if gods[1][1] == "generic" then
    e.tags('temple_overflow_generic_1')
  else
    e.tags('temple_overflow_' .. #(gods))
    if #(gods) == 1 then
      e.tags('buniq_altar_' .. gods[1][1])
    end
    for i, j in pairs(gods) do
      e.tags('temple_overflow_' .. gods[i][1])
      e.kfeat(gods[i][2] .. " = altar_" .. gods[i][1])
    end
  end
  if extra then
    e.tags('extra_post_overflow')
  end
end

function get_overflow_altar_count(e)
  local params = dgn.map_parameters()
  if params ~= nil then
    local tag = table.unpack(params)
    if tag ~= nil then
      -- temple_overflow_generic_ is 24 characters
      local result = string.sub(tag, 25)
      if result ~= "" then return result end
    end
  end

  return nil
end

function callback.vampire_church_blood(data, triggerable, triggerer, marker, ev)
  local replicas = dgn.find_marker_positions_by_prop("replica_name", "vampire_church_blood")
  crawl.god_speaks("Kikubaaqudgha", "As you approach the altar, the fountains"
                                 .. " begin to flow with blood!")
  for i, replica in ipairs(replicas) do
    dgn.terrain_changed(replica.x, replica.y, "fountain_blood", false)
  end
end

function callback.hep_ancestral_shrine_los(data, triggerable, triggerer, marker, ev)
  if not dgn.persist.hep_ancestral_shrine_reborn and you.god() == "Hepliaklqana" then
    local trees = dgn.find_marker_positions_by_prop("dead_tree", 1)
    -- FIXME: this doesn't change the tree tile back to living trees!
    for i, replica in ipairs(trees) do
      dgn.tile_feat_changed(replica.x, replica.y, "DNGN_TREE")
    end
    dgn.reset_feature_name_for(trees[1].x, trees[1].y, "tree")
    local slime = dgn.find_marker_positions_by_prop("green_water", 1)
    for i, replica in ipairs(slime) do
      dgn.colour_at(replica.x, replica.y, "blue")
    end
    crawl.god_speaks("Hepliaklqana", "Let the past return from memory!")
    dgn.persist.hep_ancestral_shrine_reborn = true
  end
end

function callback.xom_greatest_gift(data, triggerable, triggerer, marker, ev)
  if not dgn.persist.xom_gg_heard and you.god() == "Xom" then
    dgn.persist.xom_gg_heard = true
    dgn.persist.xom_gg_granted = true
  elseif not dgn.persist.xom_gg_heard and you.god() ~= "Xom" then
    crawl.god_speaks("Xom", '"WORSHIP ME, MORTAL," Xom booms, "AND I SHALL'
                            .. ' GRANT YOU THE GREATEST GIFT OF ALL."')
    dgn.persist.xom_gg_heard = true
  elseif not dgn.persist.xom_gg_granted and you.god() == "Xom" then
    local pos = dgn.find_marker_positions_by_prop("gift", "altar")
    local gob = "generate_awake att:good_neutral goblin perm_ench:might " ..
                "perm_ench:haste perm_ench:invis perm_ench:repel_missiles " ..
                "perm_ench:resistant perm_ench:regen perm_ench:magic_res " ..
                "perm_ench:doubled_vigour perm_ench:mirror_dam perm_ench:swift"
    dgn.create_monster(pos[1].x, pos[1].y, gob)
    crawl.god_speaks("Xom", 'A goblin pops into existence! It looks at you'
                     .. ' with admiration.')
    crawl.god_speaks("Xom", '"Friendship. The greatest gift is friendship!"')

    dgn.persist.xom_gg_granted = true
  end
end

function callback.five_deadly_venoms(data, triggerable, triggerer, marker, ev)
  crawl.god_speaks("Wu Jian", "For a moment, you catch a glimpse of warriors who walked this path long ago.")
  local positions = dgn.find_marker_positions_by_prop(
    "positions", "five_deadly_venoms")
  for i, pos in ipairs(positions) do
    local x, y = pos:xy()
    dgn.create_monster(x, y, "generate_awake dur:1 " .. data.venoms[i])
  end
end

function species_mock(e)
  if you.race() == "Armataur" then
    return "rat"
  elseif you.race() == "Barachi" then
    return "cane toad"
  elseif you.race() == "Coglin" then
    return "hobgoblin draugr"
  elseif you.race() == "Demigod" then
    return "titan simulacrum"
  elseif you.race() == "Demonspawn" then
    return "sin beast"
  elseif you.race() == "Djinni" then
    return "crimson imp"
  elseif you.race():find("Draconian") then
    return "wyvern"
  elseif you.race() == "Deep Elf" then
    return "will-o-the-wisp"
  elseif you.race() == "Gnoll" then
    return "jackal"
  elseif you.race() == "Mountain Dwarf" then
    return "goblin ; mundane hand axe . mundane ring mail"
  elseif you.race() == "Human" then
    return "killer klown"
  elseif you.race() == "Felid" then
    return "sphinx marauder zombie"
  elseif you.race() == "Formicid" then
    return "clockroach"
  elseif you.race() == "Gargoyle" then
    return "rockslime"
  elseif you.race() == "Kobold" then
    return "boggart"
  elseif you.race() == "Merfolk" then
    return "bullfrog"
  elseif you.race() == "Minotaur" then
    return "yak"
  elseif you.race() == "Mummy" then
    return "human zombie"
  elseif you.race() == "Naga" then
    return "torpor snail"
  elseif you.race() == "Octopode" then
    return "tentacled monstrosity"
  elseif you.race() == "Oni" then
    return "ogre"
  elseif you.race() == "Poltergeist" then
    return "dancing weapon ; mundane dagger plus:-9"
  elseif you.race() == "Revenant" then
    return "ugly thing draugr"
  elseif you.race() == "Spriggan" then
    return "unseen horror"
  elseif you.race() == "Tengu" then
    return "caustic shrike"
  elseif you.race() == "Troll" then
    return "ugly thing"
  elseif you.race() == "Vine Stalker" then
    return "thorn hunter"
  else
    return "spectral ugly thing"
  end
end

function callback.do_species_mock(data, triggerable, triggerer, marker, ev)
  if data.seen then return else data.seen = true end
  local positions = dgn.find_marker_positions_by_prop("mock_location", 1)
  local sp = species_mock()
  if you.race() == "Poltergeist" then
    sp = "dancing weapon"
  elseif you.race() == "Mountain Dwarf" then
    sp = "goblin"
  end
  crawl.god_speaks("Xom", '"I found one of your ancestors!"')
  for i, pos in ipairs(positions) do
    local x, y = pos:xy()
    dgn.create_monster(x, y, "generate_awake " .. species_mock())
  end
  crawl.mpr("A " .. sp .. " emerges from the mists of... memory?....")
end
}}

default-depth: D:3-, Depths

# These must feature one of the temple_overflow_* TAGs (see header).
# Altars are sorted alphabetically by god, with the Shining One coming
# after Zin. At the end, there are altar vaults which can be used for
# more than just one god.

### Ashenzari overflow altars #################################################

NAME:   ashenzari_altar_1
TAGS:   transparent decor
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
b@b
@_@
b@b
ENDMAP

# A ruined temple
NAME:   evilmike_ruin_ashenzari
TAGS:   transparent decor lairdec
DEPTH:  D:3-, Lair
SUBST:  x = xxxxx-, - = ----.
FTILE:  -V_ = FLOOR_SANDSTONE
TILE:   x = WALL_BRICK_VINES
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
      .......
      .xx+xx.
     ..x---x..
   ....x---x....
   .xxxx---xxxx.
  ..xV-xx+xx-Vx..
....x---------x....
.xxxxx-------xxxxx.
.x---x-------x---x.
.x---+---_---+---x.
.x---x-------x---x.
.xxxxx-------xxxxx.
....x---------x....
  ..xV-xx+xx-Vx..
   .xxxx---xxxx.
   ....x---x....
     ..x---x..
      .xxxxx.
      .......
ENDMAP

NAME:   ashenzari_conservatory_becter
TAGS:   transparent decor no_descent
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
   .....
 .........
 .........
....mmm....
....m_m....
....c+c....
xxxxx.xxxxx
     @
ENDMAP

NAME:  cheibrodos_ashenzari_chains
TAGS:  transparent decor
KFEAT: m = iron_grate
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
.............
.mmm.....mmm.
.mcmmc_cmmcm.
.mmm.....mmm.
.............
ENDMAP

NAME:    nicolae_ashenzari_panopticon
TAGS:    transparent decor vaults_empty
DEPTH:   D:3-, Vaults, !Vaults:$, Depths
WEIGHT:  3 (Vaults), 10
SHUFFLE: ABCDEF/abcdef
SUBST:   ACEbdf = x, Ba = m, Dc = ., Fe = @
: if you.in_branch("Vaults") then
KFEAT:   m = closed_clear_door
: else
NSUBST:  m = + / m
: end
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
E....F..E..F...CE
CC...D..C..D..CC.
.CC..DD.C.DD.CC..
..CC..D.C.D.CC...
...CC.DDCDDCC....
FDD.CC.DCDCC..DDF
..DDDCABABA.DDD..
....DDB...BDD....
ECCCCCA._.ACCCCCE
....DDB...BDD....
..DDD.ABABACDDD..
FDD..CCDCD.CC.DDF
....CCDDCDD.CC...
...CC.D.C.D..CC..
..CC.DD.C.DD..CC.
.CC..D..C..D...CC
EC...F..E..F....E
ENDMAP

NAME:   nicolae_ashenzari_skybound
TAGS:   transparent decor
COLOUR: m = blue
: standard_overflow_setup(_G, { {"ashenzari", "_"} },  true)
MAP
    ..@..
   .......
 ...mmmmm...
..mmm...mmm..
.mm.v._.v.mm.
.m..v...v..m.
mm..vv+vv..mm
m...........m
m    .@.    m
ENDMAP

NAME:  nicolae_ashenzari_church_of_fetters
TAGS:  transparent decor
KFEAT: M = iron_grate
KMASK: ` = opaque
KMASK: ` = no_trap_gen
KMASK: ` = no_item_gen
KMASK: ` = no_monster_gen
KPROP: ` = no_tele_into
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
  vvv....
 vv`vv...@
.M```vMM...
.vv`vv.MM..
..vvv...MM.
@....._..M.
..vvv...MM.
.vv`vv.MM..
.M```vMM...
 vv`vv...@
  vvv....
ENDMAP

NAME:   nicolae_ashenzari_crystal_shattered
TAGS:   transparent decor
WEIGHT: 7
# Couldn't get the subvaulting working, so it's time for a zillion (20) glyphs.
: local glifz = "DEFHJKLMNOPQRSZapqrs"
: for i = 1, string.len(glifz), 1 do
:    nsubst(string.sub(glifz, i, i) .. " = b / .")
: end
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
     .....
    ...b...
   ...sbDD..
  ...s.EF.H..
 ..rrbEEFHH...
..a.r..bb.bJ...
..aqqb....L.J..
.bbppb._.bLLbb.
..Z.p....bMMK..
...Zb.bb..N.K..
 ...SSRQQbNN..
  ..S.RQ.O...
   ..PPbO...
    ...b...
     .....
ENDMAP

# "[U]sing a glass+metal motif for Ashenzari, with the glass (blue, see-through)
# representing the sky to which [T]hey are bound, and the metal (metal)
# representing whatever it is binding [T]hem (fetters, bars, nails, etc., I
# assume there are schisms about the specific theological details)."
NAME: nicolae_ashenzari_skychains
TAGS: transparent decor
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
.....   .....
.nnn.....nnn.
.nvn.....nvn.
.nnv.....vnn.
....v...v....
 ....v.v....
 ....._.....
 ....v.v....
....v...v....
.nnv.....vnn.
.nvn.....nvn.
.nnn.....nnn.
.....   .....
ENDMAP

NAME:   nicolae_ashenzari_temple_of_vision
TAGS:   transparent decor
KFEAT:  + = closed_clear_door
NSUBST: + = + / m
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
  .......
 ...mmm...
...........
..mmmmmmm..
...m...m...
.m.+._.m.m.
...m...m...
..mmm+mmm..
...........
 ...mmm...
  .......
ENDMAP

NAME: nicolae_ashenzari_tiny_skybox
TAGS: transparent decor
: if crawl.coinflip() then
SUBST:   Q = P, q = p
: end
SHUFFLE: Pp
SUBST:   P = v, p : n., Qq = .
: standard_overflow_setup(_G, { { "ashenzari",  "_" } },  true)
MAP
.......
.nn.nn.
.nv.vn.
.Pp_pP.
.nvqvn.
.nnQnn.
.......
ENDMAP

### Cheibriados overflow altars ###############################################

NAME:   cheibriados_altar_2
TAGS:   transparent decor buniq_s_overflow_glass
WEIGHT: 1
MONS:   torpor snail
KPROP:  1 = no_tele_into
KMASK:  1 = opaque
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
.......
.mmm...
.m1m...
.mmmmm.
.._m1m.
.mmmmm.
.m1m...
.mmm...
.......
ENDMAP

NAME:  slow_altar_1
TAGS:  patrolling no_monster_gen no_item_gen transparent
DEPTH: D:3-11, Snake, Depths
: if you.in_branch("Depths") then
KMONS: _ = iron dragon
: elseif you.in_branch("Snake") then
KMONS: _ = naga sharpshooter
: else
KMONS: _ = ribbon worm / bombardier beetle
SUBST: v : vx
: end
SUBST: x : xxxcccmnvb
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
xxx..@..xxx
xxx.....xxx
xxv.....vxx
...........
...........
@...._....@
...........
...........
xxv.....vxx
xxx.....xxx
xxx..@..xxx
ENDMAP

NAME:    slow_altar_2
TAGS:    patrolling no_monster_gen no_item_gen transparent
DEPTH:   D:3-11, Snake, Depths
: if you.in_branch("Depths") then
KMONS: _ = iron dragon
: elseif you.in_branch("Snake") then
KMONS: _ = naga sharpshooter
: else
KMONS: _ = ribbon worm / bombardier beetle
SUBST: v : vx
: end
SUBST:   x : xxxcccvb
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
x@@G@@x
x.....x
x.....x
xx+++xx
x.....x
x.....x
x.....x
x.....x
x.._..x
xxxxxxx
ENDMAP

NAME:   chei_slow_surprise
TAGS:   transparent no_monster_gen
DEPTH:  D:3-11, Depths
WEIGHT: 5
: if you.in_branch("Depths") then
KMONS: _ = iron dragon
:else
KMONS: _ = ribbon worm / bombardier beetle
:end
NSUBST: ' = 1:a / *:.
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
 ........
..xxxxxx..
.xx''''xx.
.x'xxxx'x.
.x'm.<x'x.
.xx+._x'x.
..xxxxx'x.
.x.....xx.
.xxxxxxx..
.........
ENDMAP

NAME:   cheibrodos_worm_habitat
TAGS:   no_item_gen no_monster_gen transparent
DEPTH:  D:3-
WEIGHT: 5
MONS:   ribbon worm
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
.............
.xxxxx.xxxxx.
.xTWWxxxWWTx.
.xWWWWWWWWWx.
.xWWWxWxWWWx.
.xxWxx.xxWxx.
..xWm._.mWx..
.xxWxx1xxWxx.
.xWWWxmxWWWx.
.xWWWWWWWWWx.
.xTWWx+xWWTx.
.xxxxx.xxxxx.
......@......
ENDMAP

NAME:   kennysheep_slug_shrine
TAGS:   transparent no_pool_fixup no_monster_gen
DEPTH:  D:3-11
MONS:   patrolling dart slug
KMASK:  1 = opaque
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
  .WWW
 .WwwwWbb
@.Ww1WW_b
 .WwwwWbb
  .WWW
ENDMAP

NAME:   nicolae_cheibriados_dopplering
TAGS:   decor transparent
DEPTH:  D:3-
KFEAT:  pqr = c
COLOUR: p = white
# XXX: Not super obvious in tiles. Still need more overflow altar tiles....
COLOUR: q = lightred
COLOUR: r = red
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
                   rrrrrrr
.............................................
.p.p.p.q..q...q....r.....r....q...q..q.p.p.p.
@p.p.p.q..q...q....r.._..r....q...q..q.p.p.p@
.p.p.p.q..q...q....r.....r....q...q..q.p.p.p.
.............................................
                   rrrrrrr
ENDMAP

NAME:   nicolae_cheibriados_redshifting
TAGS:   transparent decor
KFEAT:  pqrsz = c
KFEAT:  PQRSZ = n
# XXX: This is awkward in console with no lightyellow, unless we had
#      different glyph defaults entirely for opaque versus transparent terrain.
COLOUR: P = lightblue
COLOUR: Pp = blue
COLOUR: Q = lightgreen
COLOUR: q = green
COLOUR: Rr = yellow
COLOUR: Ss = brown
COLOUR: Z = lightred
COLOUR: z = red
TILE:   P = dngn_transparent_stone_blue, Q = dngn_transparent_stone_green, \
        R = dngn_transparent_stone_yellow, S = dngn_transparent_stone_brown, \
        Z = dngn_transparent_stone_red
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
  .......................
 ppPppqqQqqrrRrrssSsszzZzz
.P...PQ...QR...RS...SZ...Z.
......................._.z.
.P...PQ...QR...RS...SZ...Z.
 ppPppqqQqqrrRrrssSsszzZzz
  .......................
ENDMAP

NAME:   nicolae_cheibriados_the_sands_of_time
TAGS:   transparent decor
COLOUR: ` = brown
FTILE:  ` = floor_sand
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
 ccc+ccc
.n`````n.
.nn```nn.
..nn.nn..
@..n_n..@
..nn.nn..
.nn```nn.
.n`````n.
 ccc+ccc
ENDMAP

NAME:  nicolae_cheibriados_time_spiral
TAGS:  transparent decor
SUBST: c : ccvvb
: standard_overflow_setup(_G, { { "cheibriados",  "_" } },  true)
MAP
   ......
  ..cccc.
 ..c.......
..c..ccccc..
.c..c.....c..
.c.c..ccc..c.
.c.c.c...c.c.
.c.c.c_c.c.c.
.c.c..c..c.c.
.c..c...c..c.
..c..ccc..c..
 ..c.....c..
  ..ccccc..
   .......
ENDMAP

### Dithmenos overflow altars ################################################

NAME:   grunt_dithmenos_smoke
TAGS:   transparent decor
MARKER: _ = lua:fog_machine { cloud_type = "black smoke", \
                              pow_min = 10, pow_max = 20, \
                              delay = 100, size = 1, walk_dist = 1 }
: standard_overflow_setup(_G, { { "dithmenos",  "_" } },  true)
MAP
...
._.
...
ENDMAP

# Reflect upon the darkness, mortal.
NAME:   grunt_dithmenos_smoke_and_mirrors
TAGS:   transparent decor
MARKER: F = lua:fog_machine { cloud_type = "black smoke", \
                              pow_min = 25, pow_max = 25, \
                              delay = 30, size = 1, walk_dist = 0 }
TILE:   b = dngn_crystal_darkgray
: standard_overflow_setup(_G, { { "dithmenos",  "_" } },  true)
MAP
  b@b
 b.F.b
b.b.b.b
@F._.F@
b.b.b.b
 b.F.b
  b@b
ENDMAP

NAME:  grunt_dithmenos_shadows
DEPTH: D:5-
{{
  if you.absdepth() >= 9 then
     mons("shadowghast")
  else
     local i_weight = 9 - you.depth()
     if i_weight > 0 then
         local p_weight = 9 - i_weight
         mons("phantom w:" .. p_weight .. " / shadow imp w:" .. i_weight)
     else
         mons("shadow imp")
     end
  end
}}
: standard_overflow_setup(_G, { { "dithmenos",  "_" } },  true)
MAP
ccccc
c._.c
c.1.c
c...c
cc+cc
ENDMAP

NAME: nicolae_dithmenos_the_darkroom
TAGS: transparent decor
MARKER: ' = lua:fog_machine { cloud_type = "black smoke", pow_min = 30, \
   pow_max = 50, delay_min = 50, delay_max = 90, size = 1, walk_dist = 1, \
   spread_rate = 10 }
: standard_overflow_setup(_G, { { "dithmenos",  "_" } },  true)
MAP
xxxx@@@xxxx
xxx.....xxx
xx'.....'xx
x.........x
@.........@
@...._....@
@.........@
x.........x
xx'.....'xx
xxx.....xxx
xxxx@@@xxxx
ENDMAP

NAME: nicolae_dithmenos_shadow_blocks
TAGS: decor transparent
COLOUR: s' = magenta, c = white
TILE: c = dngn_stone_wall_white
TILE: s = dngn_stone_dark
FTILE: 's_ = floor_pebble_darkgray
KFEAT: cs = stone_wall
: standard_overflow_setup(_G, { { "dithmenos",  "_" } },  true)
MAP
      .....
      ..c..
  .....ccc.....
  .cc..scs..cc.
  .ccs''s''scc.
  ..ss'''''ss..
....'''''''''....
..cs'''''''''sc..
.cccs'''_'''sccc.
..cs'''''''''sc..
....'''''''''....
  ..ss'''''ss..
  .ccs''s''scc.
  .cc..scs..cc.
  .....ccc.....
      ..c..
      .....
ENDMAP

NAME: nicolae_dithmenos_through_a_glass_darkly
TAGS: decor transparent
COLOUR: x = magenta, m = lightmagenta
TILE: m = dngn_transparent_wall_darkgray
TILE: x = wall_brick_darkgray
: standard_overflow_setup(_G, { { "dithmenos",  "_" } },  true)
MAP
  ..xxx
 .....xx
...mm..xx
..mm....x
@.m._...x
..mm....x
...mm..xx
 .....xx
  ..xxx
ENDMAP

NAME:   nicolae_dithmenos_dark_matter_galaxy
TAGS:   transparent decor
COLOUR: x = magenta, ` = lightmagenta
FTILE:  `_x = floor_pebble_darkgray
TILE:   x = wall_pebble_darkgray
: standard_overflow_setup(_G, { { "dithmenos", "_" } }, true)
MAP
 ......
..xxx`..
@xx`xx`..
xx`x`xx`.
x`xxx`x`x
x`xx_xx`x
x`x`xxx`x
.`xx`x`xx
..`xx`xx@
 ..`xxx..
  ......
ENDMAP

# By standing on the altar, you can feel the shadows closing in...
NAME:   nicolae_dithmenos_not_quite_primordial_nightfall
TAGS:   decor transparent
COLOUR: x = magenta, m = lightmagenta
TILE:   m = dngn_transparent_wall_darkgray
TILE:   x = wall_brick_darkgray
: single_cloud(_G, "-", "black smoke", false)
: single_cloud(_G, "_", "black smoke", false)
: standard_overflow_setup(_G, { { "dithmenos", "_" } }, true)
MAP
...........
....xmx....
..mx...xm..
..x-----x..
.x.-----.x.
.m.--_--.m.
.x.-----.x.
..x-----x..
..mx...xm..
....xmx....
...........
ENDMAP

# Shadowy tendrils reach out to envelop the dying god of flame and put out the
# flickering light forever...
NAME:   nicolae_dithmenos_snuffed_out
TAGS:   transparent decor uniq_ignis_plus_one_overflow
WEIGHT: 1
KFEAT:  D = altar_ignis
NSUBST: p = ~ / `
SUBST:  ' = .`x, ~ = `x, q = .`
COLOUR: x = magenta, ` = lightmagenta, - = lightgray
FTILE:  `_x = floor_pebble_darkgray
FTILE:  -D = floor_rough_lightgray
TILE:   x : wall_pebble_darkgray
: standard_overflow_setup(_G, { { "dithmenos", "_" } }, true)
MAP
   xxxxxx
 xxxxx`xxx
 x```x``xxx
xx`_`xx`x`x
xx````x`~`xx
xxxx``p````x
x``xxp---~`x
xx````-D-xxx
xxxx~`---q'
 xx```~xq..
  xxx``x'.@
    xxxx
ENDMAP

### Elyvilon overflow altars ##################################################

NAME:   elyvilon_altar_1
TAGS:   transparent decor vaults_empty
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 1 (Vaults), 10
MONS:   plant, bush, fungus
KMONS:  4 = sacred lotus
KFEAT:  4 = W
SUBST:  X : T G t 1 2 3 4:30
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
: if you.in_branch("Vaults") then
CLEAR:  @x
: end
MAP
      xx@xx
      x...x
      x.X.x
      x...x
      xx.xx
       x.x
xxxxx xx.xx xxxxx
x...xxx...xxx...x
@.X....._.....X.@
x...xxx...xxx...x
xxxxx xx.xx xxxxx
       x.x
      xx.xx
      x...x
      x.X.x
      x...x
      xx@xx
ENDMAP

NAME:   elyvilon_altar_3
TAGS:   no_pool_fixup decor transparent
KMASK:  wW = no_monster_gen
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
: decorative_floor(_G, 'f', "flower patch")
MAP
       xxxxxxxxxxxxxxx
      xxtttttttttttttxx
      xtttttttttttttttx
      ttttttttptttttttt
  .....tttttf...fttttt.....
 .......ttt.......ttt.......
...wWw...t...wWw...t...wWw...
..wwWww.....wwWww.....wwWww..
@.WWtWW.....WW_WW.....WWtWW.@
..wwWww.....wwWww.....wwWww..
...wWw...t...wWw...t...wWw...
 .......ttt.......ttt.......
  .....tttttf...fttttt.....
      ttttttttptttttttt
      xtttttttttttttttx
      xxtttttttttttttxx
       xxxxxxxxxxxxxxx
ENDMAP

NAME:   elyvilon_altar_4
TAGS:   no_monster_gen transparent patrolling decor vaults_empty
TAGS:   buniq_s_overflow_holy_exhibit
DEPTH:  D:3-, Vaults, !Vaults:$
WEIGHT: 1 (Vaults), 5
: local g = "att:good_neutral"
: kmons("1 = quokka " .. g .. " w:30 / bombardier beetle " .. g)
: kmons("2 = bat " .. g .. " / rat " .. g .. " / butterfly " .. g)
: kmons("3 = yak tile:mons_yak_bow " .. g)
: if you.absdepth() > 10 then
SUBST:  2 = 3
FTILE:  '13_FJ = floor_grass
:   decorative_floor(_G, '13', "garden patch")
: else
FTILE:  '12_FJ = floor_grass_dark
: end
FTILE:  t = floor_moss
COLOUR: '123 = green
KMASK:  '123_FJ = opaque
MARKER: E = lua:transp_loc("ely_altar_entry")
MARKER: F = lua:transp_dest_loc("ely_altar_entry")
MARKER: J = lua:transp_loc("ely_altar_exit")
MARKER: K = lua:transp_dest_loc("ely_altar_exit")
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
xxx..@..xxx
xWW.....WWx
xWccctcccWx
..c1''''c..
@EnF'_'JnK@
..c''''2c..
xWccctcccWx
xWW.....WWx
xxx..@..xxx
ENDMAP

NAME:   elyvilon_altar_5
TAGS:   transparent decor
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
.............
.c.c.c.c.c.c.
.............
...T.....T...
@....._.....@
...T.....T...
.............
.c.c.c.c.c.c.
.............
ENDMAP

NAME:  nicolae_elyvilon_peaceful_grove
TAGS:  transparent decor
KMONS: P = bush w:20 / nothing
KMONS: _ = patrolling butterfly att:good_neutral
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
ww.PtttP.ww
wwP..P..Pww
.PPtt.ttPP.
P.ttP.Ptt.P
t.tP...Pt.t
tP..._...Pt
t.tP...Pt.t
P.ttP.Ptt.P
.PPtt.ttPP.
wwP..P..Pww
ww.PtttP.ww
ENDMAP

NAME:  nicolae_elyvilon_temple_path
TAGS:  transparent decor no_pool_fixup no_trap_gen
KMONS: p = plant
KMONS: s = sacred lotus
KFEAT: s = w
SUBST: s : sswww, p = ppp....
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
  ccccc
 ccwwwcc @ppppppppp
ccswUwwccppcppcppcp
cww...wwwwwwwwwwwww
cwU._..............@
cww...wwwwwwwwwwwww
ccswUwwccppcppcppcp
 ccwwwcc @ppppppppp
  ccccc
ENDMAP

NAME:   nicolae_elyvilon_cradling_hands
TAGS:   transparent decor no_trap_gen no_monster_gen no_pool_fixup
KMONS:  w = sacred lotus
KMONS:  _ = patrolling butterfly att:good_neutral
KFEAT:  w = w
SUBST:  - = ..f
COLOUR: .f@ = green
FTILE:  ._f = floor_grass
FTILE:  '@ = floor_moss
: decorative_floor(_G, 'f', "flower patch")
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
 xxxxxx
xxccccxx
xccf-ccxx
@cc-..ccx
'.cc...cx
@...._.wx
'.cc...cx
@cc-..ccx
xccf-ccxx
xxccccxx
 xxxxxx
ENDMAP

# https://www.youtube.com/watch?v=KNfjpmvbQG0
NAME:   nicolae_elyvilon_little_fluffy_clouds
TAGS:   transparent decor
WEIGHT: 7
KITEM:  _ = none w:100 / orb / orb ego:light w:1
MARKER: _ = lua:fog_machine{cloud_type = "white fluffiness", pow_min = 10, \
             pow_max = 15, delay_min = 20, delay_max = 30, size = 1, \
             walk_dist = 3, spread_rate = 0}
COLOUR: ` = green
FTILE:  `_ = floor_grass
FTILE:  . = floor_moss
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
.......
.`````.
.`````.
.``_``.
.`````.
.`````.
.......
ENDMAP

NAME:   nicolae_elyvilon_pacification_demonstration
TAGS:   transparent decor no_trap_gen no_monster_gen no_item_gen
TAGS:   buniq_s_overflow_holy_exhibit
WEIGHT: 7
KMONS:  1 = common demon att:neutral w:60 / phantom att:neutral / \
            wraith att:neutral / bes kemwar att:neutral / \
            mummy att:neutral / wight att:neutral / vampire att:neutral
NSUBST: f = 4:f / 4 = f` / * :`, ` = 4:1 / 4 = 1` / `
KMASK:  1n`f = opaque
KPROP:  1n`f = no_tele_into
COLOUR: 1`f  = green
FTILE:  1n`f = floor_grass
: decorative_floor(_G, 'f', "flower patch")
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
xxxxxxxxxxx
xcccccccccx
xcf`f`f`fcx
xc`f`f`f`cx
xcf`f`f`fcx
xc`f`nnnncx
xcf`fn...cx
xc`f`n._.cx
xcf`fn.....
xccccccc...
xxxxxxxx..@
ENDMAP

NAME:   nicolae_elyvilon_white_marble_altar
TAGS:   transparent decor no_monster_gen no_item_gen no_trap_gen
TAGS:   vaults_room_empty
: if you.in_branch("Vaults") then
SUBST:  @ = .
: end
COLOUR: @c. = white
FTILE:  @c.U_ = floor_w_marble
: standard_overflow_setup(_G, { { "elyvilon",  "_" } }, true)
MAP
ccccccc
c.....c
c.U...c
@..._.c
c.U...c
c.....c
ccccccc
ENDMAP

### Fedhas overflow altars ####################################################

NAME:   fedhas_altar_1
TAGS:   transparent decor lairdec
DEPTH:  D:3-, Lair, Depths
MONS:   plant
: if you.in_branch("Lair") then
FTILE:  . = floor_sprouting_stone
: end
FTILE:  '1_ = floor_sprouting_squares
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
.....
.1'1.
.'_'.
.1'1.
.....
ENDMAP

NAME:    fedhas_altar_2
TAGS:    transparent no_pool_fixup decor
KMONS:   1 = sacred lotus
KMONS:   2 = plant
KFEAT:   1 = w
KFEAT:   2 = W
SHUFFLE: abcd, efghij
SUBST:   a = W, b : 112ww, c : Ww, d = w, e : Ww., f : W2.., g : W.., hij = .
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
.efg.
jabch
id_di
hcbaj
.gfe.
ENDMAP

NAME:   fedhas_altar_3
TAGS:   transparent decor lairdec
DEPTH:  D:3-, Lair, Depths
NSUBST: b = 1:. / *:1
MONS:   plant w:5 / fungus / nothing w:3
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
@111@
1b1b1
11_11
1b1b1
@111@
ENDMAP

NAME:   fedhas_altar_4
TAGS:   transparent decor lairdec
DEPTH:  D:3-, Lair, Depths
FTILE:  .pt = floor_moss
: decorative_floor(_G, 'p', "flower patch")
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
xxxxxxxxxxxxxxx
xxxtttttttxxxxx
xxtttttttttxxxx
xttttp.tttttxxx
xtttt._.ttttttt
xxtttt.p.tttt..
xxttttt.......@
xxxxttttttttt..
xxxxxxttttttttx
xxxxxxxtttttttx
xxxxxxxxxxxxxxx
ENDMAP

# The oklob plant may be abusable (if so, remove it).
NAME:    tgw_fedhas
TAGS:    no_item_gen no_monster_gen
DEPTH:   D:3-, Lair
KPROP:   xzd3P = no_tele_into
MONS:    plant, fungus, oklob plant, bush, toadstool
KMONS:   S = sacred lotus
KFEAT:   d = floor
KFEAT:   S = w
KFEAT:   C = c
SUBST:   x = TTPPPPP.
# Only make "oklob behind bushes" situation possible a bit deeper.
: if you.absdepth() > 5 then
SHUFFLE: PQR
SUBST:   Q = 114, R = 11124
: end
SUBST:   P = 112, z = ., S : Sww
SHUFFLE: ...", TU
SUBST:   T = xt, U = xx
SUBST:   " = .....5
COLOUR:  . = green / none
COLOUR:  ' = green
TILE:    c = dngn_stone_wall_green
TILE:    C = wall_stone_puffball
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
cccccccccCcCcCccccccccc
cxxxxxxxxxxxxxxxxxxxxxc
cxxxxxxxxxxxxxxPxxd3xxc
cxxxxxxxxxxxxxxPddddxxc
cxxxxxxxxxxxxxxPPPxzdxc
cxxxxxxx.......xxPPxxxc
cxxxxxx..ww.ww..xxPPxxc
cxxxxx..www.www..xxxPxc
cxxxx..wwww.wwww..xxxxc
Cxxxx.wwwww.wwwww.xxxxC
cxxxx.wwww'''wwww.xxxxc
Cxxxx.wSww'_'wwSw.xxxxC
cxxxx.wwww'''wwww.xxxxc
Cxxxx.wwwwwwwwwww.xxxxC
cxxxx..wwwwwwwww..xxxxc
cxxxxx..wwwwwww..xxxxxc
cxxxxxx..wwwww..xxxxxxc
cxxxxxxx.......xxxxxxxc
cxxxxxxxxxC.Cxxxxxxxxxc
cxxxxxxxxxc.cxxxxxxxxxc
ccccccccCcC@CcCcccccccc
ENDMAP

NAME:   fedhas_ov_isle_minmay
TAGS:   no_monster_gen transparent no_descent
DEPTH:  D:3-, !D:$
MONS:   plant / bush w:5
KMONS:  S = sacred lotus
KFEAT:  S = w
KFEAT:  % = cache_of_fruit
SUBST:  S : Sww
NSUBST: 1 = 1:' / * = 111t''', 2 = 1:%'' / * = 111t'''
KMASK:  _1%'<> = opaque
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
     .....
   ...www...
  ..wwwwwww..
 ..wwwwwwwww..
 .wwwwwwwwwww.
..wwww1<1wwww..
.wwww12221wwww.
.wwSw12_21wSww.
.wwww12221wwww.
..wwww1>1wwww..
 .wwwwwwwwwww.
 ..wwwwwwwww..
  ..wwwwwww..
   ...www...
     .....
ENDMAP

NAME:    fedhas_altar_fruit_tree
TAGS:    transparent no_item_gen no_rotate no_vmirror decor
KFEAT:   de = cache_of_fruit
SHUFFLE: defghijk
SUBST:   fghijk = .
COLOUR:  . = green
COLOUR:  '@ = brown
FTILE:   ._det = floor_moss
FTILE:   '@ = floor_hall
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
xxxxxxxxxxxxxxxxx
xtttttttttttttttx
xtttttttttttttttx
xtttttt...ttttttx
xtttttg...gtttttx
xtttt.......ttttx
xtttf..._...ftttx
xttt.........tttx
xtt...e...e...ttx
xttdt.......tdttx
xtttttt'''ttttttx
xtttttt'''ttttttx
xttttt''@''tttttx
ENDMAP

NAME:  fedhas_bush_and_centaur_altar
TAGS:  transparent
# Centaur depth
DEPTH: D:5-13
MONS:  centaur, bush
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
    x
 .......
 .2222..
 .21222.
x.22_22.x
 ...22..
 .222...
    x
ENDMAP

NAME:   fedhas_altar_decomposition
TAGS:   transparent no_item_gen no_monster_gen no_trap_gen
DEPTH:  D:4-
MONS:   bush, plant
ITEM:   any skeleton
COLOUR: '@ = green
NSUBST:  d = 3:d / 3:e / 3 = e. / *:.
KPROP:  .3 = no_tele_into
FTILE:  .de = floor_sprouting_stone
FTILE:  '_12@ = floor_moss
: dgn.delayed_decay(_G, "e", "any corpse")
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
 xxxxxxxxx
xx.ddddd.xx
x.dd222dd.x
x.d21112d.x
x.d21_12d.x
x.d21'12d.x
x.d2x'x2d.x
x..dx'xd..x
xxxxx'xxxxx
   xx'xx
   x2@2x
ENDMAP

NAME:   nicolae_fedhas_fungal_naptime
TAGS:   transparent decor
DEPTH:  D:4-8
KMONS:  1_ = sleepcap
KMONS:  p = fungus
ITEM:   spore talisman
: if you.depth() >= 6 then
NSUBST: ` = 1 / `
: end
NSUBST: ` = 1:d``` / * = ```p
SUBST:  p = ppp'
FTILE:  '`_1pd = floor_rough_brown
: standard_overflow_setup(_G, { { "fedhas", "_" } }, true)
MAP
.......
.`p`p`.
.p`p`p.
.`p_p`.
.p`p`p.
.`p`p`.
.......
ENDMAP

### Gozag overflow altars #####################################################

NAME:   grunt_gozag_statues
TAGS:   transparent no_item_gen no_monster_gen no_trap_gen
TAGS:   vaults_empty no_wall_fixup decor
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 3 (Vaults), 10
COLOUR: x = yellow
FTILE:  _-G = floor_limestone
TILE:   x = wall_sandstone
: vault_metal_statue_setup(_G, "G", "golden statue")
: if you.in_branch("Vaults") then
CLEAR:  @
: end
: standard_overflow_setup(_G, { { "gozag", "_" } }, true)
MAP
     @
  xxx-xxx
 xx-----xx
 x-G---G-x
 x-------x
@----_----@
 x-------x
 x-G---G-x
 xx-----xx
  xxx-xxx
     @
ENDMAP

NAME:   grunt_gozag_breadcrumbs
TAGS:   transparent no_item_gen no_monster_gen no_trap_gen decor
TAGS:   no_wall_fixup vaults_empty vaults_orient_w
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 3 (Vaults), 10
ITEM:   gold q:1 no_pickup
KITEM:  e = gold q:1
FTILE:  _-Ge = floor_limestone
RTILE:  x = wall_sandstone
COLOUR: x = yellow
: vault_metal_statue_setup(_G, "G", "golden statue")
: standard_overflow_setup(_G, { { "gozag", "_" } }, true)
MAP
        xxxxx
.@......x-eGx
@d.d.d.d-e-_x
.@......x-eGx
        xxxxx
ENDMAP

NAME:  nicolae_gozag_cash_rules_everything_around_me
TAGS:  no_hmirror no_vmirror no_rotate no_item_gen transparent decor
: standard_overflow_setup(_G, { { "gozag", "_" } }, true)
MAP
bbb@bbb
b....$b
b.b.bbb
b.._..b
bbb.b.b
b$....b
bbb@bbb
ENDMAP

# No, you probably can't afford any of it.
# You should have thought of that before being poor.
NAME:   nicolae_gozag_zags_fifth_avenue
TAGS:   no_pool_fixup no_item_gen no_monster_gen decor transparent
TAGS:   vaults_empty vaults_orient_e
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 1 (Vaults), 5
FTILE:  '_TSG = floor_limestone
KFEAT:  S = general shop name:Gozag type:Platinum suffix:Reserve count:20 \
        greed:100 ; any weapon randart w:10 | any armour randart w:10 | \
        any jewellery randart w:10 | any magical staff randart w:5 | \
        any talisman randart w:5
: vault_metal_statue_setup(_G, "G", "golden statue")
: standard_overflow_setup(_G, { { "gozag", "_" } }, true)
MAP
wwwwwww....
wG'''Gwwww.
w'T'T''''w.
w''S'''_''@
w'T'T''''w.
wG'''Gwwww.
wwwwwww....
ENDMAP

NAME:  nicolae_gozag_seed_capital
TAGS:  transparent no_item_gen decor
DEPTH: D:3-, Vaults, !Vaults:$, Depths
ITEM:  gold q:1 no_pickup / gold q:2 no_pickup
: standard_overflow_setup(_G, { { "gozag", "_" } }, true)
MAP
ddd
d_d
ddd
ENDMAP

NAME:   nicolae_gozag_conspicuous_consumption
TAGS:   transparent no_trap_gen vaults_empty no_pool_fixup decor
TAGS:   buniq_s_overflow_glass
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 2
KITEM:  $ = gold
KPROP:  $ = no_tele_into
KMASK:  $ = opaque
KMASK:  $ = no_monster_gen
TILE:   n = dngn_transparent_stone_yellow
TILE:   m = dngn_transparent_wall_yellow
FTILE:  ._Gmn$U = floor_limestone
COLOUR: .mn$U = yellow
: vault_metal_statue_setup(_G, "G", "golden statue")
: standard_overflow_setup(_G, { { "gozag", "_" } }, true)
MAP
    .....
 G...._....G
 ...G...G...
 ..UwwwwwU..
..GwnmmmnwG..
...wm$$$mw...
._.wm$$$mw._.
...wm$$$mw...
..GwnmmmnwG..
 ..UwwwwwU..
 ...G...G...
 G...._....G
    .....
ENDMAP

NAME:   ms813_gozag_edmund's_armoury
TAGS:   transparent no_trap_gen
DEPTH:  D:4-6
WEIGHT: 5
KMONS:  1 = Edmund ; flail good_item . ring mail, Sigmund, \
            human ; flail . ring mail
ITEM:   kite shield w:1 / chain mail w:4 / flail w:5 / $
KFEAT:  _ = altar_gozag
NSUBST: 1 = 1:1 / *:$
COLOUR: @_.$d1+x = yellow
KMASK:  $1. = no_monster_gen
FTILE:  @_.$d1+xG = floor_limestone
RTILE:  x = wall_sandstone
: vault_metal_statue_setup(_G, "G", "golden statue")
: standard_overflow_setup(_G, { { "gozag", "_" } }, false)
MAP
   xxx
   xdx
  xx+xx
xxx111xxx
xd+1_1+dx
xxx...xxx
  xx+xx
   G@G
ENDMAP

NAME:    regret_index_gozag_office_hoard
TAGS:    no_monster_gen vaults_orient_n vaults_orient_w vaults_orient_s
TAGS:    vaults_hard no_wall_fixup
DEPTH:   D:5-, Snake, Vaults, !Vaults:$, Zot, !Zot:$
SHUFFLE: TPV, TU, PG
: if you.in_branch("D") then
:   if you.depth() < 8 then
MONS:    gnoll, human ; mace good_item . ring mail, water moccasin
KITEM:   $ = $ / $ q:2
:   elseif you.depth() < 12 then
MONS:    human ; mace good_item . ring mail / centaur
MONS:    troll / vampire / two-headed ogre
MONS:    wyvern / acid dragon
KITEM:   $ = $ / $ q:2 w:5
:   else
MONS:    tengu warrior / gargoyle / centaur w:2
MONS:    centaur warrior / deep elf knight / rakshasa
MONS:    hydra / fire dragon / ice dragon
SUBST:   % = %*, $ = $$%
:   end
KMONS:   P = plant
SUBST:   X = xx., z = x
FTILE:   P = floor_moss
: elseif you.in_branch("Snake") then
KMONS:   1 = naga warrior / naga sharpshooter
KMONS:   2_ = guardian serpent
KMONS:   3 = anaconda / shock serpent w:12
KMONS:   P = plant
SUBST:   % = *, $ = $%, X = xx., z = x
FTILE:   P = floor_moss
: elseif you.in_branch("Vaults") then
MONS:    ironbound mechanist / ironbound preserver
MONS:    vault warden, great orb of eyes / dancing weapon w:2 / peacekeeper w:2
KMONS:   _ = golden dragon / quicksilver dragon / iron dragon w:4
KMONS:   P = bush
SUBST:   - = +, % = *||, $ = $%, c = b, Xz = v
CLEAR:   x@
:   vaults_hard_standard(_G, true, ".TV_G+$%*|123")
FTILE:   P = floor_pebble_green
: else -- Zot
MONS:    draconian scorcher / draconian annihilator
MONS:    draconian knight / draconian shifter, golden dragon
KMONS:   P = withered plant
SUBST:   % = }])>, X = bbb., z = x
: end
NSUBST:  - = 1:+ / 1:c+++ / 1:cc+
: vault_metal_statue_setup(_G, "G", "golden statue")
: decorative_floor(_G, 'V', "floral vase")
: standard_overflow_setup(_G, { { "gozag", "_" } }, false)
MAP
      xx
     x.@
    x...
    cc-cc   zzzz
    c...c zzz$$zzz
x..ccc+cccz$$..$$zx
x..cP...TcXX.X..3$x
@x.c.1...c..X....$xx
  .-..2..+...._...%x
@x.c...1.c..X....$xx
x..cT...VcXX.X..3$x
x..ccc+cccz$$..$$zx
    c...c zzz$$zzz
    cc-cc   zzzz
    x...
     x.@
      xx
ENDMAP

NAME:   nicolae_gozag_stack_of_coins
TAGS:   transparent decor vaults_room_empty
DEPTH:  D:3-, Vaults, Depths
COLOUR: .v = yellow
FTILE:  _.vG = floor_limestone
TILE:   v = dngn_metal_wall_yellow
: vault_metal_statue_setup(_G, "G", "golden statue")
: standard_overflow_setup(_G, { { "gozag", "_" } }, true)
MAP
...........
.vvv...vvv.
.....G.....
.vvv...vvv.
...........
.vvv._.vvv.
...........
.vvv...vvv.
.....G.....
.vvv...vvv.
...........
ENDMAP

### Hepliaklqana overflow altars #############################################

NAME:   worldfamousw_hep_ancestral_shrine
TAGS:   no_monster_gen no_item_gen no_pool_fixup transparent
COLOUR: w = green
TILE:   G = dngn_gravestone
COLOUR: t = brown
TILE:   t = DNGN_TREE_DEAD
{{
set_feature_name("granite_statue", "a gravestone")
set_feature_name("tree", "dead tree")
dgn.persist.hep_ancestral_shrine_reborn = false

local los_marker = TriggerableFunction:new {
  func="callback.hep_ancestral_shrine_los",
  repeated=true
}
los_marker:add_triggerer(DgnTriggerer:new {
  type="player_los"})

lua_marker('_', los_marker)
lua_marker("t", portal_desc { dead_tree=1 })
lua_marker("w", portal_desc { green_water=1 })
}}
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
 xxxxx
xxwwwxx
xwwwwwx
xwwwwwx
xwtGtwx
xt...tx
x.._..x
xt...tx
xxt.txx
 xx+xx
   @
ENDMAP

NAME:   nzn_hepliaklqana_mist_gate
TAGS:   transparent decor no_monster_gen
KFEAT:  _ = altar_hepliaklqana
MARKER: A = lua:fog_machine { cloud_type = "grey smoke", pow_min = 20, \
                              pow_max = 40, delay = 10, size = 1, \
                              spread_rate = -1 }
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
xxxxx
x...x
x._.x
x...x
xx.xx
 xAx
 x.x
  @
ENDMAP

# A long-forgotten ecumenical temple. Only Hepliaklqana clearly remains,
# although a few forgotten altars are still around.
NAME:   nicolae_hepliaklqana_ecumenical_no_more
TAGS:   transparent decor
WEIGHT: 3
KMONS:  WD = plant / nothing
NSUBST: E = - / E, H = _ / - / E, E = E / . / E., P = 4=W / WDD / D
SUBST:  ' = '''., c = ccx
KFEAT:  WS = W
KFEAT:  - = altar_ecumenical
FTILE:  WVD = floor_mud
COLOUR: D = darkgrey
FTILE:  ' = floor_w_marble
COLOUR: ' = white
FTILE:  _-E = floor_limestone
COLOUR: E = yellow
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
xxxxx.@.xxxxx
xxccxx+xxccxx
xccc''.''cccx
xcc''E'E''ccx
xc'''''''''cx
xc'E'PPP'E'cx
xc'''PVP'''cx
xc'H'PPP'H'cx
xc'''''''''cx
xcc''H'H''ccx
xccc'''''cccx
xxcccccccccxx
xxxxxxxxxxxxx
ENDMAP

NAME:   nicolae_hepliaklqana_hazy_memory
TAGS:   transparent decor
MONS:   plant
SUBST:  ' = ..', . = ...1
CLEAR:  '
KFEAT:  _ = altar_hepliaklqana
MARKER: _ = lua:fog_machine { cloud_type = "thin mist", size = 1, pow_min = 5, \
  pow_max = 7, delay = 10, start_clouds = 1, walk_dist = 5, spread_rate = 10 }
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
    '''
 ''''.''''
 '.'.'.'.'
 ''.'''.''
''.'...'.''
'.''._.''.'
''.'...'.''
 ''.'''.''
 '.'.'.'.'
 ''''.''''
    '''
ENDMAP

# Or should that be "heppocampus"...?
NAME:  nicolae_hepliaklqana_hippocampus
TAGS:  transparent decor
KFEAT: _ = altar_hepliaklqana
SUBST: D = cxx, E = cx
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
    xxxxxxxx
   @....xxxx
    xxx..xxx
xxxxxxxx.xxx
xcccccxx..xx
xc...cxx..xx
xc._.cxD..xx
xc...cxD..Dx
xc..ccxD..Dx
xc...EE...Dx
xc........Dx
xcE......DDx
xxEEEEEDDDxx
xxxxxxxxxxxx
ENDMAP

NAME:    nicolae_hepliaklqana_monster_ancestors
TAGS:    transparent patrolling no_monster_gen no_trap_gen
: if you.in_branch("Depths") then
MONS:   deep troll earth mage, spectral deep troll earth mage, tengu reaver
MONS:   spectral tengu reaver, spriggan defender, spectral spriggan defender
MONS:   hell knight
KMONS:  D = spectral hell knight
: else
MONS:    goblin, spectral goblin, kobold, spectral kobold, hobgoblin
MONS:    spectral hobgoblin, orc
KMONS:   D = spectral orc
: end
SHUFFLE: 12 / 34 / 56 / 7D
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
xxxxxxxxx
xxwwwwwxx
x..1....x
+....._.x
x..2....x
xxwwwwwxx
xxxxxxxxx
ENDMAP

NAME:    beargit_hepliaklqana_dungeon_heroes
TAGS:    transparent no_monster_gen patrolling no_trap_gen u
SHUFFLE: 123, _-G
: if you.in_branch("D") then
:     if you.depth() < 5 then
KMONS:   1 = orc wizard; quarterstaff . robe
# Extremely early for kobold brigands, but they get a wand of polymorph
# instead of darts, so less threatening.
KMONS:   2 = jessica; dagger . robe . wand of polymorph / \
             kobold brigand ; dagger . wand of polymorph, \
             kobold brigand ; dagger . wand of polymorph
KMONS:   3 = orc ; flail . kite shield . chain mail
# Only generate one ancestor monster for D:3-9
NSUBST:  123 = 2:.
:     elseif you.depth() < 7 then
KMONS:   1 = blorkula the orcula ; quarterstaff good_item . robe / \
             orc wizard ; quarterstaff good_item . robe, \
             orc wizard ; quarterstaff good_item . robe
: kmons("2 = sigmund ; " .. scythe("draining") .. " . robe / " ..
:       "kobold brigand ; dagger ego:draining . dart ego:atropa, " ..
:       "kobold brigand ; dagger ego:draining . dart ego:atropa")
KMONS:   3 = edmund ; flail good_item . kite shield . chain mail / \
             orc warrior ; flail good_item . kite shield . chain mail / \
             gnoll sergeant ; flail good_item . kite shield . chain mail, \
             orc warrior ; flail good_item . kite shield . chain mail / \
             gnoll sergeant ; flail good_item . kite shield . chain mail
NSUBST:  123 = 2:.
:     elseif you.depth() < 10 then
MONS:    gargoyle ; quarterstaff good_item
MONS:    kobold brigand ; dagger ego:draining good_item . wand of paralysis . \
                          dart ego:atropa / \
         spriggan ; dagger ego:draining good_item . robe good_item . \
                    buckler . wand of paralysis / \
         vampire ; dagger ego:draining good_item . robe good_item
MONS:    orc warrior ; flail good_item . kite shield . chain mail good_item / \
         gnoll sergeant ; flail good_item . kite shield . chain mail good_item
NSUBST:  123 = 2:.
:     elseif you.depth() < 13 then
MONS:    gargoyle ; quarterstaff good_item / \
         molten gargoyle w:5 ; quarterstaff good_item
MONS:    kobold brigand ; dagger ego:draining good_item . wand of paralysis . \
                          dart ego:atropa / \
         spriggan ; dagger ego:draining good_item . robe good_item . \
                    buckler . wand of paralysis / \
         vampire ; dagger ego:draining good_item . robe good_item
MONS:    orc warrior ; flail good_item . kite shield . chain mail good_item / \
         gnoll sergeant ; flail good_item . kite shield . \
                          chain mail good_item / \
         skeletal warrior ; flail good_item . kite shield . \
                            chain mail good_item
# Generate two ancestor monsters for D:10-D:12.
NSUBST:  123 = 1=.
# For D:13- and Depths, generate all three ancestor monsters.
:     else
MONS:    ogre mage; lajatang ego:freezing / \
         molten gargoyle ; lajatang ego:flaming
MONS:    spriggan ; dagger ego:draining good_item . robe good_item . \
                    buckler . wand of paralysis / \
         vampire ; dagger ego:draining good_item . robe good_item . \
                   buckler . wand of paralysis
MONS:    orc knight; broad axe ego:flaming . chain mail good_item . \
                     tower shield ego:reflection / \
         tengu warrior ; broad axe ego:flaming . chain mail good_item . \
                         tower shield ego:reflection / \
         naga warrior ; broad axe ego:flaming . chain mail good_item  . \
                        tower shield ego:reflection / \
         skeletal warrior ; broad axe ego:flaming . chain mail good_item . \
                            tower shield ego:reflection
:     end
: else -- Depths
MONS:    tengu reaver ; lajatang ego:freezing good_item | \
                        lajatang ego:freezing randart . scale mail / \
         ancient champion ; lajatang ego:freezing good_item | \
                            lajatang ego:freezing randart . scale mail
MONS:    vampire knight; quick blade ego:antimagic . buckler good_item . \
                         shadow dragon scales good_item / \
         spriggan defender; quick blade ego:antimagic w:20 . robe good_item . \
                            buckler good_item . wand of paralysis
MONS:    minotaur ; broad axe ego:speed good_item | \
                    broad axe ego:speed randart | arga w:1 . \
                    plate armour good_item . \
                    tower shield ego:reflection good_item / \
         orc warlord ; broad axe ego:speed good_item | \
                       broad axe ego:speed randart | arga w:1 . \
                      plate armour good_item . \
                      tower shield ego:reflection good_item
: end
KFEAT:   - = altar_ecumenical
MARKER:  ` = lua:fog_machine { cloud_type = "thin mist", \
                               pow_min = 100, pow_max = 200, \
                               delay = 100, size = 2, walk_dist = 1 }
: vault_granite_statue_setup(_G, "G", "gravestone")
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, false)
veto {{
  if you.depth() > 7 then
    return items.excluded_from_set("wand of paralysis")
  end
}}
: decorative_floor(_G, 'V', "mourning vase")
MAP
    ccccc
    c...c
    c.-.c
    c.2.c     cc
ccccc...ccccccc.
c.....V.`..`..`.
c._1.Vc.........
c.....V.`..`..`.
ccccc...ccccccc.
    c.3.c     cc
    c.G.c
    c...c
    ccccc
ENDMAP

NAME:   nicolae_hepliaklqana_antique_land
TAGS:   transparent decor
COLOUR: . = brown w:20 / none
FTILE:  GV_. = floor_sandstone w:20 / floor_rough_lightgray
: vault_granite_statue_setup(_G, "G", "broken pillar")
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
G.G.G
.V.V.
G._.G
.V.V.
G.G.G
ENDMAP

NAME:    nicolae_hepliaklqana_hall_of_mighty_ancestors
TAGS:    decor transparent
DEPTH:   D:3-
SHUFFLE: PQ
SUBST:   P = +, Q : xx+, + : +++@
# note to self: add dngn_statue_dwarf once that bug gets fixed
TILE:    G = dngn_statue_ancient_hero w:2 / dngn_statue_archer / \
             dngn_statue_axe / dngn_statue_cat w:2 / dngn_statue_centaur / \
             dngn_statue_mermaid / dngn_statue_naga / \
             dngn_statue_polearm / dngn_statue_princess / dngn_statue_tengu
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
 xxxPxxx
 x.....x
xx.G.G.xx
x.......x
Q.G._.G.Q
x.......x
xx.G.G.xx
 x.....x
 xxxPxxx
ENDMAP

NAME:   nicolae_hepliaklqana_this_could_be_you
TAGS:   transparent decor buniq_s_overflow_glass
: local mons = you.monster()
: if (not crawl.game_started()) then
:    mons = "human"
: end
: kmons("1 = " .. mons)
KMONS:  2 = ancestor
KMASK:  12` = opaque
KMASK:  12` = no_monster_gen
KMASK:  12` = no_item_gen
KMASK:  12` = no_trap_gen
KPROP:  12` = no_tele_into
MARKER: ` = lua:fog_machine {cloud_type = "thin mist", size = 1, pow_min = 5, \
  pow_max = 7, delay = 10, start_clouds = 1, walk_dist = 5, spread_rate = 10}
: standard_overflow_setup(_G, { { "hepliaklqana", "_" } }, true)
MAP
xxxxxxxx@
xccn.....
xc1n...xx
xc`n._.xx
xc2n...xx
xccn.....
xxxxxxxx@
ENDMAP

### Kikubaaqudgha overflow altars #############################################

NAME:   lemuel_zombie_altar_kikubaaqudgha
TAGS:   transparent no_monster_gen no_trap_gen no_pool_fixup uniq_zombie_altar
: if you.in_branch("Depths") then
MONS:   zombie, patrolling vampire mage
: elseif you.depth() > 12 then
MONS:   scorpion zombie / hound zombie, patrolling necromancer
: elseif you.depth() > 4 then
MONS:   jackal zombie / adder zombie, patrolling burial acolyte
: else
MONS:   frilled lizard zombie / bat zombie
SUBST:  2 = .
: end
NSUBST: 1 = 2:1 / 3 = 11... / *:.
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
xxxxxxxxxxxxxxxx
xxxxwwwwwwwwxxxx
xxxx.1111111xxxx
@........2...._x
xxxx.1111111xxxx
xxxxwwwwwwwwxxxx
xxxxxxxxxxxxxxxx
ENDMAP

NAME:   lemuel_mausoleum_altar_kikubaaqudgha
TAGS:   transparent uniq_mausoleum_altar
# zombies scale with depth so we'll let it place in Crypt, too
DEPTH:  D:5-10, Crypt
: if you.in_branch("Crypt") then
MONS:   zombie, guardian mummy, skeletal warrior, ghoul
NSUBST: ? = 1:* / *:?
: else
:   if you.depth() > 6 then
MONS:   zombie, wight, burial acolyte
:     mons("place:D:" .. you.depth() - 2 .." draugr")
:   else
MONS:   zombie, phantom, shadow imp, draugr ; dagger
:   end
: end
NSUBST: ? = 1:_ / *:1
SUBST:  1 = 1:30 2 3 4:5
KMONS:  _ = human zombie
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
ccccccccccccccc
c?c?c?c?c?c?ccG
c+c+c+c+c+c+ccc
c............+@
c+c+c+c+c+c+ccc
c?c?c?c?c?c?ccG
ccccccccccccccc
ENDMAP

NAME:   kiku_gazebo_garden_becter
TAGS:   transparent decor
KMONS:  f = withered plant
SUBST:  ` = f....
COLOUR: c = magenta
COLOUR: i' = brown
COLOUR: " = yellow
TILE:   c = dngn_stone_wall_magenta
FTILE:  '"_ = floor_pebble_yellow
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
..````
.ccc`````
.c'c"`````
.c''""````
.c'''"c````
.c'_''cc```
.c'''"c````
.c''""````
.c'c"`````
.ccc`````
..````
ENDMAP

NAME:   kiku_gazebo_pond_becter
TAGS:   transparent decor
KMASK:  Ww = no_monster_gen
SUBST:  M = W..
COLOUR: c = magenta
COLOUR: i' = brown
COLOUR: " = yellow
COLOUR: w = green
COLOUR: W = lightgreen
TILE:   c = dngn_stone_wall_magenta
FTILE:  '"_ = floor_pebble_yellow
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
..........
.cccccccc.
.c''''cc...
.c'_'""..V.
.c'W""MMM..
.c'"WWWwwM.
.cc".MWwwM.
.cc..MwwwM.
.c...MwwwM.
...V..MMM..
.........
ENDMAP

NAME:   kennysheep_vampire_church
TAGS:   transparent no_monster_gen
# This used to be a decorative vault, but nobody noticed the blood fountain
# lua by default on a relatively uncommon vault, so now it gets some actual
# depth-scaling monsters and a reward it in later on.
: if you.in_branch("Depths") then
MONS:   vampire knight / jiangshi, vampire mage
: elseif you.depth() > 11 then
MONS:   vampire, vampire bat
: elseif you.depth() > 5 then
MONS:   vampire bat / nothing w:7, bat draugr ; dagger / bat zombie w:20
: else
MONS:   vampire bat / nothing w:7, bat zombie
: end
: if you.in_branch("Depths")
:  or (you.absdepth() > 11 and crawl.x_chance_in_y(2, 3)) then
ITEM:   sanguine talisman
: end
KITEM:  _ = gold q:1 no_pickup
KFEAT:  X = x
NSUBST: . = 4:2 / 3 = 2. / *:.
TILE:   X = wall_catacombs
{{
local trig_marker = TriggerableFunction:new {
  func="callback.vampire_church_blood",
  repeated = false
}
trig_marker:add_triggerer(DgnTriggerer:new { type = "player_move" })
lua_marker("_", trig_marker)
lua_marker("V", portal_desc { replica_name = "vampire_church_blood" })
}}
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
  xxxxxxxxx
  xx.VdV.xx
xxx..1_1..xxx
xx.X.V1V.X.xx
x.V.X...X.V.x
xx.X.X.X.X.xx
x.X.V.X.V.X.x
xx.X.X.X.X.xx
x.V.X.V.X.V.x
xx.X.X.X.X.xx
xxx.V.X.V.xxx
xx.X.X.X.X.xx
xx..X.V.X..xx
xx.X.X.X.X.xx
xxx.V.X.V.xxx
xxxx.....xxxx
xxxxx+++xxxxx
ENDMAP

NAME:   nicolae_kikubaaqudgha_miasma_corner
TAGS:   transparent decor
: single_cloud(_G, "M", "foul pestilence", true)
COLOUR: c = darkgrey
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
    .
 ccc.ccc
 cM...Mc
 c.....c
...._....
 c.....c
 cM...Mc
 ccc.ccc
    .
ENDMAP

NAME:    regret_index_kikubaaqudgha_part_by_part
TAGS:    transparent no_monster_gen
DEPTH:   D:5-8
MONS:    patrolling burial acolyte, patrolling shadow imp
MONS:    kobold zombie / gnoll zombie, adder zombie / hound zombie
SHUFFLE: ABCD
NSUBST:  A = 1:2 / *:3, B = 1:2 / *:4
SUBST:   C = $, D = .
SUBST:   X : x', Y : x', y : x., z : c.., G : Gxx
: vault_metal_statue_setup(_G, "G", "soul conduit")
CLEAR:   '
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
 Xxxxx.....xxxxY
XxxBBx.y.y.xCCxxY
xxxxB+.....+Cxxxx
xAxxxx.....xxxxxx
xAAxGc..z..cxxxxx
xx+xc.......xxxx
......cc+cc
.y....c4.3c
......+._.c
.y....c3.1c
......ccccc
xx+xc.
xDDxxx
xDxxxx
Yxxxxx
 Yxxx
ENDMAP

NAME:   nicolae_kikubaaqudgha_church_of_necroconduits
TAGS:   transparent
WEIGHT: 7
DEPTH:  D:3-, Depths, Crypt
KMONS:  z = zombie
NSUBST: z = z / . / z.
COLOUR: c = darkgrey
: vault_metal_statue_setup(_G, "G", "soul conduit")
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
  xxxxxxx
 xxcccccxx
xxccGcGccx
xcc.z.z.c
xc_.czc.@
xcc.z.z.c
xxccGcGccx
 xxcccccxx
  xxxxxxx
ENDMAP

NAME:   nicolae_kikubaaqudgha_piles_of_ancient_bones
TAGS:   transparent no_trap_gen no_monster_gen
DEPTH:  D:3-, Depths, Crypt
KMONS:  _ = draugr
KMONS:  1 = zombie / 9 zombie w:2 / nothing
# Sometimes ends up with invertebrate corpses instead of skeletons, which is
# somewhat off-theme but Kikubaaqudgha likes corpses too so I'll let it slide.
KITEM:  - = 0 skeleton w:15 / 9 skeleton / human skeleton w:1
NSUBST: - = 5=` / 2=` / ----``., d = ...-
COLOUR: c = darkgrey
: kitem("` = " .. vault_species_skeletons(_G, "all"))
: standard_overflow_setup(_G, { { "kikubaaqudgha", "_" } }, true)
MAP
   xxcc@ccxx
   xcc...ccx
   xcd.c.dcx
xxxxcc...ccxxxx
xcccccc1ccccccx
ccdcccc-ccccdcc
c...cc---cc...c
@.c.1--_--1.c.@
c...cc---cc...c
ccdcccc-ccccdcc
xcccccc1ccccccx
xxxxcc...ccxxxx
   xcd.c.dcx
   xcc...ccx
   xxcc@ccxx
ENDMAP

### Makhleb overflow altars ###################################################

NAME:    demons_altar
TAGS:    transparent layout_rooms layout_city layout_open
TAGS:    no_monster_gen patrolling
DEPTH:   D:4-, Orc, !Orc:$
MONS:    rust devil, smoke demon, iron imp ; damaged sling
: if you.absdepth() > 12 then
SUBST:   3 = 2, ' = 1
: elseif you.absdepth() > 9 then
SUBST:   3 = 12
: end
TILE:    G = dngn_statue_imp / dngn_statue_demonic_bust
: standard_overflow_setup(_G, { { "makhleb", "_" } }, false)
MAP
xxxxxxxxxxxxxxx
x.............x
x.ll.......ll.x
x.ll'.._..'ll.x
x.ll...3...ll.x
x..ll.....ll..x
x...lll.lll...x
x....llGll....x
x......l......x
x.............x
x.............x
x.............x
x.............x
ENDMAP

NAME:  bloody_makhleb
TAGS:  transparent decor
DEPTH: D:3-, Orc
KPROP: . = bloody / nothing
KITEM: _ = robe, whip
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
...
._.
...
ENDMAP

NAME:  makhleb_altar_promises_db
TAGS:  transparent buniq_s_overflow_glass
KPROP: 12 = no_tele_into
KMASK: 12 = no_trap_gen
KMASK: 12 = opaque
MONS:  executioner / balrug / green death / cacodemon / blizzard demon
MONS:  orange demon / ynoxinul / neqoxec / hellwing / smoke demon
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
  ccc
  c1c
cccnccc
c2n_n2c
ccc.ccc
  c.c
  c@c
ENDMAP

NAME:   makhleb_blood_cavern_becter
TAGS:   transparent
DEPTH:  D:4-8
: if you.depth() < 7 then
:   dgn.delayed_decay(_G, '1', 'human corpse')
KMONS:  2 = hound
: else
KMONS:  1 = human draugr ; whip
KMONS:  2 = spectral hound
: end
KFEAT:  X = x
KPROP:  y' = bloody
TILE:   X = wall_hall
SUBST:  ' = ., y = x, G = GGx
: vault_metal_statue_setup(_G, "G", "mystic cage")
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
  @@@
 x..'.xxx
 xx...'yxx
 xxxx..'yxx
 xxxxxx.'yx
 xxxGxxy'.x
xxxx.'y'.xx
xXX.12'.xx
xXA_'.xxx
xXX..xxx
xxxxxx
ENDMAP

NAME:   makhleb_heckhound_becter
TAGS:   transparent no_monster_gen
# hound depth
DEPTH:  D:4-7
KMONS:  _ = patrolling hound
KFEAT:  X = x
SUBST:  y = xx., G = GXXX
TILE:   X = wall_hall
: vault_metal_statue_setup(_G, "G", "mystic cage")
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
 xxxxx
xxXGXxx
xyXAXyx
x.._..x
xy...yx
 y...y
  @@@
ENDMAP

NAME:   makhleb_grotto_becter
TAGS:   transparent no_monster_gen
# white imp depth
DEPTH:  D:5-8
MONS:   shadow imp w:2 / drude w:4 / crimson imp w:6
KFEAT:  X = x
TILE:   X = wall_hall
FTILE:  A_'1 = floor_grey_dirt
SUBST:  ' = .
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
 xxxxx
xxXXXxx
xwXAXwx
xww_wwx
xww1wwx
x.w'w.x
xx...xx
 xx+xx
   @
ENDMAP

NAME:   nzn_makhleb_speed_demon
TAGS:   transparent no_monster_gen
DEPTH:  D:7-11
WEIGHT: 2
KFEAT:  _ = altar_makhleb
KMONS:  _ = sixfirhy
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
.....
.ccc.
.c_c.
.c=c.
..@..
ENDMAP

# Ignis doesn't get normal overflow altars, so this just
# counts as a Makhleb overflow altar vault itself.
NAME:    dolorous_makhleb_big_flames_little_flames
TAGS:    transparent no_monster_gen no_item_gen no_trap_gen
TAGS:    uniq_ignis_plus_one_overflow
DEPTH:   D:4-
WEIGHT:  1
KPROP:   . = bloody w:5 / nothing w:25
KFEAT:   D = altar_ignis
KFEAT:   E = altar_makhleb
# The shared cloud markers make smoke waft up from the one flame cloud.
: single_cloud(_G, "P", "flame", false)
MARKER:  P = lua:fog_machine { cloud_type = "grey smoke", \
             pow_min = 3, pow_max = 3, delay = 100, \
             size = 1, walk_dist = 1, start_clouds = 1 }
FTILE:   ' = floor_rough_brown
COLOUR:  c = lightred
COLOUR:  ' = brown
: vault_metal_statue_setup(_G, "G", "fiery conduit")
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
   cccccccc+cccccccc
 ccc....ccc'ccc....ccc
cc...V...c'''c...E...cc
cG.......''P''.......Gc
cc...D...c'''c...Y...cc
 ccc....ccc'ccc....ccc
   ccccccccccccccccc
ENDMAP

NAME:    regret_index_makhleb_overflow_haemoclasm
TAGS:    transparent decor no_vmirror no_rotate
DEPTH:   D:3-, Depths, Geh, !Geh:$, Coc, !Coc:$, Dis, !Dis:$, Tar, !Tar:$
WEIGHT:  5 (D:3-, Depths), 1
KITEM:   de = human skeleton
KFEAT:   CD = altar_makhleb
SHUFFLE: '? / '? / "! / "! / "!, xy
NSUBST:  ? = 1:C / *:d, ! = 1:D / *:e
KPROP:   'd = bloody
FTILE:   eD" = floor_pebble_red
CLEAR:   y
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
 yyyy  yyyy  yyyy
x'..'  '..'  .''.x
x''.'  '..'  '..'x
x..?.  .'?.  .?.'x
x''.'  '..'  '.'.x
x'..'  '''.  '..'x
x'..'  '..'  .''.x
 yyyy  yyyy  yyyy
ENDMAP

NAME:    nicolae_makhleb_no_cleanup_necessary
TAGS:    transparent decor
KITEM:   d = human skeleton
KFEAT:   e = .
SHUFFLE: def
SUBST:   - = ..`, ` = .``
KPROP:   def`_ = bloody
FTILE:   .`_def = floor_marble
: decorative_floor(_G, 'f', "bloodied mop and bucket")
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
....--`
.df.--`
.e..-``
..._```
---````
--`````
```````
ENDMAP

NAME:    nicolae_makhleb_poor_unfortunate_consoles
TAGS:    transparent decor buniq_e_colour_overflow
WEIGHT:  5
KFEAT:   DEFH = b
SHUFFLE: DEFH
COLOUR:  -_ = fire
FTILE:   -_ = floor_demonic
TILE:    D = bedevilled_crystal_gehenna
TILE:    E = bedevilled_crystal_cocytus
TILE:    F = bedevilled_crystal_dis
TILE:    H = bedevilled_crystal_tartarus
: set_feature_name("crystal_wall", "bedevilled crystal wall")
: standard_overflow_setup(_G, { { "makhleb", "_" } }, true)
MAP
xxx+xxx
xDD-EEx
xD---Ex
x--_--x
xH---Fx
xHH-FFx
xxxxxxx
ENDMAP

### Nemelex overflow altars ###################################################

NAME:  nemelex_xobeh_ov_fountains_minmay
TAGS:  transparent decor
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
U@U
@_@
U@U
ENDMAP

# Nemelex altar (Shiori)
# Perhaps could have different parameters for the two types of clouds,
# and different patterns.
NAME:   nemelex_altar_shiori
TAGS:   no_pool_fixup no_monster_gen no_item_gen decor no_rotate
TAGS:   layout_rooms layout_city layout_open buniq_s_overflow_glass
SUBST:  e : dd', d : n', g : f', f : nn', i : hh', h : nn', k : j' , j : n'
SUBST:  G : GGTTUUbl
KPROP:  'RS = no_tele_into
MARKER: R = lua:fog_machine { cloud_type="calcifying dust", walk_dist=1, \
            size=9, pow_max=20, delay=10, buildup_amnt=14, buildup_time=7, \
            spread_rate=3, start_clouds=1 }
MARKER: S = lua:fog_machine { cloud_type="foul pestilence", walk_dist=1, \
            size=9,  pow_max=20, delay=10, buildup_amnt=14, buildup_time=7, \
            spread_rate=3, start_clouds=1 }
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
cccccccc+++cccccccc
cnnnnnnn...nnnnnnnc
cnde'edn...nfg'gfnc
cne'''en.G.ng'''gnc
cn''S''n...n''R''nc
cne'''en...ng'''gnc
cnde'edn...nfg'gfnc
cnnnnnnn...nnnnnnnc
cG......._.......Gc
cnnnnnnn...nnnnnnnc
cnhi'ihn...njk'kjnc
cni'''in...nk'''knc
cn''R''n...n''S''nc
cni'''in.G.nk'''knc
cnhi'ihn...njk'kjnc
cnnnnnnn...nnnnnnnc
cccccccc+++cccccccc
ENDMAP

NAME:    nemelex_dance_club_becter
TAGS:    transparent no_rotate no_vmirror no_monster_gen no_item_gen
# orc and ogre depth
DEPTH:   D:3-7
: if you.depth() <= 4 then
MONS:    orc ; club
: else
MONS:    ogre ; giant club
: end
MONS:    endoplasm
SHUFFLE: 12_
# This doesn't show up in tiles due to not defining any particular floor tiles
# with colour variants. This is fine, since it'd be excessively visually busy.
COLOUR:  x = darkgray
COLOUR:  12' = random
TILE:    x = wall_pebble_darkgray
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
    .....
   ..xxx..
   .xx'xx.
 ...x'1'x...
..xxxx'xxxx..
.xx''x+x''xx.
.x'2'+.+'_'x.
.xx'xx.xx'xx.
..xxx.x.xxx..
 .....x.....
    .xxx.
    .....
ENDMAP

NAME:   nemelex_diamond_rough_becter
TAGS:   transparent decor
COLOUR: x = lightred
COLOUR: 'b = silver
TILE:   x = wall_pebble_red
TILE:   b = dngn_crystal_white
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
    ...
   ..x..
  ..xxx..
 ..xxbxx..
..xxb'bxx..
.xxb'_'bxx.
..xxb'bxx..
 ..x+b+x..
  ..xxx..
   ..x..
    ...
ENDMAP

NAME:   nemelex_lonely_heart_becter
TAGS:   transparent decor no_wall_fixup
TAGS:   no_rotate no_vmirror no_monster_gen no_item_gen vaults_room_empty
DEPTH:  D:3-, Vaults, Depths
# Boris misses Natasha, Bai Suzhen misses Xu Xian,
# Maggie fled her order, and Jessica wants to study alone.
: if you.in_branch("Depths") then
MONS:   boris
: elseif you.in_branch("Vaults") then
MONS:   bai suzhen
: elseif you.depth() > 7 then
MONS:   maggie
: else
MONS:   jessica
: end
SUBST:  1 = 1....
TILE:   x = wall_pebble_red
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, false)
MAP
  .... ....
 ..xx...xx..
..xxxx.xxxx..
.xx..x+x..xx.
.xx.......xx.
..xx.._..xx..
 ..xx.1.xx..
  ..xx.xx..
   ..xxx..
    .....
ENDMAP

NAME:   nemelex_spade_bored_becter
TAGS:   transparent decor no_rotate no_vmirror no_monster_gen no_item_gen
:  if you.depth() ~= dgn.br_depth(you.branch()) then
KFEAT:  a = shaft trap
:  end
NSUBST: ' = 6:a / *:.
COLOUR: x = darkgray
TILE:   x = wall_pebble_darkgray
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
     .....
    ..xxx..
   ..xx'xx..
  ..xx'''xx..
 ..xx''_''xx..
..xx'''''''xx..
.xx'''''''''xx.
.x'''xxxxx'''x.
.xx'+x.x.x+'xx.
..xxx..x..xxx..
 .....xxx.....
     .....
ENDMAP

NAME:    nemelex_goblin_sharper_dolorous
TAGS:    transparent no_item_gen no_monster_gen no_trap_gen decor
TAGS:    buniq_s_overflow_glass
WEIGHT:  7
MONS:    generate_awake goblin god:nemelex_xobeh name:sharper n_suf n_des n_noc
KMASK:   1 = opaque
KPROP:   1 = no_tele_into
COLOUR:  b = lightmagenta
FTILE:   'G_1m+ = floor_pebble_magenta
TILE:    b = dngn_crystal_lightmagenta
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
 ..bbbbb..
..bbm1mbb..
.bb'mmm'bb.
.b'''''''b.
.bG''_''Gb.
.b'''''''b.
.bb'''''bb.
..bb'''bb..
 ..b+++b..
ENDMAP

NAME:    regret_index_nemelex_hall_of_doors
TAGS:    patrolling no_item_gen no_pool_fixup
DEPTH:   D:3-, Elf, Depths
WEIGHT:  7
SHUFFLE: '!1 / $sS / "%P / `^w
# Mostly looking for the more dangerous options in the pre-Lair-depth selection,
# with mild nods to some of the Summoning deck cards (Swarm, Elements, Dance).
# Even if the choice can't open doors, it's still guarding a vault reward.
: if you.in_branch("D") then
TAGS:    no_monster_gen
:   if you.depth() < 5 then
MONS:    bombardier beetle / clockroach / gnoll
:   elseif you.depth() < 8 then
MONS:    ogre / killer bee / ice beast / marrowcuda / drude
:   elseif you.depth() < 12 then
MONS:    hornet / centaur / ugly thing / rakshasa
:   else
MONS:    fire dragon / ice dragon / very ugly thing / \
         laughing skull band / centaur warrior / dancing weapon
:   end
KITEM:   d$sS = $ q:1
: else
# Past D, we can afford to be mildly meaner about the minigame here.
:   if you.in_branch("Elf") then
MONS:    generate_awake thermic dynamo band / \
         generate_awake dancing weapon ; demon blade ego:chaos | \
         demon trident ego:chaos | broad axe ego:chaos | rapier ego:chaos
:   else -- Depths
MONS:    generate_awake chonchon band / \
         guardian sphinx / juggernaut / tengu reaver
KMONS:   S = golden dragon
:   end
KITEM:   d = $ q:1
KITEM:   $S = $ q:7
: end
KMONS:   P = bush
# An item deliberately unlikely to be of much value, but which default
# autoexplore stops to look at, to emphasize entering a gimmick vault.
KITEM:   ~ = damaged short sword ego:heavy / \
             damaged sling ego:flaming / damaged whip ego:freezing
KITEM:   ! = any potion q:1 / any scroll q:1 w:5
KFEAT:   % = cache_of_fruit
KFEAT:   ^ = teleport trap
KFEAT:   HIJ = G
SUBST:   s = $
FTILE:   '!1 = floor_pebble_red
FTILE:   $sS = floor_pebble_yellow
FTILE:   "%P = floor_pebble_lightgreen
FTILE:   `^w = floor_pebble_lightblue
# To emphasize the game theme, mark the doors with differing statue tiles.
: local stat
: if you.in_branch("Depths") then
:   stat = util.random_subset( {"depths_tomes", "depths_zot_devil",
:               "depths_zot_ancient_evil", "depths_zot_tentacles",
:               "depths_zot_lich", "depths_zot_dragon" }, 4)
:
: else
:   stat = util.random_subset( {"archer", "demonic_bust", "dragon",
:               "hydra", "imp", "mermaid", "princess", "sword" }, 4)
: end
: tile("G = dngn_statue_" .. stat[1])
: tile("H = dngn_statue_" .. stat[2])
: tile("I = dngn_statue_" .. stat[3])
: tile("J = dngn_statue_" .. stat[4])
KPROP:   '!1 = bloody
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
xxxxx       xxxxx
xcccx  ccc  xcccx
xc1ccccc.cccccScx
xcc!'cc.U.cc$sccx
xxc''+.....+$$cxx
  cc++.....++cc
  cc..G.~.H..cc
 cc...........cc
 c.U...._....U.c
 cc...........cc
  cc..I.d.J..cc
  cc++.....++cc
xxc``+..d..+""cxx
xcc^`cc.U.cc"%ccx
xcwcccccdcccccPcx
xcccx  c+c  xcccx
xxxxx       xxxxx
ENDMAP

NAME: nicolae_nemelex_xobeh_five-card_draw
TAGS: transparent decor no_trap_gen
: local cards = util.random_subset({"darkgray", "lightblue", "lightgreen",
: "lightcyan", "lightred", "lightmagenta", "yellow", "white"}, 5)
: colour("p = " .. cards[1])
: colour("q = " .. cards[2])
: colour("r = " .. cards[3])
: colour("s = " .. cards[4])
: colour("z = " .. cards[5])
# Why use the demonic floor tiles? Nemelex's cards are canonically painted in
# the ichor of demons, and the floor tiles here represent a hand of cards.
FTILE: pqrsz = floor_demonic
# We specify the floor tile underneath the altar by color specifically, since
# using a COLOUR directive would recolor the altar itself in console, which is
# not what we want. And by "we" I mean "me".
: ftile("_ = floor_demonic_" .. cards[1])
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
ccccc
cpppcc
cpppqcc
cp_pqrcc
cpppqrscc
cpppqrszc
ccqqqrsz.
 ccrrrsz.
  ccsssz.
   cczzz.
    cc..@
ENDMAP

# An abstract representation of a colorful jester's hat as seen from above.
NAME:    nicolae_nemelex_xobeh_surely_you_jest
TAGS:    transparent decor
KFEAT:   PQRS = c
KFEAT:   pqrs = v
SHUFFLE: Pp/Qq/Rr/Ss
COLOUR:  P = lightred, p = red, Q = lightblue, q = blue
COLOUR:  R = lightgreen, r = green, S = yellow, s = brown
: standard_overflow_setup(_G, { { "nemelex_xobeh", "_" } }, true)
MAP
.........
.r.....s.
..PP.QQ..
..PP.QQ..
...._....
..SS.RR..
..SS.RR..
.q.....p.
.........
ENDMAP

### Okawaru overflow altars ###################################################

NAME:    okawaru_metal_pillars_1_2
TAGS:    transparent decor
DEPTH:   D:3-, Orc
WEIGHT:  7
SHUFFLE: v'
SUBST:   ' = .
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
.....
.v'v.
.'_'.
.v'v.
.....
ENDMAP

NAME:   okawaru_metal_pillars_3
TAGS:   transparent decor vaults_empty
DEPTH:  D:3-, Vaults, Orc
WEIGHT: 3
KFEAT:  ^ = tyrant's trap
: if not you.in_branch("Vaults") then
SUBST:  ^ = .
: end
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
.......
.^.v...
..v.v..
.v._.v.
..v.v..
...v.^.
.......
ENDMAP

NAME:   okawaru_trees_1
TAGS:   transparent decor vaults_empty
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 1 (Vaults), 5
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
.........
.v.t.t.v.
.........
.t.t.t.t.
...._....
.t.t.t.t.
.........
.v.t.t.v.
.........
ENDMAP

NAME:   okawaru_trees_2
TAGS:   transparent decor
WEIGHT: 5
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
...........
.v...t...v.
....t.t....
...t.t.t...
..t.t.t.t..
.t.t._.t.t.
..t.t.t.t..
...t.t.t...
....t.t....
.v...t...v.
...........
ENDMAP

NAME:   okawaru_ov_weapons_minmay
TAGS:   transparent decor vaults_empty
DEPTH:  D:3-, Snake, Vaults, !Vaults:$
WEIGHT: 3 (Vaults), 10
ITEM:   hand axe, falchion, mace, spear
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
   .....
  ...v...
 ...vvv...
...........
..v.e.f.v..
.vv.._..vv.
..v.d.g.v..
...........
 ...vvv...
  ...v...
   .....
ENDMAP

NAME:  okawaru_altar_gauntlet_db
TAGS:  no_pool_fixup
KPROP: 1 = no_tele_into
: if you.in_branch("Depths") then
MONS:  spriggan defender w:3 ; flail . robe . buckler . boomerang /\
       spriggan ; long sword . steam dragon scales . boomerang q:1
: else
MONS:  goblin; stone q:5 / hobgoblin; stone q:5 / gnoll; stone q:5 /\
       orc; stone q:5 / kobold; stone q:5
: end
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
  xxx
xxx_xxx
x1w.wxx
xxw.w1x
x1w.wxx
xxw.w1x
x1w.wxx
xxw.w1x
xxx+xxx
ENDMAP

NAME:   okawaru_gym_becter
TAGS:   transparent decor vaults_empty
DEPTH:  D:3-, Snake, Vaults, !Vaults:$
WEIGHT: 3 (Snake, Vaults), 10
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
   .....
 .........
 .vv...vv.
..v.....v..
....._.....
..v.....v..
 .vv...vv.
 .........
   .....
ENDMAP

NAME:    okawaru_humans
TAGS:    no_monster_gen no_wall_fixup transparent
DEPTH:   D:7-12
COLOUR:  1 = yellow, ' = yellow, x = white
MONS:    human ; long sword . ring mail
FTILE:   1'xO = floor_sandstone
RTILE:   x = wall_tomb
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
.........
.xxxxxxx.
.x1'_'1x.
.x'''''x.
.x'x'x'x.
.xGx'xGx.
.xxx'xxx.
....'....
ENDMAP

NAME:   kennysheep_okawaru_gauntlet
TAGS:   no_pool_fixup transparent
: if you.in_branch("Depths") then
KMONS:  1 = spriggan defender ; demon trident . robe . boomerang
KFEAT:  1 = cache_of_baked_goods
: else
KMONS:  1 = goblin ; spear
: end
KPROP:  1 = no_tele_into
KMASK:  1 = opaque
TILE:   G = dngn_statue_polearm / dngn_statue_axe
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
      vvvvvvv
 .....w1w...v
......www.G.v
@........G_Gv
......www.G.v
 .....w1w...v
      vvvvvvv
ENDMAP

NAME:   hellmonk_okawaru_the_only_friend_you_need
TAGS:   transparent decor vaults_empty vaults_orient_s
DEPTH:  D:3-, Vaults
WEIGHT: 1 (Vaults), 5
KITEM:  ' = any weapon plus:0 ego:spectral pre_id no_pickup
: if you.in_branch("Vaults") then
SUBST:  @ = .
: end
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
vvvv vvvv
v..vvv..v
v.......v
vvv...vvv
  v._.v
vvv.'.vvv
v.......v
v..v+v..v
vvvv@vvvv
ENDMAP

# After much consideration, I decided this should go with the other overflow
# altars, rather than with the other guarded unrand vaults, since the majority
# of the tags are for its role as an overflow.
NAME:   nicolae_overflow_guarded_unrand_okawaru_victory
TAGS:   transparent
DEPTH:  D:3-9
WEIGHT: 3
KPROP:  `SLps = no_tele_into
: if you.depth() < 6 then
KMONS:  S = gnoll bouda band / gnoll sergeant band
KMONS:  ps = gnoll / orc / ogre w:5 / centaur w:5 / nothing
: elseif you.depth() < 8 then
KMONS:  S = wight band / kobold brigand band / orc warrior band
KMONS:  ps = ogre / centaur / wight / nothing
: else
KMONS:  S = two-headed ogre / troll / gargoyle
KMONS:  ps = orc warrior / kobold brigand / wight / troll w:5 / gargoyle w:5 / \
             two-headed ogre w:5
: end
KITEM:  S = victory no_pickup
KITEM:  p = any potion no_pickup
KITEM:  s = any scroll no_pickup
SUBST:  c : ccccv
NSUBST: L = 2=p / 2=s
: standard_overflow_setup(_G, { { "okawaru", "_" } }, false)
MAP
xxc@@@cxxxxxxxx
xxc...cxxxxxxxx
xcc...ccccccccx
xcG...GcG`L`Gcx
xc.....c````Lcx
xc.._..=``S``cx
xc.....c````Lcx
xcG...GcG`L`Gcx
xcc...ccccccccx
xxc...cxxxxxxxx
xxc@@@cxxxxxxxx
ENDMAP

# This still uses the iron statue description intended for Dis:7. It still
# kind of works, though.
NAME:  nicolae_okawaru_hey_there's_oka_statue_tiles
TAGS:  transparent decor
KFEAT: G = metal_statue
TILE:  G = dngn_oka_iron_statue
: set_feature_name("metal_statue", "iron statue")
: standard_overflow_setup(_G, { { "okawaru", "_" } }, true)
MAP
.........
..vvvvv..
.vvGvGvv.
.v.....v.
......_v.
.v.....v.
.vvGvGvv.
..vvvvv..
.........
ENDMAP

### Qazlal overflow altars ####################################################

# There's always a safe path to the altar.
NAME:   grunt_qazlal_clouds
TAGS:   transparent no_monster_gen no_item_gen no_trap_gen decor
: single_cloud(_G, "L", "flame", true)
: single_cloud(_G, "M", "freezing vapour", true)
: single_cloud(_G, "N", "sparse dust", true)
: single_cloud(_G, "O", "rain", true)
SHUFFLE: LMNO
KPROP:   LMNO- = no_tele_into
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
ccc@ccc
cL-.-Mc
c-...-c
@.._..@
c-...-c
cN-.-Oc
ccc@ccc
ENDMAP

NAME:   grunt_qazlal_sundering
TAGS:   no_monster_gen no_item_gen no_trap_gen
: if you.depth() ~= dgn.br_depth(you.branch()) then
KFEAT:  ^ = shaft trap
: else
KFEAT:  ^ = floor
: end
KPROP:  -c = no_tele_into
SUBST:  c = cccl^.
SUBST:  - = ..l^
KITEM:  . = nothing w:189 / stone / large rock q:1 w:1
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
 ----@----
-ccc-.-ccc-
-ccc-.-ccc-
-ccc-.-ccc-
-----.-----
@...._....@
-----.-----
-ccc-.-ccc-
-ccc-.-ccc-
-ccc-.-ccc-
 ----@----
ENDMAP

NAME:  nicolae_qazlal_eye_of_the_storm
TAGS:  no_trap_gen no_item_gen no_monster_gen decor buniq_s_overflow_glass
KPROP: 'd = no_tele_into
KMONS: d = diamond obelisk
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
 ccccccccccccc
 c'''''''''''c
 c'''''''''''c
 c'''''''''''c
 c'''''''''''c
@nnnnnn''''''c
@...._nd'''''c
@nnnnnn''''''c
 c'''''''''''c
 c'''''''''''c
 c'''''''''''c
 c'''''''''''c
 ccccccccccccc
ENDMAP

NAME:    nicolae_qazlal_style_of_elements
# Doesn't count as a glass exhibit due to the escapees.
TAGS:    no_trap_gen no_item_gen no_monster_gen transparent decor
SHUFFLE: Cf / Da / Ee / Fw
DEPTH:   D:5-, Elf
KPROP:   faew = no_tele_into
KMASK:   faew = opaque
# Deliberately let the earthen wallwalking monster leave,
# to play on all the other vaults where they can't.
: if you.in_branch("D") then
KMONS:   f = fire bat
KMONS:   a = sky beast
KMONS:   e = rock fish
KMONS:   w = ice beast
: else
KMONS:   f = fire elemental
KMONS:   a = air elemental
KMONS:   e = earth elemental
KMONS:   w = water elemental
: end
KFEAT:   f = lava
KFEAT:   w = deep_water
KFEAT:   CDEF = c
KPROP:   e = no_tele_into
: single_cloud(_G, "a", "thin mist", false)
: single_cloud(_G, "e", "sparse dust", false)
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
TILE:   C = wall_stone_scorched
TILE:   DEF = wall_stone_gray
MAP
CCC.@.DDD
Cfn...naD
Cnn...nnD
.........
...._....
.........
Fnn...nnE
Fwn...neE
FFF...EEE
ENDMAP

# general_overflow_altar cannot contain the power of Qazlal
NAME:    nicolae_qazlal_general_emergency
TAGS:    no_monster_gen no_pool_fixup transparent decor no_descent
KMONS:   1 = pile of debris
KFEAT:   1 = w
SHUFFLE: xXY / xXY / xXY / abc
SHUFFLE: XY
SUBST:   z = w.., X = +++w., Y = 11xxw., x = wxxx, a = w, b = w, c = w
SHUFFLE: ABC_
SUBST:   A = >, B = 'GTU, C = '
SHUFFLE: 1w / ll / ll
KMASK:   _>'GTU = opaque
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
...........z.
.z...z.zzz...
..zz.z.wwwz..
..wxXYYxwwz..
.zwwwwwwxwz..
zwwxwA_wxz...
zwwxwBCwx..z.
.zzxwwwwx.z..
...xxxwxxwz..
.z...zwwwz...
...z..zzz....
...........z.
ENDMAP

NAME: nicolae_qazlal_scattered_showers
# The rain is localized to a 5x5 square centered on the altar.
# There's some rain water that occasionally gets deep but it's passable.
TAGS:   transparent decor no_trap_gen
MARKER: _ = lua:fog_machine { cloud_type = "rain", pow_min = 10, \
    pow_max = 15, delay_min = 5, delay_max = 15, size = 1, walk_dist = 2, \
    spread_rate = 0 }
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
.......
.......
.......
..._...
.......
.......
.......
ENDMAP

# (With the sky beast revisions, they've been taken out of D:3 despite
# technically being in the D:3 out-of-depth pool as D:6 monsters; we'll
# have to wait some versions before more people respect af_airstrike.)
NAME:    nicolae_qazlal_beasts_of_the_sky
TAGS:    transparent
DEPTH:   D:4-8
KMONS:   _ = sky beast
SHUFFLE: Pp, Qq
SUBST:   PQ = x, pq = m
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
.........
...Q.q...
..P...p..
.Q.....q.
...._....
.q.....Q.
..p...P..
...q.Q...
.........
ENDMAP

NAME:    regret_index_qazlal_gathering_storm
DEPTH:   D:5-, Elf, Depths, !Depths:$, Zot, !Zot:$
: if you.in_branch("D") then
:   if you.depth() < 8 then
MONS:    fire bat, ice beast / white imp w:2
SUBST:   $>}3 = ., % = $
:   elseif you.depth() < 12 then
MONS:    killer bee simulacrum, basilisk, fire elemental
SUBST:   >} = .
:   else
MONS:    fire elemental / fire crab w:2, water elemental / freezing wraith w:2
MONS:    tengu conjurer w:2 / gargoyle w:2 / deep elf zephyrmancer
SUBST:   > = 12, } = %
:   end
: elseif you.in_branch("Elf") then
MONS:    air elemental, thermic dynamo, deep elf elementalist
SUBST:   > = $, }% = %*|
: elseif you.in_branch("Depths") then
:   if crawl.coinflip() then
MONS:    fire giant / frost giant, spark wasp, golden dragon
:   else
MONS:    spriggan air mage, stone giant, tengu reaver
:   end
SUBST:   > = $, } = *, % = *|, x = b
: else -- Zot
MONS:    golden dragon, draconian stormcaller, electric golem
KITEM:   $ = gold q:1 no_pickup
SUBST:   . = $, % = *|
SHUFFLE: }])>
: end
: if you.in_branch("D") and you.depth() < 12 then
SUBST:   y : x., z : x., b = x, YZ = x
: else
SUBST:   y : xxb.., z : xxb.., Y : xxx., Z : xxxb.
: end
: if you.in_branch("Elf") then
TILE:    x = wall_hall_darkgray
: elseif you.in_branch("Zot") then
TILE:    x = wall_zot_darkgray
: else
TILE:    x = wall_pebble_darkgray
: end
: standard_overflow_setup(_G, { { "qazlal", "_" } }, false)
MAP
          xxxxxx
         xx.zz.xx
 x@@x    x.1..2.x
xx..xx   x......x
@....x   x......x
@....xx xx......xxxxxxx
xx..Y.xxx.Z.yy.Y.xxxxxxx
 xxx.Z.y.Y.xxxx.Z..y.$xxx
   xx.....xx  xx.....y%xx
    x.....x   xx..>....xx
    x...1.x   xx...}...xx
    xx.z.xx   xx....3.2xx
     xxxxx    xx$z..._.xx
              xxx%.z1.bxx
               xxxxxxxxx
                xxxxxxx
ENDMAP

NAME:    regret_index_qazlal_strikes
TAGS:    transparent decor zotdec
DEPTH:   D:3-, Shoals, Depths, Zot
WEIGHT:  3
SHUFFLE: ABCD, '"
: if you.in_branch("D") then
KFEAT:   ABCD = rock_wall
TILE:    A = wall_pebble_red
TILE:    B = wall_pebble_lightblue
TILE:    C = wall_pebble_cyan
TILE:    D = wall_pebble_yellow
FTILE:   ' = floor_pebble_darkgray
FTILE:   " = floor_pebble_blue
: elseif you.in_branch("Shoals") then
KMONS:   D = pile of debris
KFEAT:   AB = rock_wall
KFEAT:   C = stone_wall
KFEAT:   D = deep_water
TILE:    A = wall_brick_red
TILE:    B = wall_ice
TILE:    C = wall_crystal_squares
FTILE:   ' : floor_vines
SUBST:   ." = W, x = c
: elseif you.in_branch("Depths") then
KFEAT:   ABCD = metal_wall
TILE:    A = dngn_metal_wall_red
TILE:    B = dngn_metal_wall_white
TILE:    C = dngn_metal_wall_cyan
TILE:    D = dngn_metal_wall_brown
FTILE:   ' : floor_nerves_cyan / floor_crystal_squares
FTILE:   " = floor_pebble_darkgray
: else -- Zot
KFEAT:   ABCD = rock_wall
TILE:    A = wall_zot_red
TILE:    B = wall_zot_cyan
TILE:    C = wall_zot_darkgray
TILE:    D = wall_zot_brown
FTILE:   ' : floor_rough_cyan / floor_nerves_cyan
FTILE:   " : floor_crystal_squares / floor_marble
: end
COLOUR:  t = brown
FTILE:   _t = floor_pebble_darkgray
TILE:    t = dngn_tree_dead
: set_feature_name("tree", "dead tree")
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
 ..xxxxxxxxx xxxxxx  xxxxxxx.
 .....A''B"xxx"B''xxxx'''A...
  ....A''B"""""B'''''''A'A.A.
  ....A'''B"""""B''''''''A...
 ....A'''''B"""""B''''''A....
 ....A'''''B""""B'''''''A....
 ....A''''B"""_""B''''''A....
....A''''''B""t"""B''''A....
....A'''''''B""""B'''''A....
....A''''''B"""""B'''''A....
...A''''''''B"""""B'''A....
.A.A'A'''''''B"""""B''A....
...A'''xxxx''B"xxx"B''A.....
.xxxxxxx  xxxxxx xxxxxxxxx..
ENDMAP

NAME:   regret_index_qazlal_sundered_split
TAGS:   transparent no_monster_gen no_item_gen no_trap_gen decor
DEPTH:  D:3-, Depths, Zot
KFEAT:  NO = A
NSUBST: F = 1:L / 1:M / 1:N / 1:O, @ = 2:@ / *:.
: single_cloud(_G, "L", "flame", true)
: single_cloud(_G, "M", "freezing vapour", true)
: single_cloud(_G, "N", "sparse dust", true)
: single_cloud(_G, "O", "rain", true)
KPROP:   LMNO- = no_tele_into
FTILE:   LM = floor_pebble_darkgray
: if you.in_branch("Zot") then
TILE:   x = wall_zot_darkgray
: else
TILE:   x = wall_pebble_darkgray
: end
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
         xxcccc
         @...Fc
          .x..c
        xxxxx.c
ccccxx   xxx..c
cF.....@..xxx.c
c..x..._...x..c
c.xxx..@.....Fc
c..xxx   xxcccc
c.xxxxx
c..x.
cF...@
ccccxx
ENDMAP

# "Aurora borealis? At this time of year, at this time of day, in this branch of
# the dungeon, localized entirely within your altar room?"
NAME:    nicolae_qazlal_console_elemental
TAGS:    transparent decor buniq_e_colour_overflow
WEIGHT:  7
COLOUR:  @._m = elemental
FTILE:   @._m = floor_rough
: standard_overflow_setup(_G, { { "qazlal", "_" } }, true)
MAP
mm@mm
m...m
m._.m
m...m
mmmmm
ENDMAP

# Ru overflow altar vaults ####################################################

# A few unlucky monsters permanently afflicted with Ru's various status effects.
# the monsters in group B should all be non-intelligent, so that TSO won't get upset
# about attacking them while blind. it's a pain for a monster you're not allowed
# to attack to chase you throughout the level
NAME:  nicolae_ru_great_annihilating_truth
TAGS:  transparent no_monster_gen no_item_gen
DEPTH: D:3-
SHUFFLE: MCSBP
KMONS: P = ball python perm_ench:paralysis / rat perm_ench:paralysis / \
  frilled lizard perm_ench:paralysis / \
  quokka perm_ench:paralysis / kobold w:5 perm_ench:paralysis / \
  goblin w:5 perm_ench:paralysis / hobgoblin w:5 perm_ench:paralysis
KMONS: C = bat perm_ench:corona / adder perm_ench:corona / \
  kobold perm_ench:corona / goblin perm_ench:corona / hobgoblin perm_ench:corona
KMONS: S = jackal perm_ench:slow / bat perm_ench:slow / adder perm_ench:slow / \
  kobold perm_ench:slow / goblin perm_ench:slow / hobgoblin perm_ench:slow
KMONS: B = ball python perm_ench:blind / frilled lizard perm_ench:blind / \
  bat perm_ench:blind
KMONS: M = orc wizard perm_ench:mute
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
@...   ...@
.+xxxxxxx+.
.x...x...x.
.x.P.x.C.x.
 x.......x
 xxx._.xxx
 x.......x
.x.S.x.B.x.
.x...x...x.
.+xxxxxxx+.
@...   ...@
ENDMAP

NAME: nicolae_ru_awakened_eye
TAGS: transparent decor no_pool_fixup
KFEAT: _ = altar_ru
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
    .......
   .ccccccc.
  .c..WWW..c.
 .c..W...W..c.
.c...W._.W...c.
 .c..W...W..c.
  .c..WWW..c.
   .ccccccc.
    .......
ENDMAP

# Overgrown and disused, since many pilgrims find Ru's sacrifices too onerous.
NAME:   nicolae_ru_the_path_less_chosen
TAGS:   transparent decor no_item_gen no_monster_gen lairdec
DEPTH:  D:3-, Lair, Depths
KMONS:  p = plant / fungus w:3
NSUBST: r = 3=^ / ^p / 7=p / 2:p. / ., i = ^^p. / 2=p / .
NSUBST: D = . / xxp / x, E = . / xxp / x, F = xxp / .
KFEAT:  ^ = web trap
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
xxxxxxx
xrrrrrxxxxx
xriiirxDFEx
xri_ir.D.E.@
xriiirxDFEx
xrrrrrxxxxx
xxxxxxx
ENDMAP

NAME:  nicolae_ru_sacrificial_ziggurat
TAGS:  transparent decor
SUBST: b = B.., @ = %@@
KPROP: B% = bloody
SUBST: B = ., % = @
TILE:  x = wall_sandstone
FTILE: ' = floor_sandstone
FTILE: .@_ = floor_limestone
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
xxxxxx@xxxxxx
x'''''b'''''x
x'xxxxbxxxx'x
x'x'''b'''x'x
x'x'xxbxx'x'x
x'x'xBBBx'x'x
@bbbbB_Bbbbb@
x'x'xBBBx'x'x
x'x'xxbxx'x'x
x'x'''b'''x'x
x'xxxxbxxxx'x
x'''''b'''''x
xxxxxx@xxxxxx
ENDMAP

NAME: nicolae_ru_path_of_blood
TAGS: transparent decor no_monster_gen
KPROP: , = bloody
KPROP: l = no_cloud_gen
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
@lcccccccccc
l,......,llc
@l,l,l,l,_lc
l,......,llc
@lcccccccccc
ENDMAP

NAME:   hangedman_ru_absence
TAGS:   transparent decor no_pool_fixup
WEIGHT: 5
SUBST:  X : x., x : cxx, b : cbxx, + : W+++, m : mmw
KMASK:  wW = no_monster_gen
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
......xxxxx......
..x...........x..
xxxxxx.....xxxxxx
..x..x.....x..x..
..x..x.XxX.x..x..
.....+..b..+.....
....xxbbbbbxx....
.....+..b_.+.....
..x..x.XxX.m..m..
..x..x.....m..m..
xxxxxx.....mmmmmm
..x...........m..
......xxxxx......
ENDMAP

# Abstract interpretation of the Ru altar tile.
NAME:  nicolae_ru_balanced_heart_vs_power
TAGS:  transparent decor no_pool_fixup
KPROP: l = no_cloud_gen
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
.....       .....
..v..       .www.
.ccc.........www.
..v.ccc......www.
..v....c_c....v..
.lll......ccc.v..
.lll.........ccc.
.lll.       ..v..
.....       .....
ENDMAP

# Ru said it, not me.
# The code is copied more or less verbatim from nicolae_arrival_memento_mori,
# although a lot of the relevant code in that vault was edited by amalloy, so I
# can't take all the credit.
NAME:   nicolae_ru_cut_away_your_false_body!
TAGS:   transparent decor no_monster_gen uniq_your_own_corpse
WEIGHT: 2
KITEM:  d = dagger
SUBST:  - = `-
KPROP:  du`_ = bloody
FTILE:  du_`-' = floor_w_marble
: local race = you.race()
: local mons = you.monster()
: local yourname = string.gsub(you.name(), " ", "_")
: -- The corpseless. Before the game starts, you.monster() is "program bug".
: if (not crawl.game_started())
:     or race == "Mummy" or race == "Gargoyle" or race == "Vine Stalker"
:     or race == "Poltergeist" or race == "Revenant" or race == "Djinni"
:     or race == "Yak" then
:   mons = "human"
: end
: dgn.delayed_decay(_G, 'u', mons .. " name:" .. yourname .. " corpse")
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
xxxxxxxxxxx
xxx---''''x
@..-u`d`_'x
xxx---''''x
xxxxxxxxxxx
ENDMAP

# Ignore the distractions.
NAME:    nicolae_ru_illusory_world
TAGS:    no_monster_gen no_item_gen no_trap_gen transparent decor
# Lowered weight, since it's a weird and slightly obnoxious one.
WEIGHT:  1
KITEM:   d = any weapon good_item mimic
KITEM:   e = plate armour good_item mimic
KITEM:   f = randbook mimic
KITEM:   g = gold good_item mimic
KITEM:   h = any manual mimic
KITEM:   i = scroll of acquirement pre_id mimic
KITEM:   j = potion of experience pre_id mimic
KFEAT:   G = G mimic
KFEAT:   c = c mimic
SHUFFLE: defghij
: standard_overflow_setup(_G, { { "ru", "_" } }, true)
MAP
xxxxxxxxx
xcccccccx
xcG.e.Gcxxx.
xc.....G.G..
xcd._......@
xc.....G.G..
xcG.f.Gcxxx.
xcccccccx
xxxxxxxxx
ENDMAP

### Sif Muna overflow altars ##################################################

NAME:   lemuel_blue_sif_altar
TAGS:   transparent no_monster_gen decor
DEPTH:  D:3-, Vaults
WEIGHT: 3 (Vaults), 10
COLOUR: . = blue
FTILE:  .@*+_ : floor_hall / floor_mystic_chasm
: if you.in_branch("Vaults") then
CLEAR:  x
: end
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
xxxxxxxxxxxxxx
...........xxx
@..........+_x
...........xxx
xxxxxxxxxxxxxx
ENDMAP

NAME:   tgw_sif
TAGS:   no_item_gen no_monster_gen no_pool_fixup
: if you.absdepth() <= 4 then
MONS:   Jessica
: elseif you.absdepth() <= 6 then
MONS:   orc wizard w:15 / Blorkula the orcula
: elseif you.in_branch("Depths") then
MONS:   lich
: else
MONS:   orc wizard
: end
NSUBST: M = 1:1 / *:"
SUBST:  ' : "'., ' = ''.
FTILE:  ._ : floor_mystic_chasm / floor_grey_dirt w:20
COLOUR: . = blue
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
     xx@xx
     x...x
     x...x
   xxx...xxx
  xx'''''''xx
 xx'''...'''xx
 x'''.www.'''x
xx''.wwwww.''xx
x''.wwM"Mww.''x
x''.wwM>Mww.''x
x''.wwMMMww.''x
xx''.wwwww.''xx
 x'''.www.'''x
 xx'''...'''xx
  xx'''''''xx
   xxx...xxx
     x._.x
     x...x
     xxxxx
ENDMAP

NAME:   led_sif_book
TAGS:   no_item_gen no_pool_fixup no_monster_gen
DEPTH:  D:3-, Orc
KPROP:  1d = no_tele_into
KFEAT:  d = escape_hatch_down
KITEM:  d = parchment slevel:1
MONS:   orc wizard
COLOUR: .@+1 = blue
FTILE:  .@+1G_ = floor_marble
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
xxxxxxxxx
xbbbbx..xx
x1w..xG..x
xdw..+._.@
x1w..xG..x
xbbbbx..xx
xxxxxxxxx
ENDMAP

NAME:   led_sif_pool
TAGS:   transparent no_item_gen no_monster_gen no_pool_fixup decor
KFEAT:  _ = altar_sif_muna
COLOUR: . = blue
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
 xxx@xxx
 xxx+xxx
xxWW.WWxx
xWWW.WWWx
xWW...WWx
xWW._.WWx
xWW...WWx
xWWWWWWWx
xxWWWWWxx
 xxxxxxx
ENDMAP

NAME:   nicolae_sif_muna_condensation
TAGS:   transparent no_trap_gen no_pool_fixup decor
MARKER: _ = lua:fog_machine { cloud_type = "magical condensation", \
    pow_min = 5, pow_max = 15, delay_min = 5, delay_max = 20, size = 1, \
    walk_dist = 3, spread_rate = 1 }
FTILE:  ._w = floor_marble
COLOUR: . = blue
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
.......
.wwwww.
.wwwww.
..._ww.
.wwwww.
.wwwww.
.......
ENDMAP

NAME:   nicolae_sif_muna_little_library
TAGS:   temple_overflow_1 no_trap_gen
TAGS:   vaults_orient_n vaults_orient_e vaults_orient_s
DEPTH:  D:3-, Vaults, Depths
WEIGHT: 3 (Vaults), 10
KITEM:  a = any randbook pre_id owner:Sif_Muna slevels:1
KPROP:  a = no_tele_into
KMASK:  a = no_item_gen
KMASK:  a = no_monster_gen
: if you.in_branch("Vaults") then
SUBST:  D = .
CLEAR:  x
: else
NSUBST: D = 1:+ / *:x
: end
COLOUR: a.mc+ = blue
FTILE:  a._mc+ = floor_marble
TILE:   c = wall_studio
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
xxxxDDDx
xccc...D
xcam...D
xcam._.D
xcam...D
xccc...D
xxxxDDDx
ENDMAP

NAME:   kennysheep_orc_sif_temple
TAGS:   no_item_gen no_monster_gen no_trap_gen no_pool_fixup transparent
DEPTH:  D:4-, Orc
: if you.absdepth() < 7 then
MONS:   orc wizard, orc
NSUBST: 1 = 1:1 / 1:1. / 1:$ / *:.
: elseif you.absdepth() < 12 then
MONS:   orc wizard, orc warrior
NSUBST: 1 = 3:1 / 1:1. / 1:% / 1:$ / *:.
: else
MONS:   orc sorcerer, orc knight, orc wizard
NSUBST: 1 = 1:1 / 1:1. / 2:3 / 2 = %%* / *:.
: end
TILE:   G = dngn_statue_princess / dngn_statue_cat / dngn_statue_mermaid / \
            dngn_statue_tengu / dngn_statue_twins / dngn_statue_maw
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
     xxxxx
   xxxwwwxxx
  xxwwwwwwwxx
 xxww.vvv.wwxx
 xww.nv_vn.wwx
xxww.v111v.wwxx
xwww.v1d1v.wwwx
xxww.nv1vn.wwxx
 xwwwWv+vWwwwx
 xxwwWG.GWwwxx
  xxww.2.wwxx
   xxxv.vxxx
     x...x
     xG.Gx
       @
ENDMAP

NAME:   hellmonk_sif_muna_bookshelves
TAGS:   transparent decor vaults_empty vaults_orient_s
DEPTH:  D:3-, Elf, Vaults, Depths
WEIGHT: 3 (Vaults), 10
TILE:   c = wall_studio
FTILE:  ._c = floor_studio
: if you.in_branch("Vaults") then
SUBST:  @ = .
CLEAR:  x
: end
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
   xxxxx
  xxcccxx
 xxc...cxx
xxc.....cxx
xc.......cx
xc..c.c..cx
xc.......cx
xc..._...cx
xc.......cx
xc..c.c..cx
xc.......cx
xxc.....cxx
 xxc...cxx
  xx@@@xx
ENDMAP

# Based on a suggestion from regret-index.
NAME:   nicolae_sif_muna_archmage's_trap
TAGS:   transparent no_pool_fixup
DEPTH:  D:3-10
KMONS:  1 = orc wizard
KFEAT:  ~ = archmage's trap
COLOUR: @` = blue
FTILE:  @`~_ = floor_mystic_chasm
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
xxxxxxxxxx
xxxxxx```x
xwww1.`_`x
xwww.ww``x
xww``ww.xx
x..`~`.1xx
x.ww``wwxx
``ww.wwwxx
```..wwwxx
@``xxxxxxx
ENDMAP

NAME:   nicolae_sif_muna_console_shimmering_blue
TAGS:   transparent decor buniq_e_colour_overflow
WEIGHT: 7
COLOUR: c = shimmer_blue
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
.c.c.
.....
c._.c
.....
.c.c.
ENDMAP

NAME:   nicolae_sif_muna_just_conduit
TAGS:   transparent decor
WEIGHT: 7
KFEAT:  - = +
COLOUR: c.- = blue
FTILE:  c.+-G_ = floor_marble
# Since Sif specializes in all kinds of magic, any conduit works here.
: local conduittype = {"arcane", "dimensional", "misfortune",
:   "soul", "fiery", "alchemical", "icy", "earthen", "storm"}
: local whichconduit = crawl.random2(#conduittype) + 1
: vault_metal_statue_setup(_G, "G", conduittype[whichconduit] .. " conduit")
: standard_overflow_setup(_G, { { "sif_muna", "_" } }, true)
MAP
xxxxxxx
xcccccx+xx
xc...c...x
xc._.-.G.+
xc...c...x
xcccccx+xx
xxxxxxx
ENDMAP

### Trog overflow altars ######################################################

NAME:  bloody_trog
TAGS:  transparent decor
KPROP: . = bloody / nothing
KITEM: _ = animal skin, dagger
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
...
._.
...
ENDMAP

NAME:   trog_ov_bears_minmay
# begin at bear range
DEPTH:  D:4-
: if you.absdepth() < 10 then
MONS:   black bear
: else
MONS:   polar bear
FTILE:  '_12 = floor_frozen
: end
MONS:   bush
NSUBST: ' = 2:2 / 2 = 2' / *:'
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
.....
.'''.
.1_1.
.'''.
.....
ENDMAP

NAME:   tgw_trog
TAGS:   no_item_gen no_monster_gen patrolling
KPROP:  1 = no_tele_into
: if you.absdepth() < 16 then
MONS:   moth of wrath, rat / ribbon worm w:5
: else
MONS:   moth of wrath, fire dragon / ice dragon w:5
: end
ITEM:   any weapon
NSUBST: M = 4:d / *:.
SUBST:  + = +....
KFEAT:  o = iron_grate
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
   xxxxxxx
  xxxMMMxxx
 xxMMM2MMMxx
xxMM22_22MMxx
xx.........xx
x....ooo....x
x...oo1oo...x
x....ooo....x
x...........x
xx.........xx
 xx.......xx
  xxxx+xxxx
    xx@xx
ENDMAP

NAME:   trog_antimagical
TAGS:   transparent patrolling
# range of orc + orc warrior
DEPTH:  D:3-12
WEIGHT: 4
: if you.absdepth() > 5 then
KMONS:  1 = ogre god:trog ; giant club ego:antimagic | w:3 giant club / \
        ogre god:trog ; giant spiked club ego:antimagic | w:5 giant spiked club / \
        orc warrior god:trog ; halberd ego:antimagic | war axe ego:antimagic | \
        flail ego:antimagic | great mace ego:antimagic | any weapon / \
        kobold brigand god:trog ; short sword ego:antimagic | dagger ego:antimagic | \
        rapier ego:antimagic | rapier
SUBST:  2 = 1
: else
KMONS:  1 = orc god:trog ; spear ego:antimagic | hand axe ego:antimagic | \
        war axe ego:antimagic | any weapon / \
        kobold god:trog ; short sword ego:antimagic | hand axe ego:antimagic | \
        club ego:antimagic | whip ego:antimagic | any weapon / \
        goblin god:trog ; dagger ego:antimagic | short sword ego:antimagic / \
        gnoll god:trog ; spear ego:antimagic | trident ego:antimagic | \
        halberd ego:antimagic | whip ego:antimagic | halberd | any weapon
KMONS:  2 = brain worm
SUBST:  2 = 112
: end
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
  xxxxx
 xx.2.xx
xx.._..xx
x..1.1..x
x.......x
x.G...G.x
xx.....xx
 xx@@@xx
ENDMAP

NAME:   trog_butcher_becter
TAGS:   no_monster_gen no_item_gen transparent
DEPTH:  D:3-, Orc, !Orc:$
: if you.absdepth() < 6 then
MONS:   orc ; hand axe . animal skin
MONS:   rat / frilled lizard / quokka w:20
: else
MONS:   orc warrior ; war axe . animal skin
MONS:   iguana / scorpion
: end
KFEAT:  d = cache_of_meat
NSUBST: ' = 3:2 / *:.
SUBST:  y = x, " = .
KPROP:  1y" = bloody
: if you.depth() ~= dgn.br_depth(you.branch()) then
KFEAT:  ^ = shaft trap
: end
KFEAT:  m = iron_grate
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
  xxxxxxx
 xx''''dxx
xx'xxxxxxxx
xx+xmmmx^yx
xx.."1"""yx
xx..._"..xx
 xx.....xx
  xx...xx
     @
ENDMAP

NAME:   trog_hazing_becter
TAGS:   transparent no_monster_gen no_item_gen no_pool_fixup
DEPTH:  D:3-
MONS:   goblin ; stone q:5 . animal skin / \
        hobgoblin ; stone q:5 . animal skin / \
        kobold ; stone q:5 | throwing net q:1 . animal skin
ITEM:   stone
NSUBST: D = 6=1 / .
SUBST:  . = d....
KFEAT:  m = iron_grate
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
  xxxxx
 xxmmmxx
xx.._..xx
xDw...wDx
xDWw.wWDx
xDDw.wDDx
xxDw.wDxx
 xxx.xxx
  xx@xx
ENDMAP

NAME:   trog_three_pillars_becter
TAGS:   transparent decor
SUBST:  y = x.., z = xx.
KPROP:  v = bloody
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
 ..........
.......yy..
..yy..zxxy.
.yxxz.xvxy.
.yxv...xxy.
.yxx._.....
.......xy..
.....zvxy..
   ..yxxy..
   ...yy...
    ......
ENDMAP

NAME:    regret_index_trog_carnage_carrion
TAGS:    transparent no_monster_gen
DEPTH:   D:5-8, Snake, Spider, Depths, Zot, !Zot:$
: if you.in_branch("D") then
MONS:    bes kemwar / brain worm w:2, phantom
ITEM:    hand axe / mace, animal skin / ring mail
NSUBST:  1 = 2:1 / 1:1222. / 1:2. / *:., ") = 4:? / 2:d / 2:e / 7:' / *:.
:   dgn.delayed_decay(_G, '?', 'elf corpse')
: elseif you.in_branch("Snake") then
MONS:    mana viper, anaconda
ITEM:    war axe / battleaxe / great mace, chain mail / barding w:1
NSUBST:  1 = 2:1 / 2:2 / 2 = 12. / *:., ") = 5:? / 2:d / 9:' / *:.
:   dgn.delayed_decay(_G, '?', 'naga corpse')
: elseif you.in_branch("Spider") then
MONS:    ghost moth, culicivora / death scarab w:2
ITEM:    war axe / battleaxe / great mace, chain mail / plate armour
NSUBST:  1 = 1:1 / 4:2 / *:., ") = 5:? / 2:d / 9:' / *:.
:   dgn.delayed_decay(_G, '+', 'ghost moth corpse')
:   dgn.delayed_decay(_G, '?', 'orc corpse')
: elseif you.in_branch("Depths") then
# Not exactly animal-focused like the rest, but the native population of
# the branch allows a lot of easy Trog-themed monster calls.
MONS:    spriggan berserker, stone giant / quicksilver dragon w:2
ITEM:    broad axe / battleaxe / executioner's axe / great mace w:20
ITEM:    fire dragon scales / ice dragon scales / plate armour
NSUBST:  1 = 3:1 / 1:12 / 1:112 / *:., ") = 7:? / 3:d / 2:e / 9:' / *:.
SUBST:   B : BBt, C : CCt
:   dgn.delayed_decay(_G, '?', 'elf corpse')
: else -- Zot
MONS:    ghost moth / quicksilver dragon w:2
MONS:    moth of wrath / spectral draconian monk
ITEM:    battleaxe good_item / executioner's axe / great mace good_item
ITEM:    ring mail / cloak
NSUBST:  1 = 3:1 / *:2, ) = 1:})]>> / *:", " = 9:? / 3:d / 5:e / *:'
:   dgn.delayed_decay(_G, '`', 'ghost moth corpse')
:   dgn.delayed_decay(_G, '?', 'base draconian corpse')
: end
KFEAT:   z = rock_wall
SUBST:   A : zz., B : zz., C : zz., D : zz., E : zz.
KPROP:   'de? = bloody
KPROP:   z = bloody w:1 / nothing w:4
KPROP:   . = bloody w:1 / nothing w:19
: standard_overflow_setup(_G, { { "trog", "_" } }, true)
MAP
      c   c
      x xxxxx
    c xxx.+`x.x
    xxx...+`..A@x
  cxx"..".xx....xx
   x"x."..+x..x..@
cxxx.."...+`..Ax.Ax
  x..".B.CxC.......
 xx."...x.x.D.....xx
 x.....C.)xx.C.xx..x
cx"x1D"E"..xxxxxxxxxc
 x.....C.).).C.....x
 xx."d..x.".x.._".xx
  x.1".B.CEC.B."1.x
cxxx.."..."..."..xxxc
   x"x."..D..".x"x
  cxx".1".1."1."xxc
    xxx...x...xxx
    c xxx.".xxx c
      x xxxxx x
      c   c   c
ENDMAP

NAME:   nicolae_trog_berserking_free_trial
TAGS:   transparent patrolling
DEPTH:  D:3-10
KMONS:  1 = kobold ; dart ego:datura
KMONS:  2 = kobold brigand ; dart ego:datura
KFEAT:  M = iron_grate
: if you.depth() >= 8 then
SUBST:  1 = 2
: elseif you.depth() >= 6 then
NSUBST:  1 = 1 / 112
: elseif you.depth() < 5 then
NSUBST: 1 = 1 / .
: end
# If you.depth() == 5, no change to the map -> two kobolds
: standard_overflow_setup(_G, { { "trog", "_" } }, false)
MAP
.........
.xM...Mx.
.x1._.1x.
.xM...Mx.
.........
ENDMAP

### Uskayaw overflow altars ###################################################

NAME:   dancing_weapons_uskayaw
TAGS:   transparent buniq_s_overflow_glass
MONS:   generate_awake dancing weapon ; dagger | hand axe
NSUBST: ' = 2:1 / *:'
KMASK:  1' = no_monster_gen
KMASK:  1' = no_item_gen
KMASK:  1' = no_trap_gen
KMASK:  1' = opaque
KPROP:  1' = no_tele_into
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
.......
.mmmmm.
.m'''m.
.m'''m.
.mmmmm.
.......
..._...
 .....
ENDMAP

NAME:    eat_drink_and_be_merry_uskayaw
TAGS:    transparent
SHUFFLE: def
ITEM:    any potion q:1, any weapon no_pickup
KFEAT:   f = cache_of_fruit / cache_of_meat
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
...........
.G.......G.
...........
.c.......c.
....def....
.G..._...G.
....ccc....
  .......
ENDMAP

NAME:    nicolae_uskayaw_dance_hall
# Either a square dance or a round dance depending on how the shuffle goes.
TAGS:    transparent decor
SHUFFLE: Gg
SUBST:   g : ., b : bvcmn
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
xxxx.........
x......GgG...
x.b...g...g..
x....G.....G.
 ._..g.....g.
x....G.....G.
x.b...g...g..
x......GgG...
xxxx.........
ENDMAP

NAME:   nicolae_uskayaw_dance_studio
TAGS:   transparent no_monster_gen patrolling
# kobold brigand depth
DEPTH:  D:6-11
KMONS:  _ = kobold brigand band
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
xxxx+xxxx
xmmm.mmmx
xm.....mx
xm.....mx
xm.._..mx
xm.....mx
xm.....mx
xmmmmmmmx
xxxxxxxxx
ENDMAP

NAME:   nicolae_uskayaw_en_pointe
TAGS:   transparent no_trap_gen generate_awake decor buniq_s_overflow_glass
KPROP:  'D = no_tele_into
MONS:   dancing weapon ; mundane short sword
MONS:   dancing weapon ; mundane falchion, dancing weapon ; mundane spear
MONS:   dancing weapon ; mundane dagger
NSUBST: D = 2=1 / 2=2 / 2=3 / 2=4
KFEAT:  _ = altar_uskayaw
KMASK:  '1234n = opaque
KMASK:  '1234 = no_item_gen
KMASK:  '1234 = no_monster_gen
TILE:   n = dngn_transparent_stone_red
TILE:   c = dngn_stone_wall_lightred
COLOUR: n = red
COLOUR: c = lightred
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
 .............
...nnnnncccc...
..nnD'Dnn..ccc.
..nDn'nDnn...c.
@.n''n'''n._.+.
..nDn'nDnn...c.
..nnD'Dnn..ccc.
...nnnnncccc...
 .............
ENDMAP

NAME:   nicolae_uskayaw_murder_on_the_dancefloor
# But you'd better not kill the groove.
TAGS:   transparent decor buniq_e_colour_overflow
NSUBST: . = 4=D / 3=D.
SUBST:  . = ..a, D = DDE
: dgn.delayed_decay(_G, "DE", "random corpse")
KPROP:  aE = bloody
KFEAT:  b = .
COLOUR: ._aDE = disco
FTILE:  ._aDE = floor_pebble
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
xxxx@xxxx
x.......x
x.......x
x.......x
@..._...@
x.......x
x.......x
x.......x
xxxx@xxxx
ENDMAP

# https://www.youtube.com/watch?v=vpULWBT1WEg
NAME:    nicolae_uskayaw_suspiria
TAGS:    transparent decor
SHUFFLE: Aa, Bb
SUBST:   D : l, E : ...l, F : l, H : .l, J : ...l, K : ...l, L : ...l
SUBST:   M : ...l, N : .lll, O : ...l, P : ...l, Q : ...l
KPROP:   l = no_cloud_gen
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
xxxxxxlll..O..ll
x.FllH.L..ll.JNl
x.....M.ll..P.K.
x_.lll.Q...E.D.@
x.....M.ll..P.K.
x.FllH.L..ll.JNl
xxxxxxlll..O..ll
ENDMAP

# They're here to watch the dance performance, and you interrupted them. Rude.
# Monster list is player species, since we already know those species can
# appreciate the dance.
NAME:   nicolae_uskayaw_dance_theater
TAGS:   transparent
KMONS:  1 = kobold / goblin / hobgoblin / gnoll / orc /
KMONS:  2 = gnoll bouda / ogre w:5 / gnoll sergeant / kobold brigand
KMONS:  3 = orc warrior / troll / vampire / gargoyle / tengu warrior w:5 / \
            deep elf pyromancer w:5 / deep elf zephyrmancer w:5
KMONS:  4 = vampire knight / kobold fleshcrafter / tengu reaver / \
            spriggan defender / deep troll earth mage w:5 / \
            deep troll shaman w:5
KITEM:  4 = % no_pickup / $ no_pickup
: if you.in_branch("D") then
:     if you.depth() <= 6 then
NSUBST: - = 4=1 / 4=1. / .
:     elseif you.depth() <= 11 then
NSUBST: - = 3=2 / 3=1 / 2=12. / .
:     else --D:12-15
NSUBST: - = 3=3 / 3=2 / 2=2233. / .
:     end
: else -- in Depths
NSUBST: - = 4=4 / 4=3 / 4=34 / .
: end
: vault_granite_statue_setup(_G, "G", "broken pillar")
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, false)
MAP
xxxxxxxxxxxxxxxxxxx
xxxxxxGcccccGxxxxxx
xxxxG..c._.c..Gxxxx
xxG.............Gxx
G.....xT-.-Tx.....G
@..x..-xx.xx-..x..@
x..-x...-.-...x-..x
xx..-xxT...Txx-..xx
xx-...-xx.xx-...-xx
xxxx-.........-xxxx
xxxxxx.T...T.xxxxxx
xxxxxxxxx@xxxxxxxxx
ENDMAP

NAME:   nicolae_uskayaw_OPEN_UP_THE_PIT
TAGS:   transparent decor buniq_s_overflow_glass buniq_e_colour_overflow
WEIGHT: 7
: local a = "att:neutral ; nothing"
: kmons("1 = human " .. a .. " / orc " .. a .. " / elf " .. a .. " / " ..
:           "dwarf " .. a .. " / merfolk " .. a .. " / naga " .. " / oni ".. a)
KFEAT:  ` = .
NSUBST: ` = 5=1 / 4=1` / `
KPROP:  1` = no_tele_into
KMASK:  1` = opaque
KMASK:  1` = no_trap_gen
KMASK:  1` = no_item_gen
KMASK:  1` = no_monster_gen
# I've already used disco color for an Uskayaw vault, so instead use Uskayaw's
# altar's elemental console color. Still looks pretty rave-y.
COLOUR: 1m` = incarnadine
FTILE:  1m` = floor_nerves
FTILE:  -_ = floor_pebble
: standard_overflow_setup(_G, { { "uskayaw", "_" } }, true)
MAP
.....
.xxxmxxxxxxx
.x`````m---x
.x`````m---x
.m``m``m-_-+
.x`````m---x
.x`````m---x
.xxxmxxxxxxx
.....
ENDMAP

### Vehumet overflow altars ###################################################

# Rather than put the flame cloud on the altar, flames now surround the
# altar, and the maximum delay between flames has gone away. Thus, standing
# on the altar properly is safe, and a cautious player can time their entrance
# to take no damage.
NAME:   fiery_altar_vehumet
TAGS:   transparent decor
WEIGHT: 8
MARKER: : = lua:fog_machine { cloud_type = "flame", \
               pow_min = 6, pow_max = 8, delay_min = 55, delay_max = 75, \
               size = 2, walk_dist = 0, spread_rate= 0 }
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
.....
.:.:.
.._..
.:.:.
.....
ENDMAP

NAME:    vehumet_statue
TAGS:    transparent
DEPTH:   D:3-12
SHUFFLE: 12
MONS:    statue name:charred name_adjective tile:mons_statue_mage \
                hp:12 hd:3 spells:throw_flame.53.magical
MONS:    statue name:frost-covered name_adjective tile:mons_statue_mage \
                hp:12 hd:3 spells:throw_frost.53.magical
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
...........
.bbbbbbbbb.
.b.......b.
.b.1._.....
.b.......b.
.bbbbbbbbb.
...........
ENDMAP

NAME:    vehumet_crystals
TAGS:    transparent decor
SUBST:   G : Gbb
: if crawl.coinflip() then
:   vault_metal_statue_setup(_G, "G", "arcane conduit")
: else
:   vault_metal_statue_setup(_G, "G", "fiery conduit")
: end
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
.........
..b...b..
.bbb.bbb.
..b...G..
...._....
..G...b..
.bbb.bbb.
..b...b..
.........
ENDMAP

NAME:  vehumet_altar_wand_db
TAGS:  transparent patrolling
DEPTH: D:3-
# Not quite just a D:1 monster with a wand later on...
MONS:  goblin ; wand of flame / hobgoblin ; wand of flame / \
       kobold ; wand of flame
MONS:  kobold geomancer
: if you.depth() > 6 then
SUBST: 1 = 2
: end
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
.......
...x...
...1...
.x._.x.
.......
...x...
.......
ENDMAP

# It's part of the design from the Vehumet altar tile.
NAME:   nicolae_vehumet_altar_sigil
TAGS:   transparent decor
COLOUR: . = white
COLOUR: + = green
COLOUR: D = lightblue
COLOUR: E = lightgreen
FTILE:  .DE+ = floor_pebble
FTILE:  _ = floor_pebble_lightgreen
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
 bbb+bbb
bb..E..bb
b..DDD..b
b.D.E.D.b
+EDE_EDE+
b.D.E.D.b
b..DDD..b
bb..E..bb
 bbb+bbb
ENDMAP

NAME:    nicolae_vehumet_radiance
TAGS:    transparent no_trap_gen decor
SHUFFLE: DEFHJKLM / FHDELMJK, DE, JK
SUBST:   DJ = N, EKFHLM = ., N : cb
TILE:    c = wall_stone_scorched
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
     xxxxx
    .......
   ..MLMLM..
  ..LJKJKJL..
 ..MK.HFH.KM..
x.LJ.FDEDF.JL.x
x.MKHE...EHKM.x
x.LJFD._.DFJL.x
x.MKHE...EHKM.x
x.LJ.FDEDF.JL.x
 ..MK.HFH.KM..
  ..LJKJKJL..
   ..MLMLM..
    .......
     xxxxx
ENDMAP

NAME:    nicolae_vehumet_console_conduits
TAGS:    transparent decor
WEIGHT:  7
COLOUR:  bG`_ = vehumet
FTILE:   bG`_ = floor_rough
: vault_metal_statue_setup(_G, "G", "arcane conduit")
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
ccc...ccc
cbG`_`Gbc
ccc...ccc
ENDMAP

NAME:  nicolae_vehumet_first_one's_free
TAGS:  transparent decor
KITEM: p = parchment of freeze / parchment of foxfire / parchment of shock / \
           parchment of poisonous vapours / parchment of magic dart / \
           parchment of kiss of death / parchment of sandblast
: single_cloud(_G, "M", "flame", true)
: single_cloud(_G, "N", "freezing vapour", true)
: standard_overflow_setup(_G, { { "vehumet", "_" } }, true)
MAP
cccccccc
cM....Nc
c..cc..c
c_.pc..+
c..cc..c
cN....Mc
cccccccc
ENDMAP

NAME:    nicolae_vehumet_we're_having_a_blast
TAGS:    transparent
: if you.in_branch("D") then
:     if you.depth() <= 8 then
KMONS:   1 = orc wizard
KMONS:   2 = white imp
:     elseif you.depth() <= 12 then
KMONS:   1 = deep elf pyromancer
KMONS:   2 = arcanist
:     else -- D:13-15
KMONS:   1 = occultist
KMONS:   2 = deep elf zephyrmancer
:     end
:     if you.depth() >= 5 and you.depth() <= 12 then
KMONS:   _ = kobold geomancer
:     elseif you.depth() >= 14 then
KMONS:   _ = deep troll earth mage
:     end
: else  -- in Depths
KMONS:   1 = fire giant
KMONS:   2 = frost giant
KMONS:   _ = tengu reaver
: end
SHUFFLE: pq
SUBST:   p = c, q = n
: standard_overflow_setup(_G, { { "vehumet", "_" } }, false)
MAP
@..cbbbc..@
.q.......q.
..p..q..p..
c....p....c
b...1.....b
b.qp._.pq.b
b.....2...b
c....p....c
..p..q..p..
.q.......q.
@..cbbbc..@
ENDMAP

### Wu Jian overflow altars ###################################################

NAME:   nzn_wu_jian_council_hall
TAGS:   transparent decor no_monster_gen no_item_gen
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
    x@x
  xxx.xxx
 xxG...Gxx
xx.......xx
xG..._...Gx
xx.......xx
 xxG...Gxx
  xxxGxxx
    xxx
ENDMAP

NAME:    nzn_wu_jian_contemplation
TAGS:    transparent no_monster_gen no_item_gen no_pool_fixup decor
KMONS:   S = sacred lotus
ITEM:    mundane spear / w:2 mundane quarterstaff / w:2 mundane trident, stone
KFEAT:   S = W
NSUBST:  ' = 3=e / ', " = 4=W / ', t = t / d / -
SUBST:   ` = ', S = SSW
FTILE:   e' = floor_sand
FTILE:   td- = floor_grass_dark
FTILE:   ._ = floor_pebble_red
COLOUR:  e' = yellow
COLOUR:  d- = green
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
 x@x
xx.xxxxxxxxxx
x'`.```'``"Wx
x```.`'``"WWx
x'`.````"WWWx
x`.t`'``"WWSx
x`t_t`'`"WWWx
x``t.'`'`"WWx
x'`'`.``'`"Wx
xxxxxx.xxxxxx
     x@x
ENDMAP

NAME:   pdpol_wu_jian_five_deadly_venoms
TAGS:   no_item_gen no_monster_gen decor buniq_s_overflow_glass
KPROP:  F = no_tele_into
: single_cloud(_G, "F", "thin mist", false)
{{
  local trig_marker = TriggerableFunction:new {
    func="callback.five_deadly_venoms",
    repeated=false,
    data={
      venoms={
        "spectral demonic crawler name:centipede name_species name_replace name_descriptor",
        "spectral black mamba",
        "spectral scorpion",
        "spectral frilled lizard",
        "spectral cane toad"
      }
    }
  }
  trig_marker:add_triggerer(DgnTriggerer:new { type = "player_move" })
  lua_marker("_", trig_marker)
  lua_marker("F", portal_desc { positions = "five_deadly_venoms" })
}}
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
   ccc
   cFc
  ccncc
ccc...ccc
cFn._.nFc
cccn.nccc
 cFc.cFc
 ccc.ccc
   c@c
ENDMAP

# As an enticement to join, the Wu Jian Council has placed weapons beyond lava,
# but you can get to them if you know how to wall jump off of the metal walls.
# You can also get to them in other ways, of course, which is why most of the
# weapons are just plain.
NAME:   nicolae_wu_jian_glorious_leap
TAGS:   no_trap_gen no_descent
WEIGHT: 5
KITEM:  I = any weapon level:-2
KITEM:  i = any weapon
NSUBST: i = I / i
KMASK:  >Ii' = no_monster_gen
KMASK:  >Ii' = no_item_gen
KMASK:  >Ii' = opaque
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
xxxxxxxxxxxxxxx
xccccccccvccccx
xcccilll.....cx
xcccivlll....cx
xc>+i''ll._...+
xcccivlll....cx
xcccilll.....cx
xccccccccvccccx
xxxxxxxxxxxxxxx
ENDMAP

# Abstract representations of the moves of Wu Jian's three martial arts.
# The green space is where you start, the red space is where you move to,
# the statue is where the monster is.
NAME:   nicolae_wu_jian_immortal_techniques
TAGS:   transparent decor
KFEAT:  _ = altar_wu_jian
KFEAT:  DE = .
FTILE:  D = floor_pebble_lightgreen
FTILE:  E = floor_pebble_lightred
COLOUR: D = green
COLOUR: E = red
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
cc+cccccc
c.D.c.EEc
c.E...DGc
c.G.c.EEc
ccnccc.cc
c...c...c
c._..EGDc
c...c...c
ccccccccc
ENDMAP

# The five elements, or five phases, Wood, Fire, Earth, Metal, Water,
# in a cycle of either mutual generation or mutual overcoming.
NAME:    nicolae_wu_jian_wuxing_cycle
TAGS:    transparent no_pool_fixup decor
SHUFFLE: tlcvw/lcvwt/cvwtl/vwtlc/wtlcv/tcwlv/cwlvt/wlvtc/lvtcw/vtwcl
NSUBST:  Q = 4=@ / x
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
     xxQxx
   xx.....xx
  Q.........Q
 x......ll...x
 x..tt..ll...x
x...tt........x
x.............x
Q......_..cc..Q
x..ww.....cc..x
x..ww.........x
 x.....vv....x
 x.....vv....x
  Q.........Q
   xx.....xx
     xxQxx
ENDMAP

NAME:  nicolae_wu_jian_enter_the_monastery
TAGS:  transparent
DEPTH: D:3-
KMONS: D = training dummy
KMONS: p = plant
KITEM: r = stone q:1 / large rock q:1 w:5
{{
  local monsters = {}
  -- Traditional wuxia weaponry, according to the Wikipedias:
  local weapons = " ; long sword | short sword | spear | club | " ..
     "partisan | quarterstaff | great sword "
  if you.depth() <= 4 then
     table.insert(monsters, "goblin")
     table.insert(monsters, "kobold")
     table.insert(monsters, "orc")
  end
  if you.depth() >= 5 and you.depth() <= 8 then
     table.insert(monsters, "gnoll")
     table.insert(monsters, "orc")
  end
  if you.depth() >= 5 and you.depth() <= 13 then
     table.insert(monsters, "gnoll sergeant")
     table.insert(monsters, "kobold brigand")
  end
  if you.depth() >= 8 and you.depth() <= 13 then
     table.insert(monsters, "centaur")
     table.insert(monsters, "orc warrior")
  end
  if you.depth() >= 10 then
     table.insert(monsters, "gargoyle")
     table.insert(monsters, "skeletal warrior")
  end
  if you.depth() >= 13 then
     table.insert(monsters, "centaur warrior")
     table.insert(monsters, "orc knight")
     table.insert(monsters, "tengu warrior")
  end
  for i, m in ipairs(monsters) do
     monsters[ i ] = m .. weapons
  end
  kmons("1_ = " .. util.join(" / ", monsters))
}}
SUBST:  p = p``, ` = `:13 r:1, - = ``-
KPROP:  - = bloody
COLOUR: -` = brown
FTILE:  W-`tpr = floor_sand
FTILE:  D1._ = floor_spider
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, false)
MAP
xxxxxxxxxxxxx
xx.x.._..x.xx
x.D1-----1D.x
xx..-----..xx
xx..-----..xx
x.D1-----1D.x
xx.x.....x.xx
xxxxxx+xxxxxx
xtttt```ttttx
xtp```p```ptx
xtpWptttpWptx
xtpWptttpWptx
xtp```p```ptx
xtttt```ttttx
xxxxxx+xxxxxx
ENDMAP

NAME:  nicolae_wu_jian_rivers_and_lakes
TAGS:  transparent decor no_pool_fixup
SUBST: ` = Wwww, - = tt.
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
  ....`w`....
 @....wwww`...
.....`wtt`w....
...WWw`--.w`....
.`wWW.....`w....@
.w`..-`w`-.w`.....
`wt-.`www`.`ww`....
wwt-.wwwww...`ww`...
`ww`.`www`..--.`w....
..`w.-`w`-..--..w`...
...w`....._.....`w...
...`w..--..-`w`-.w`..
....w`.--..`www`.`ww`
 ...`ww`...wwwww.-tww
  ....`ww`.`www`.-tw`
   .....`w.-`w`-..`w.
    @....w`.....WWw`.
     ....`w.--`wWW...
      ....w`ttw`.....
       ...`wwww....@
        ....`w`....
ENDMAP

NAME:   nicolae_wu_jian_sharp_slivers_of_steel
TAGS:   transparent
DEPTH:  D:3-10
KMONS:  1 = kobold ; dart ego:poisoned
KMONS:  2 = kobold brigand ; dart ego:poisoned
KMONS:  3 = kobold brigand ; dart ego:curare
: if you.depth() >= 9 then
NSUBST: 1 = 3 / 23 / 2.
: elseif you.depth() > 6 then
NSUBST: 1 = 2 / 223 / 2..
: elseif you.depth() < 6 then
NSUBST: 1 = 1 / . / 1..
: else
NSUBST: 1 = 1 / 12 / 1.
: end
NSUBST: P = v / ., Q = v / ., R = v / ., S = v / .
NSUBST: p = v / ., q = v / ., r = v / ., s = v / .
: standard_overflow_setup(_G, { { "wu_jian", "_" } }, true)
MAP
          .......
    ........PvvP.
    .QvvQ..........
  .....1..vvv......
  ..RvvR...1..SvvS.
........._.........
.svvs..1...rvvr..
......vvv..1.....
..........qvvq.
  .pvvp........
  .......
ENDMAP

### Xom overflow altars #######################################################

NAME:   tgw_xom
TAGS:   no_item_gen no_monster_gen no_pool_fixup
DEPTH:  D:5-, Depths
WEIGHT: 5
MONS:   place:D:2
MONS:   orc ; club ego:chaos | dagger ego:chaos | spear ego:chaos
MONS:   gnoll ; club ego:chaos | dagger ego:chaos | spear ego:chaos
MONS:   boggart ; flail ego:chaos | rapier ego:chaos | trident ego:chaos
MONS:   tengu warrior ; flail ego:chaos | rapier ego:chaos | trident ego:chaos
MONS:   occultist ; dire flail ego:chaos | scimitar ego:chaos | partisan ego:chaos
MONS:   rakshasa ; dire flail ego:chaos | scimitar ego:chaos | partisan ego:chaos
ITEM:   gold q:1 no_pickup
KFEAT:  _ = altar_xom
:  if you.depth() == dgn.br_depth(you.branch()) then
KFEAT:  ~ = teleport trap w:20 / harlequin's trap w:3 / dispersal trap
:  else
KFEAT:  ~ = shaft trap / teleport trap / harlequin's trap w:3 / dispersal trap
:  end
NSUBST: " = 1:_ / 1:*% / 8:M / *:?, G = 1:G / 1:bvGGTU~ / 2 = vGl~???? / * = '?
NSUBST: ' = 10 = W:60 w:50 x:20 n:80 v / 8:d / * = xxxxnv
SUBST:  M : .111123M
NSUBST: 1 = 1:0 / 1:1 / 2:? / * = 01., 2 = 1:2 / 2=2. / 2:? / * = 2...
NSUBST: 3 = 1:3 / 2=3. / 1:0 / * = 3..., M = 1:1 / * = 123?
:  if you.in_branch("Depths") then
SUBST:  1 = 0, 2 = 6, 3 = 7
:  elseif you.absdepth() > 12 then
SUBST:  1 = 3, 2 = 4, 3 = 5
:  end
FTILE:  ? = floor_nerves_lightgray / floor_hall
COLOUR: ? = mountain
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: standard_overflow_setup(_G, { { "xom", "_" } }, false)
MAP
   xxxxxx@xxxxxx
  xxG...'.G..'.xx
 xx..'...G.'..G.xx
xx.'..G...'.G..'.xx
x...G..'...G.'..G.x
xG...'..G...'.G..'x
x"'...G..'...G.'."x
x".G.'.'..G...'.G"x
xx".'...G..'...G"xx
 xx""G"."'."G.""xx
  xx"""""""""""xx
   xxxxxxxxxxxxx
ENDMAP

NAME:    xom_teletrap_fun
TAGS:    transparent decor
NSUBST:  T = . / T
KFEAT:   T = teleport trap
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
.....
.TTT.
.T_T.
.TTT.
.....
ENDMAP

NAME:    xom_butterflies
TAGS:    transparent patrolling
MONS:    butterfly, demonic plant
KMONS:   C = brain worm
KFEAT:   _C = altar_xom
COLOUR:  . = random
: if you.absdepth() > 3 and you.absdepth() < 7 then
SUBST:   _ = ____C
: else
SUBST:   t = .
: end
NSUBST:  . = 2:1 / 2 : 2...... / *:.
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
..t
._.
t..
ENDMAP

NAME:    xom_shifter_show
TAGS:    no_descent decor
# Minimum rock fish depth, not that they're likely to spawn.
DEPTH:   D:6-
MONS:    shapeshifter hd:1
KFEAT:   _ = altar_xom
NSUBST:  . = 2:1 / 1:> / * = _...
:  if you.depth() == dgn.br_depth(you.branch()) then
SUBST:   > = <
:  end
SUBST:   x = bmv
KMASK:   .1 = no_trap_gen
COLOUR:  .1 = random
FTILE:   ._<>1 = floor_pebble
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
  xxxxxxx
  x.....x
  m.....x
@_m.._..x
  m.....x
  x.....x
  xxxxxxx
ENDMAP

NAME:    xom_confusion_cloud
TAGS:    transparent no_pool_fixup
MARKER:  _ = lua:fog_machine { cloud_type = "noxious fumes", \
               pow_min = 6, pow_max = 8, delay_min = 35, delay_max = 55, \
               size = 3, walk_dist = 0, spread_rate= 0 }
SUBST:   . = 0.
SHUFFLE: wW / l.
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
  wwwww
 ww...ww
 w.....w
@W.._..w
 w.....w
 ww...ww
  wwwww
ENDMAP

NAME:    xom_redecorated
TAGS:    decor no_pool_fixup
KMONS:   C = brain worm
KFEAT:   C = altar_xom
KFEAT:   ^ = teleport trap
: if you.in_branch("Depths") then
KFEAT:   ~ = teleport trap / alarm trap / dispersal trap / harlequin's trap w:15
: elseif you.depth() == dgn.br_depth(you.branch()) then
KFEAT:   ~ = teleport trap / alarm trap / dispersal trap
: else
KFEAT:   ~ = shaft trap / teleport trap / alarm trap / dispersal trap
: end
SUBST:   c = ccxxxv
: if you.absdepth() > 3 and you.absdepth() < 7 then
SUBST: _ = ____C
: end
NSUBST:  " = 2:^ / 1:G__ / 5:m /  * = ltbm~......
NSUBST:  T = 2:^ / *:., ^ = 2:^ / *:.
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
      @
   cccTccc
  cc"".""cc
 cc.""".""cc
 c.".."."".c
@T."."_".".T@
 c.""."..".c
 cc"".""".cc
  cc"".""cc
   cccTccc
      @
ENDMAP

NAME:   led_xom_imps
TAGS:   temple_overflow_1 temple_overflow_xom buniq_altar_xom
DEPTH:  D:3-, Orc
MONS:   crimson imp ; stone, crimson imp ; dagger ego:chaos
KPROP:  1 = no_tele_into
NSUBST: 1 = 1:2 / *:1
KFEAT:  ^ = teleport trap / dispersal trap
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
xxxx+xxxx
x1^...^1x
xxx._.xxx
x1^...^1x
xxxx+xxxx
ENDMAP

NAME:   nicolae_xom_altar_mimics
TAGS:   transparent decor
WEIGHT: 1
NSUBST: _ = 1:_ / 2:XXX_ / *:X
KFEAT:  X = altar_xom mimic
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
  .......
  ._..._.
 .........
 .........
...........
._..._..._.
...........
 .........
 .........
  ._..._.
  .......
ENDMAP

NAME:    brannock_xom_greatest_gift
TAGS:    transparent
WEIGHT:  2
MARKER:  _ = lua:portal_desc {gift="altar"}
{{
    dgn.persist.xom_gg_granted = false

    local los_marker = TriggerableFunction:new {
      func="callback.xom_greatest_gift",
      repeated=true
    }
    los_marker:add_triggerer(DgnTriggerer:new {
      type="player_los"})

    lua_marker('_', los_marker)
}}
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
...
._.
...
ENDMAP

NAME:   doesnt_xom_only_xom
TAGS:   transparent decor
WEIGHT: 2
KFEAT:  C = C mimic
KFEAT:  g = G mimic
NSUBST: C = 1:_ / *:C
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
xxxxxxxxxxx
x.G.G.g.G.x
xgC..C..Cgx
x.........x
x.........x
xG.......Gx
x.C..C..C.x
xg.......gx
xxxx...xxxx
   x...x
   x...x
   xG.Gx
   xx+xx
ENDMAP

NAME:    regret_index_xom_buried_treasure
TAGS:    transparent decor
ITEM:    stone q:1 no_pickup
KMONS:   ! = pile of debris
KITEM:   ! = plate armour randart plus:-12 pre_id / \
             kite shield randart plus:-12 pre_id / mundane club w:9980
KITEM:   ? = mundane club / gold q:1 w:9970, large rock q:1
SHUFFLE: ?" / ?" / !!
SUBST:   b : bcc, y : xx., z : xx., Y : xxd, Z : xxd, " = .
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
xx@. ..xx
xbx...zbx
.yxy.xxx.
..xxxxz..
 ..xxx..@
..xxYxx.xxxxx
@xxx.xccccccx
xbx...cx"d_cx
xx..Z.cdx?dcx
    ..+ddx"cx@..xx
     .cdddxc...xbx
     .cc+cccx.xxx.
     @.....xxYxx..
        .Z..xxx..
         ..zxxxx..
         .xxx.yxy@
         xcz...xbx
         xx@. ..xx
ENDMAP

NAME:    regret_index_xom_of_box
TAGS:    transparent no_monster_gen
DEPTH:   D:5-12, Orc
MONS:    fire bat, hell hound, scorpion, sky beast, orange demon, raiju
ITEM:    box of beasts mimic
KMONS:   p = demonic plant
KFEAT:   P = demonic_tree
SHUFFLE: 12, ?!
: if you.in_branch("Orc") or you.depth() >= 12 then
SUBST:   ? = 5, ! = 6
: elseif you.absdepth() >= 9 then
SUBST:   ? = 3, ! = 4
: else
SUBST:   2 = 34, ?! = .
: end
SHUFFLE: xp, pPtU', xGv"
SUBST:   d : d %:490, - : +ccc, '" = .
NSUBST:  % = 1:% / 1:$ / *:.
TILE:    c = dngn_stone_wall_darkgray
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
  ccccccccccc.@.c
  ccc.d1....c.p.c
  c.cdx..dx.c...c
  c.+....!d.-..c
 c..+..._...-..c
 c..+.d?....-.c
c...c.xd..xdc.c
c.p.c....2d.ccc
c.@.ccccccccccc
ENDMAP

NAME:    regret_index_xom_doom_sign
TAGS:    transparent no_wall_fixup
DEPTH:   D:5-, Lair:2-, Crypt, Zot, !Zot:$
WEIGHT:  20 (Zot), 5 (D:5-10, Lair:2-), 10
SHUFFLE: yz / zy / -- / ""
SUBST:   y : x., z = ., - = +, " = ., ? : x..
: if you.in_branch("D") then
:   if you.depth() < 8 then
MONS:    drude, ufetubus band / phantom
:   elseif  you.depth() < 12 then
MONS:    draugr, boggart / vampire
SUBST:   $ = $%
:   else
MONS:    draugr ; mace ego:chaos
MONS:    kobold demonologist / ugly thing / laughing skull
SUBST:   $ = $%*
:   end
TILE:    x = wall_brick_red
TILE:    c = dngn_stone_wall_red
: elseif you.in_branch("Lair") then
MONS:    raven, tarantella / hell rat band / dream sheep band w:5
SUBST:   $ = $%*
TILE:    x = wall_pebble_red
TILE:    c = dngn_stone_wall_red
FTILE:   '12_GY = floor_pebble_darkgray
: elseif you.in_branch("Crypt") then
MONS:    draugr ; great mace ego:chaos | great sword ego:chaos
:   mons("laughing skull band / reaper ; " .. scythe("chaos"))
SUBST:   $ = *, c = v
TILE:    x = wall_undead_red
TILE:    v = dngn_metal_wall_red
: else -- Zot
MONS:    orb of entropy, tentacled monstrosity / hellephant w:2
SUBST:   c = b
NSUBST:  $ = 1:{([})]<<>> / 1:*| / *:$
FTILE:   '12_GYb = floor_nerves_darkgray
TILE:    x = wall_zot_red
TILE:    b = dngn_crystal_red
: end
NSUBST:  1 = 1:1 / 1:2 / * = 11122
SUBST:   ` : `., G : GGY
CLEAR:   `
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: standard_overflow_setup(_G, { { "xom", "_" } }, false)
veto {{
  return you.in_branch("Zot") and dgn.zot_orb_type() ~= "orb of entropy"
}}
MAP
           c
          x'x
         x'''x
    ````x''x''x
    c..c''xGx''c`
   x'x..x''x''x.`
  x'''x??x'''x..`
 x''x''x..x1x?.c`
c''x_x'1cyzc.?x'x
 x''x''xz$$y.x'''x
  x'''x.y$$zx''x''x
   x'x?.czyc1'x_x''c
   `c.?x1x..x''x''x
   `..x'''x??x'''x
   `.x''x''x..x'x
   `c''xGx''c..c
     x''x''x````
      x'''x
       x'x
        c
ENDMAP

NAME:   nicolae_xom_the_eyes_have_it
TAGS:   transparent decor
WEIGHT: 5
KFEAT:  T = fountain_eyes
: standard_overflow_setup(_G, { { "xom", "_" } }, true)
MAP
T.T
._.
T.T
ENDMAP

### Yredelemnul overflow altars ###############################################

NAME:   yredelemnul_altar_generic
TAGS:   transparent decor
KMONS:  f = withered plant
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
.....
.f.f.
.._..
.f.f.
.....
ENDMAP

NAME:   lemuel_zombie_altar_yredelemnul
TAGS:   transparent no_monster_gen no_wall_fixup vaults_room vaults_orient_w
TAGS:   patrolling uniq_zombie_altar
WEIGHT: 5 (Vaults), 10
DEPTH:  D:3-, Vaults
MONS:   zombie, death knight band
: if you.in_branch("D") and you.depth() > 5 and you.depth() < 10 and
:   crawl.one_chance_in(1) then
KMONS:  F = rock fish zombie
KFEAT:  Fm = clear_rock_wall
NSUBST: A = 2:F / 1:Fm / *:m
SUBST:  z = x
TILE:   Fm = dngn_transparent_wall_darkgray
: elseif you.in_branch("Vaults") then
NSUBST: A = 1:2 / *:.
SUBST:  @ = .
FTILE:  .2_ = floor_crypt
TILE:   x = rock_wall_crypt
CLEAR:  z
: else
NSUBST: A = 2:1 / *:.
SUBST:  z = x
: end
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
zzzxxxxxxxxxxzzz
zzzxAAAAAAAAxzzz
xxxx........xxxx
@............._x
xxxx........xxxx
zzzxAAAAAAAAxzzz
zzzxxxxxxxxxxzzz
ENDMAP

NAME:   lemuel_mausoleum_altar_yredelemnul
TAGS:   transparent uniq_mausoleum_altar
# see the kiku mausoleum altar for the depth
DEPTH:  D:4-10, Crypt
: if you.in_branch("Crypt") then
MONS:   zombie, guardian mummy, skeletal warrior, ghoul
: else
MONS:   zombie, mummy, wight, weeping skull / bes kemwar w:2
: end
NSUBST: ? = 1:_ / *:1
SUBST:  1 = 1:30 2 3 4
KMONS:  _ = human zombie
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
ccccccccccccccc
c?c?c?c?c?c?ccG
c+c+c+c+c+c+ccc
c............+@
c+c+c+c+c+c+ccc
c?c?c?c?c?c?ccG
ccccccccccccccc
ENDMAP

NAME:   yredelemnul_forgotten_temple_becter
TAGS:   transparent no_monster_gen no_item_gen
: if you.in_branch("Depths") then
KMONS:  _ = spectral juggernaut
SUBST:  1 = ?
: else
MONS:   spectral orc
KMONS:  _ = weeping skull
: end
KFEAT:  . = web trap / .
: decorative_floor(_G, '1?', "broken floral vase")
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
xxxxxxxxx
xcccccccx
xc.._..cx
xcc.1.ccx
xc.....cx
xcc...ccx
xxcc+ccxx
 xxx@xxx
ENDMAP

NAME:   nicolae_yredelemnul_corpse_copse
TAGS:   transparent no_monster_gen patrolling
MONS:   zombie, alderking
KFEAT:  T = petrified_tree
# Statistically, the probability that none of the edge glyphs will end up as .
# and the level builder won't be able to connect the vault is extremely small.
# ...but not zero. Thus:
NSUBST: D = 1:. / *:E, t = 1:. / * = TTE
SUBST:  E = t:4 T:2 .:3
: nsubst( ". = " .. you.absdepth() .. " = 1 / 1 = 1. / ." )
: if you.in_branch("Depths") then
NSUBST: 1 = 1:2 / *:1
: end
COLOUR: t = brown
TILE:   t = dngn_tree_dead
: set_feature_name("tree", "dead tree")
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, false)
MAP
   DDDDD
  DE.E.ED
 DE.E.E.ED
DE.ttttt.ED
D.Et...tE.D
DE.t._.t.ED
D.Et...tE.D
DE.ttttt.ED
 DE.E.E.ED
  DE.E.ED
   DDDDD
ENDMAP

# This used to have a player ghost in it before the Necropolis rework.
NAME:   nicolae_yredelemnul_ghost_church
TAGS:   transparent no_trap_gen
WEIGHT: 5
DEPTH:  D:3-
KPROP:  dO' = no_tele_into
KMASK:  dO' = no_monster_gen
NSUBST: d = * / $ / %
KFEAT:  _ = altar_yredelemnul
: if you.depth() < 5 then
KMONS:  O = spectral orc warrior
: elseif you.depth() < 8 then
KMONS:  O = spectral ogre
: elseif you.depth() < 12 then
KMONS:  O = flayed ghost
: else
KMONS:  O = phantasmal warrior
: end
KMONS:  z = patrolling zombie
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
xxxxxxxxxxx
xxxcccccxxx
xxcc...ccxx
xxcz._.zcxx
xccc...cccx
xc.......cx
xc.n===n.cx
xc.n'O'n.cx
+..ndddn..+
xcccccccccx
xxxxxxxxxxx
ENDMAP

NAME:    regret_index_yredelemnul_bone_pool
TAGS:    transparent no_pool_fixup vaults_hard vaults_orient_n vaults_orient_w
DEPTH:   D:6-, Swamp, Vaults, Crypt
WEIGHT:  5 (D:6-8, Crypt), 10
KITEM:   d = any skeleton
KFEAT:   d = W
KFEAT:   1 = w
: if you.in_branch("D") then
TAGS:    no_monster_gen
:   if you.depth() < 9 then
KMONS:   1 = marrowcuda
KMONS:   2 = goblin draugr ; spear
NSUBST:  1 = 1:1 / *:w
:   elseif you.depth() < 12 then
KMONS:   1 = vampire mosquito
KMONS:   2 = merfolk draugr
:   else
KMONS:   1 = laughing skull band
KMONS:   2 = skeletal warrior
NSUBST:  1 = 1:1 / *:w
:   end
: elseif you.in_branch("Swamp") then
KMONS:   1 = raven draugr
KMONS:   2 = bog body
KITEM:   ! = any jewellery
KFEAT:   t = t
SUBST:   x = t, % = !, ' = $!, + : +W, - : -W, y : yw, z : zw
NSUBST:  . = 2 = 2. / *:.
: elseif you.in_branch("Vaults") then
KMONS:   1 = dire elephant draugr
KMONS:   2 = death knight band
SUBST:   'z = m, + = ., % = |
CLEAR:   x
KPROP:   d1Ww = no_tele_into
KMASK:   d1Ww = opaque
:   vaults_hard_standard(_G, true, ".d*-+C?vV12yzm")
: else -- Crypt
KMONS:   1 = bone dragon
KMONS:   2 = death knight band
SUBST:   % = ***|, ' = $%%, c = v, x = c
NSUBST:  1 = 1:1 / *:w, . = 1:0 / *:.
: end
SUBST:   - : +..., y : cct.., z : cct.., W : WWw, ? : vvvVVt
: if not you.in_branch("Swamp") then
COLOUR:  t = brown
FTILE:   t = floor_pebble_brown
TILE:    t = dngn_tree_dead
:   set_feature_name("tree", "dead tree")
: end
: decorative_floor(_G, 'v', "mourning vase")
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, false)
MAP
xxxxxxxx      x
xccccccccc++ccx
xc_.c%c?c....cx
xc....c.c.y..cx
xcc.2...c..y.cx
xc%..2..c....cx
xccc..z.--ccccx
xc?......'''dcx
 cccc--.z'ddWcx
 c....c''dWWwcx
 +.y..c'dWWWwcx
 +..y.c'dWW1wcx
 c....cdWwww1cx
 cccccccccccccx
xxxxxxxxxxxxxxx
ENDMAP

NAME:    regret_index_yred_scorched_prison
TAGS:    no_monster_gen vaults_hard
DEPTH:   D:4-, Swamp, Vaults, !Vaults:$, Crypt, Tar
: if you.in_branch("D") then
:   if you.depth() < 7 then
KMONS:   1 = phantom / bes kemwar w:5
KMONS:   2 = wight
KITEM:   1- = goblin skeleton / kobold skeleton / gnoll skeleton
KITEM:   $ = $ q:4 no_pickup / any mundane weapon
NSUBST:  1 = 2:1 / 1:1- / *:-, 2} = 1:122 / *:.
:   elseif you.depth() < 10 then
KMONS:   1 = wight w:30 / human draugr ; spear
KMONS:   2 = steam dragon draugr ; hand axe
KITEM:   1- = gnoll skeleton / kobold skeleton / human skeleton
KITEM:   $ = $ q:4 no_pickup / any mundane weapon w:20
NSUBST:  1 = 3:1 / 2 = 1- / *:-, 2} = 1:1222 / 1:1.. / *:.
:   elseif you.depth() < 13 then
KMONS:   1 = shadowghast / wraith
KMONS:   2 = vampire / skeletal warrior w:2
KITEM:   1- = human skeleton / ogre skeleton / troll skeleton
KITEM:   $ = $ no_pickup / any weapon
NSUBST:  1 = 2:1 / 2 = 1- / *:-, 2} = 1:2 / *:.
:   else
KMONS:   1 = draugr / wraith w:4 / spectral fire dragon / spectral fire crab
KMONS:   2 = skeletal warrior / laughing skull band
KITEM:   1- = orc skeleton / troll skeleton / elf skeleton
KITEM:   $ = $ no_pickup / any weapon / any weapon good_item
NSUBST:  1 = 3:1 / 2 = 1- / *:-, 2} = 2:2 / *:1
:   end
: elseif you.in_branch("Swamp") then
KMONS:   1 = bog body / ghoul w:2
KMONS:   2 = will-o-the-wisp / ghost crab w:12
KITEM:   1- = human skeleton / elf skeleton / spriggan skeleton
KFEAT:   + = broken_door
SUBST:   x = t, c = ccccxxxtw, +} = W, $ = $%%%*, z : zww, Z : Zww
NSUBST:  1 = 4:1 / 2 = 1- / *:-, 2} = 1:2 / 1:221 / *:., . = 4:W / 1:t / *:.
FTILE:   -_12 = floor_sandstone
KPROP:   w = no_tele_into
: elseif you.in_branch("Vaults") then
KMONS:   1 = draugr / spectral lindwurm w:8 / phantasmal warrior w:2
KMONS:   2 = death knight
KITEM:   1- = human skeleton w:20 / goblin skeleton / elf skeleton
SUBST:   jkl = ., JKL = +, }$ = $%%*
NSUBST:  1 = 6:1 / 1:- / * = 1-
CLEAR:   x
: elseif you.in_branch("Crypt") then
KMONS:   1 = laughing skull / flayed ghost / shadow wraith w:2
KMONS:   2 = revenant soulmonger
KITEM:   1- = human skeleton / elf skeleton / ghoul skeleton
SUBST:   $ = %*, } = 11., c = v, x = c
: else -- Tar
KMONS:   1 = putrid mouth / eidolon / spectral ettin w:5
KMONS:   2 = profane servitor
KMONS:   C = silent spectre
KITEM:   1- = oni skeleton / demigod skeleton / titan skeleton
SUBST:   $ = .
: end
KFEAT:   1- = open_door
KFEAT:   g = iron_grate
SHUFFLE: iI / jJ / kK / lL / mM
SUBST:   ijk = @, IJK = +, lm = x, LM = c, z : c.., Z : c..
TILE:    c = wall_stone_scorched
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, false)
MAP
xxxjjjxxx
xccJJJccx
xcg....cxxxxxxx
xc1z...cccccccx
xcg....c$$c$2cx
xccc..cc$1.2$cx
xcg....cc._.ccx
xc1.ZZ.+.}.1$cx
xcg....c..c$$cxxx
xccc..ccc+ccccccx
xcg....c...c...cx
xc1z.....Z.....Ll
xcg......Z.....Ll
kKK..z.c...c.z.Ll
kkcKg1gcg1gcg1gcx
 kkKccccccccccccx
  kkxxxxxxxxxxxxx
ENDMAP

# Yredelemnul's altars are described as being worked from columnar basalt, which
# naturally forms hexagonal columns in nature. So:
NAME:   nicolae_yredelemnul_columnar_basalt
TAGS:   transparent decor
KMONS:  1 = zombie
: if you.depth() <= 5 then
KMONS:  _ = zombie
SUBST:  1 = .
: else
NSUBST: 1 = 2=1 / 2=1. / .
: end
SUBST:  D = cccc., . = ....'
COLOUR: c. = darkgrey
FTILE:  1c_. = floor_cobble_blood
FTILE:  ' = floor_rough_darkgray
TILE:   c = dngn_stone_dark
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
   ```DDD```
  ```D...D```
  DDD..1..DDD
 D...c...c...D
D..1..ccc..1..D
`D...c...c...D`
``Dcc.._..ccD``
`D...c...c...D`
D..1..ccc..1..D
 D...c...c...D
  DDD..1..DDD
  ```D...D```
   ```DDD```
ENDMAP

# Gimmick shamelessly copied from nicolae_crypt_disinterred, but I checked with
# the author of that vault and he doesn't mind.
NAME:   nicolae_yredelemnul_open_graves
TAGS:   transparent no_wall_fixup
DEPTH:  D:3-, !D:$, Depths, !Depths:$, Crypt, !Crypt:$
KMONS:  1 = zombie
KFEAT:  ^ = shaft trap
SUBST:  - = t.
COLOUR: t = brown
TILE:   t = dngn_tree_dead
: set_feature_name("tree", "dead tree")
: vault_granite_statue_setup(_G, "G", "gravestone")
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
    xxxxx
 xxxxtttxxxx
 xtt-.G.-ttx
 xtG..^..Gtx
xx-.^.1.^.-xx
xt...1.1...tx
xtG^1._.1^Gtx
xt-.......-tx
xxxx-.@.-xxxx
ENDMAP

NAME:   nicolae_yredelemnul_rated_r_for_profanity
TAGS:   transparent decor buniq_s_overflow_glass
WEIGHT: 3
KMONS:  1 = profane servitor
KMASK:  1 = opaque
KMASK:  1 = no_trap_gen
KMASK:  1 = no_item_gen
KPROP:  1 = no_tele_into
: standard_overflow_setup(_G, { { "yredelemnul", "_" } }, true)
MAP
xxxxxxxxxxx
xxxxcccxxxx
xxxcc1ccxxx
xxccnnnccxx
xcc.....ccx
xc..._...cx
xcc.....ccx
xxcc...ccxx
xxxcc+ccxxx
ENDMAP

### Zin overflow altars #######################################################

NAME:   zin_angel
TAGS:   no_item_gen no_monster_gen vaults_empty vaults_orient_s decor
TAGS:   buniq_s_overflow_holy_glass
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 3 (Vaults), 10
KPROP:  1 = no_tele_into
COLOUR: G = lightgray
COLOUR: c = white
TILE:   c = wall_church
FTILE: _.G1m+ = floor_limestone
: local h = "ego:holy_wrath"
: mons("angel god:zin dbname:zin_angel ; sacred scourge w:2 | whip w:8 " .. h ..
:                                    " | long sword " .. h .. " | mace " .. h ..
:                                    " | any weapon level:20 " .. h)
: if you.in_branch("Depths") then
TILE:   G = dngn_statue_depths_zot_angel
: else
TILE:   G = dngn_statue_angel
:   if you.in_branch("Vaults") then
CLEAR:  x
SUBST:  @ = .
:   end
: end
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
xxxxxxxxx
xcccccccx
xc1m.._cx
xcmm...cx
xc.....cx
xcG...Gcx
xccc+cccx
    @
ENDMAP

NAME:   zin_treasury
TAGS:   no_item_gen no_monster_gen no_descent
DEPTH:  D:3-, Vaults, !Vaults:$
WEIGHT: 3 (Vaults), 10
KFEAT:  m = iron_grate
KPROP:  $ = no_tele_into
COLOUR: c = white
TILE:   c = wall_church
FTILE:  _.m+$ = floor_limestone
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
: if you.in_branch("Vaults") then
CLEAR:  x
SUBST:  @ = .
: end
MAP
  xxxxxxx
  xcccccx
 xxc$$$cxx
xxcc$$$ccxx
xccmm$mmccx
xcc.mmm.ccx
xcc.._..ccx
xxc.....cxx
 xccc+cccx
     @
ENDMAP

NAME:   zin_purify
TAGS:   transparent no_monster_gen no_item_gen vaults_empty
DEPTH:  D:3-, Vaults, !Vaults:$
WEIGHT: 3 (Vaults), 10
KFEAT:  v = general shop name:Zin type:Purification suffix:Station count:1 \
            greed:30 ; potion of curing
COLOUR: c' = white
TILE:   c = wall_church
FTILE:  Td'_ = floor_limestone
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
 .....
..ccc..
.ccTcc.
..c_c..
 .....
...'...
..'v'..
 ..'..
  ...
ENDMAP

NAME:   zin_scriptorium
TAGS:   no_item_gen no_monster_gen no_descent vaults_empty
DEPTH:  D:3-, Vaults, !Vaults:$
WEIGHT: 1 (Vaults), 10
ITEM:   any scroll
KFEAT:  m = iron_grate
KPROP:  ? = no_tele_into
COLOUR: c = white
TILE:   c = wall_church
FTILE:  _.m+d = floor_limestone
NSUBST: ? = 2:d / *:.
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
  xxxxxxx
  xcccccx
 xxc???cxx
 xcc???ccx
xxcccmcccxx
xcc.....ccx
xcc.._..ccx
xxc.....cxx
 xccc+cccx
     @
ENDMAP

NAME:   zin_academy
TAGS:   transparent no_item_gen no_monster_gen vaults_empty
TAGS:   vaults_orient_w vaults_orient_s vaults_orient_e
DEPTH:  D:3-, Vaults, !Vaults:$, Depths
WEIGHT: 3 (Vaults), 10
KFEAT:  G = metal_statue
COLOUR: c = white
COLOUR: ' = white
TILE:   c = wall_church
COLOUR: G = silver
TILE:   G = dngn_silver_statue
FTILE:  _'G = floor_limestone
SUBST:  ' = .
: vault_metal_statue_setup(_G, "G", "silver statue")
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
  ccccccc
cccG.t.Gccc
c.t.'_'.t.c
....'''....
...........
...'''''...
 .........
   .....
ENDMAP

NAME:   zin_statuary
TAGS:   transparent no_item_gen no_monster_gen vaults_empty
DEPTH:  D:3-, Vaults, !Vaults:$
WEIGHT: 3 (Vaults), 10
COLOUR: c = white
TILE:   c = wall_church
TILE:   G = dngn_statue_triangle
FTILE:  _'+ = floor_limestone
: vault_metal_statue_setup(_G, "S", "silver statue")
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
 .......
..ccccc..
.cc'_'cc.
..cc+cc..
...'''...
.S.....S.
 ..G.G..
  .....
ENDMAP

# Bad pun, not a typo.
NAME:   nicolae_zin_agzebo
TAGS:   transparent decor no_trap_gen no_monster_gen
COLOUR: v = white
TILE:   v = dngn_metal_wall_white
: vault_metal_statue_setup(_G, "S", "silver statue")
: set_feature_name("metal_wall", "silver wall")
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
 vvvvv
vvS.Svv
.......
@S._.S@
.......
vvS.Svv
 vvvvv
ENDMAP

NAME:    nicolae_zin_hit_'em_with_the_salt
TAGS:    transparent decor
WEIGHT:  5
# p = Demon, q = Undead, r = Unclean (but not demon/undead/chaotic), s = Chaotic
KMONS:   p = greater demon-shaped pillar of salt
KMONS:   q = lich-shaped pillar of salt / curse skull-shaped pillar of salt / \
           vampire mage-shaped pillar of salt / \
           guardian mummy-shaped pillar of salt
KMONS:   r = ancient zyme-shaped pillar of salt / \
           tyrant leech-shaped pillar of salt / radroach-shaped pillar of salt
KMONS:   s = very ugly thing-shaped pillar of salt / \
           large abomination-shaped pillar of salt / \
           shapeshifter-shaped pillar of salt
SHUFFLE: P-/S`
NSUBST:  P = p / q / r / s
SUBST:   ` = `.
MARKER:  _ = lua:fog_machine { cloud_type = "salt", pow_min = 5, pow_max = 15, \
           delay_min = 5, delay_max = 20, size = 1, \
           walk_dist = 3, spread_rate = 0 }
FTILE:   pqrs._-S = floor_salt
: vault_metal_statue_setup(_G, "S", "silver statue")
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
``.-.``
`S.P.S`
.......
-P._.P-
.......
`S.P.S`
``.-.``
ENDMAP

NAME:   nicolae_zin_silver_trinity
KFEAT:  g = G
SUBST:  G : Gg
COLOUR: @. = white
FTILE:  @._G = floor_limestone
: if you.in_branch("Depths") then
TILE:   g = dngn_statue_depths_zot_angel
: else
TILE:   g : dngn_statue_triangle / dngn_statue_angel
: end
: vault_metal_statue_setup(_G, "G", "silver statue")
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
G@G
._@
@G.
ENDMAP

NAME:   hellmonk_zin_sealed_chaos
TAGS:   transparent no_monster_gen no_item_gen no_descent
DEPTH:  D:4-
WEIGHT: 7
: if crawl.coinflip() then
MONS:   boggart, swamp drake, chaos spawn, laughing skull
KITEM:  ' = $ no_pickup
KFEAT:  ~ = altar_xom
COLOUR: c = lightmagenta / cyan / yellow
FTILE:  '1234~ = floor_rough_lightmagenta / floor_rough_cyan / floor_rough_yellow
: elseif crawl.coinflip() then
MONS:   weeping skull, brain worm, small abomination, large abomination
KFEAT:  ~ = altar_lugonu
TILE:   c : stone_wall_abyss_a / stone_wall_abyss_b / stone_wall_abyss_c
FTILE:  '1234~ : floor_nerves_magenta / floor_nerves_cyan
: else
MONS:   golden eye, jelly, slime creature, eye of devastation
KFEAT:  ~ = altar_jiyva
KFEAT:  c = slimy_wall
FTILE:  '1234~ = floor_rough_green
: end
: if you.depth() > 11 then
SUBST:  2 = 4
: elseif you.depth() > 7 then
SUBST:  2 = 3
: end
COLOUR: . = white
FTILE:  _.S = floor_limestone
FTILE:  = = floor_pebble_darkgray
KPROP:  '%~1234 = no_tele_into
COLOUR: v = white
TILE:   v = dngn_metal_wall_white
: vault_metal_statue_setup(_G, "S", "silver statue")
: set_feature_name("metal_wall", "silver wall")
: standard_overflow_setup(_G, { { "zin", "_" } }, true)
MAP
  vvvvv
 vvcccvv
 vcc~ccv
"vc212cv"
 vc'''cv
 vv===vv
  S...S
  .....
   ._.
    .
ENDMAP

### The Shining One overflow altars ###########################################

# TSO's small temple (1KB)
# Idea stolen from protected_by_tso_3.
NAME:     tso_altar
TAGS:     transparent no_item_gen no_rotate decor
COLOUR:   ' = yellow
COLOUR:   c = white
FTILE:    'A = floor_limestone
TILE:     c = wall_church
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
  xxxxx
xxxcccxxx
xccc_cccx
xc.'''.cx
xct.'.tcx
xc..'..cx
xct...tcx
xccc+cccx
ENDMAP

NAME:    tso_metal_star
TAGS:    transparent no_monster_gen no_trap_gen no_item_gen decor vaults_empty
DEPTH:   D:3-, Vaults, !Vaults:$, Depths
WEIGHT:  3 (Vaults), 10
SUBST:   ! : vmmTG..
: if you.in_branch("Vaults") then
CLEAR:   @
: end
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
          @
          .
         ...
         .v.
        ..v..
       ..vvv..
      ..vv.vv..
     ..vv...vv..
    ..vm..!..mv..
  ...vv..!.!..vv...
@..vvv..!._.!..vvv..@
  ...vv..!.!..vv...
    ..vm..!..+v..
     ..vv...vv..
      ..vv.vv..
       ..vvv..
        ..v..
         .v.
         ...
          .
          @
ENDMAP

NAME:   tso_oasis_becter
TAGS:   transparent no_item_gen no_monster_gen
KMONS:  f = plant
SUBST:  ` = ff.
COLOUR: . = yellow
FTILE:  `.Tf = floor_sand
FTILE:  _ = floor_limestone
COLOUR: c = white
TILE:   c = wall_church
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
  ....
 ..``....
 .`ww`...
 ..``..c..
......+cc..
..T..cc_cc.
 .....ccc..
   ....c..
     ....
ENDMAP

NAME:   nicolae_tso_swordbearing_angel
TAGS:   transparent decor
COLOUR: . = yellow
COLOUR: c = white
FTILE:  @._+ = floor_limestone
TILE:   c = wall_church
: if you.in_branch("Depths") then
TILE:   v = dngn_metal_wall_yellow
: end
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
     xxxxx
    xxcccxx
    xcc.ccx
xxxxxc._.cxxxxx
xcccccc.ccccccx
xc...........cx
xcc....v....ccx
xxcc..vvv..ccxx
 xxcc..v..ccxx
  xxcc.v.ccxx
   xxc.v.cxx
    xc.v.cx
    xc.v.cx
    xc...cx
    xcc+ccx
ENDMAP

NAME:   nicolae_tso_carved_into_rock
TAGS:   transparent decor
SUBST:  X = xxx.
COLOUR: ' = yellow
COLOUR: c = white
TILE:   c = wall_church
FTILE:  G'_ = floor_limestone
: vault_metal_statue_setup(_G, "G", "golden statue")
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxXXXXxxxxxxxxxxxxx
xxxxxxxXXXXXX....XXXXXXxxxxxxx
xxxxXXX................XXXxxxx
xxXX......................XXxx
xX......XxX........XxX......Xx
X.....XXxxxxcG'''GcxxxXX.....X
.....Xxxxxxxccc'cccxxxxxX.....
@...Xxxxxxxxxc'''cxxxxxxxX...@
..Xxxxxxxxxxxc'_'cxxxxxxxxXX..
XXxxxxxxxxxxxc'''cxxxxxxxxxxXX
xxxxxxxxxxxxxcccccxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   nicolae_tso_besieged_by_evil
TAGS:   transparent no_monster_gen patrolling
# imp ranges
DEPTH:  D:3-8
SUBST:  c = ccc' 4:2, + = ++'
NSUBST: ' = 1:s / 1:sz / 2:z / 2 = zz'' / *:'
KMONS:  z = orc zombie / kobold zombie / hobgoblin zombie
: if you.absdepth() <= 4 then
KMONS:  s = kobold draugr ; dagger / orc draugr ; hand axe
KMONS:  _ = ufetubus / white imp w:5
: else
KMONS:  s = kobold draugr ; short sword / gnoll draugr ; trident
KMONS:  _ = ufetubus / white imp / shadow imp / drude w:5
: end
COLOUR: 'sz = yellow / none w:5
COLOUR: c = white
TILE: c = wall_church
FTILE: +'_sz = floor_sandstone / none w:5
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, false)
MAP
.............
.............
..cccc.cccc..
..cccc+cccc..
..cc'''''cc..
..cc'''''cc..
...+''_''+...
..cc'''''cc..
..cc'''''cc..
..cccc+cccc..
..cccc.cccc..
.............
.............
ENDMAP

NAME:   nicolae_tso_fravashi_hole
TAGS:   transparent decor no_monster_gen no_item_gen no_trap_gen
TAGS:   buniq_s_overflow_holy_glass
WEIGHT: 3
KMONS:  1 = fravashi
KMONS:  2 = deep elf blademaster ; short sword ego:holy_wrath . \
              short sword ego:holy_wrath . pearl dragon scales
KMONS:  3 = spriggan defender ; rapier ego:holy_wrath | flail ego:holy_wrath . \
              pearl dragon scales
KMASK:  123 = opaque
KPROP:  123 = no_tele_into
COLOUR: c = white
FTILE:  _n123`+ = floor_limestone
TILE:   c = wall_church
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
 xxxxxxxxx
 xcccccccx
..c```n2cx
@.+`_`n1cx
..c```n3cx
 xcccccccx
 xxxxxxxxx
ENDMAP

NAME:   nicolae_tso_holy_fire
TAGS:   transparent decor no_item_gen no_monster_gen no_trap_gen
TAGS:   buniq_s_overflow_holy_glass
KMASK:  ` = opaque
KPROP:  ` = no_tele_into
COLOUR: `. = yellow
COLOUR: cn = white
FTILE:  c`n._ = floor_limestone
TILE:   c = wall_church
: single_cloud(_G, "`", "blessed fire", false)
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
  xxxxxxx
  xcccccx
xxxc```cxxx
xcccnnncccx
xc`n...n`cx
xc`n._.n`cx
xc`n...n`cx
xccc...cccx
xxxxx+xxxxx
ENDMAP

NAME:   nicolae_tso_implements_of_victory
TAGS:   transparent decor no_monster_gen no_item_gen no_trap_gen
TAGS:   buniq_s_overflow_holy_glass
: local p = "plus:0 ego:holy_wrath pre_id no_uniq"
: kitem("d = hand axe " .. p .. " / mace " .. p .. " / falchion " .. p ..
:           " / spear " .. p .. " / dagger " .. p .. " / whip " .. p ..
:           " / short sword " .. p)
KMASK:  d = opaque
KPROP:  d = no_tele_into
COLOUR: cn = white
COLOUR: . = yellow
FTILE:  ._nd+ = floor_limestone
TILE:   c = wall_church
: standard_overflow_setup(_G, { { "the_shining_one", "_" } }, true)
MAP
xxxcc+ccxxx
xxxc...cxxx
xxxc...cxxx
xccc...cccx
xcnn...nncx
xcdn._.ndcx
xcnn...nncx
xcccnnncccx
xxxcndncxxx
xxxcccccxxx
xxxxxxxxxxx
ENDMAP

### Multiple god overflow altars ###############################################

# These ones are multiple overflows to specific gods;
# they get tags temple_overflow_N and temple_overflow_<god>.

NAME:    good_gods_temple_1
TAGS:    transparent no_monster_gen no_trap_gen decor
MONS:    plant
KFEAT:   D = altar_elyvilon
KFEAT:   E = altar_zin
KFEAT:   F = altar_the_shining_one
SHUFFLE: DEF
SUBST:   1 : GTV1
SUBST:   X : GTt
SUBST:   ? : t@
FTILE:   @1t = floor_moss
FTILE:   .DEFGTV = floor_sprouting_ruin
: if you.in_branch("Depths") then
TILE:   G = dngn_statue_depths_zot_angel
: else
TILE:   G = dngn_statue_angel
: end
: standard_overflow_setup(_G, { { "elyvilon", "D" }, { "zin", "E" },
:                               { "the_shining_one", "F" } }, true)
MAP
  ttttttt
 tt.....tt
tt...E...tt
tt.D...F.tt
tt...1...tt
 tt.....tt
  tt...tt
   ?X@X?
ENDMAP

NAME:    good_gods_mini_temple
TAGS:    transparent no_monster_gen no_trap_gen no_pool_fixup no_item_gen decor
MONS:    plant
: if crawl.coinflip() then
SHUFFLE: x" / t1 / wT / IJ
: else
SUBST:   " : ..x
: end
SHUFFLE: EG / 'E, DEF
SUBST:   HI : x, J = G, x : xcvb, ' : .
: standard_overflow_setup(_G, { { "elyvilon", "D" }, { "zin", "E" },
:                               { "the_shining_one", "F" } }, true)
MAP
 xxxxx
xxxGxxx
xD.E.Fx
xx+++xx
 ""@""
ENDMAP

NAME:    dreamdust_divine_triumvirate
TAGS:    transparent no_monster_gen no_item_gen decor
NSUBST:  ? = 1:D / 1:E / 1:F
KFEAT:   a = granite_statue
: if you.in_branch("Depths") then
TILE:    a = dngn_statue_depths_zot_angel
TILE:    G = dngn_statue_depths_seraph
: else
TILE:    a = dngn_statue_angel
TILE:    G = dngn_statue_triangle
: end
: if crawl.one_chance_in(2) then
# Silver theme
KFEAT:   c = v
TILE:    c = dngn_metal_wall_white
COLOUR:  c- = white
FTILE:   -aDEFG = floor_w_marble
: else
# Gold theme
TILE:    c = wall_church
COLOUR:  c- = yellow
FTILE:   -aDEFG = floor_limestone
: end
: standard_overflow_setup(_G, { { "elyvilon", "D" }, { "zin", "E" },
:                               { "the_shining_one", "F" } }, true)
MAP
.....................
.cccccccca-acccccccc.
..ccccccca-accccccc..
 ..cca---------acc..
  ..cc---?-?---cc..
   ..cc---G---cc..
    ..cc--?--cc..
     ..cc---cc..
      ..ccacc..
       ..ccc..
        ..c..
         ...
ENDMAP

NAME:   grunt_temple_overflow_champion_of_chaos
TAGS:   transparent no_monster_gen
DEPTH:  D:3-10
MONS:   crimson imp ; dagger ego:chaos pre_id
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: standard_overflow_setup(_G, { { "makhleb", "A" }, { "xom", "B" } }, true)
MAP
xxxxx
xAGBx
x.1.x
x...x
xx+xx
ENDMAP

NAME:  grunt_temple_overflow_growth_and_decay
TAGS:  transparent decor
MONS:  plant, withered plant
SUBST: 1 = 1., 2 = 2.
: standard_overflow_setup(_G, { { "fedhas", "A" },
:                               { "kikubaaqudgha", "B" } }, true)
MAP
xxxxx
x111xx@@
x1A111..xxx
x11.....22xxxx
xxxx11.....22x
   xxx..222B2x
      @@xx222x
         xxxxx
ENDMAP

NAME:   grunt_temple_overflow_holy_war
TAGS:   transparent decor
MONS:   angel, profane servitor
FTILE:  A+_Kn1 = floor_limestone
FTILE:  B-;LN2 = floor_crypt
TILE:   c = wall_church
TILE:   C = wall_catacombs
KFEAT:  C = rock_wall
KFEAT:  KL = floor
KFEAT:  - = closed_door
KFEAT:  N = clear_stone_wall
KPROP:  12 = no_tele_into
KMASK:  12 = opaque
COLOUR: c = white
COLOUR: C = magenta
: single_cloud(_G, "K", "blessed fire", false)
: single_cloud(_G, "L", "foul pestilence", false)
: standard_overflow_setup(_G, { { "the_shining_one", "A" },
:                               { "yredelemnul", "B" } }, true)
MAP
xxxxxxxxxxxx@xxxxxxxxxxxx
xcccccccccc...CCCCCCCCCCx
xcnnK_K_K_c...C;L;L;LNNCx
xc1n_A____+...-;;;;B;N2Cx
xcnnK_K_K_c...C;L;L;LNNCx
xcccccccccc...CCCCCCCCCCx
xxxxxxxxxxxx@xxxxxxxxxxxx
ENDMAP

NAME:  grunt_temple_overflow_lords_of_destruction
TAGS:  transparent
DEPTH: D:3-10, Orc
MONS:  crimson imp ; wand of flame charges:1
: standard_overflow_setup(_G, { { "makhleb", "A" }, { "vehumet", "B" } }, true)
MAP
 xxxxx
xxA.Bxx
x..1..x
xx...xx
 xx.xx
  x+x
ENDMAP

NAME:  grunt_temple_overflow_order_and_chaos_1
TAGS:  transparent decor
: mons("angel god:zin dbname:zin_angel generate_awake perm_ench:" ..
:       util.random_choose_weighted{{"confusion", 10}, {"mute", 1},
:                                    {"mad", 1}, {"dumb", 1}})
KPROP: _1 = no_tele_into
KMASK: _1 = opaque
KMASK: _1 = no_trap_gen
FTILE: n_1 = floor_limestone
: standard_overflow_setup(_G, { { "xom", "A" }, { "zin", "B" } }, true)
MAP
 .......
....A....
..nnnnn..
..n___n..
@.n_1_n.@
..n___n..
..nnnnn..
....B....
 .......
ENDMAP

NAME:    grunt_temple_overflow_order_and_chaos_2
TAGS:    transparent decor
MONS:    executioner / balrug / green death / cacodemon / blizzard demon
MONS:    angel god:zin dbname:zin_angel
KFEAT:   L-_ = floor
KFEAT:   C = stone_wall
KFEAT:   N = clear_stone_wall
SUBST:   ; = -_, - = --_, X = C-
SHUFFLE: 12nN / 12nN / Gg''
KPROP:   -1 = bloody / nothing w:5
KPROP:   12gG = no_tele_into
KMASK:   12gG = opaque
COLOUR:  C = white
FTILE:   _BN2 = floor_limestone
TILE:    C = wall_church
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: vault_metal_statue_setup(_G, "g", "silver statue")
: standard_overflow_setup(_G, { { "makhleb", "A" }, { "zin", "B" } }, true)
MAP
    x.@.x
  xxx...xxx
xxxXXX+CCCxxx
xccc--;__CCCx
xc1nA-;_BN2Cx
xccc--;__CCCx
xxxXXX+CCCxxx
  xxx...xxx
    x.@.x
ENDMAP

NAME:   dolorous_temple_overflow_order_and_chaos_3
TAGS:   transparent no_item_gen no_monster_gen no_trap_gen decor
KPROP:  12 = no_tele_into
MONS:   generate_awake goblin god:nemelex_xobeh name:sharper n_suf n_des n_noc
MONS:   generate_awake angel god:zin dbname:zin_angel
TILE:   b = dngn_crystal_lightmagenta
FTILE:  ' = floor_limestone
COLOUR: b = lightmagenta
COLOUR: ' = brown
KMASK:  12 = opaque
: standard_overflow_setup(_G, { { "nemelex_xobeh", "A" }, { "zin", "B" } }, true)
MAP
 ....bbbb+vvvv....
..bbbb...'...vvvv..
.bb....U.'.T....vv.
.bmm.....'.....mmv.
.b1m..A..'..B..m2v.
.bmm.....'.....mmv.
.bb....U.'.T....vv.
..bbbb...'...vvvv..
 ....bbbb+vvvv....
ENDMAP

NAME:    grunt_temple_overflow_magic_moments
TAGS:    no_item_gen transparent decor
ITEM:    parchment of soul splinter
# You already get a (somewhat) direct damage spell from other god altars.
: local s = util.random_from({"hexes", "summoning", "translocation"})
: item("parchment disc:" .. s .. " slevel:1")
ITEM:    parchment of magic dart
SHUFFLE: AdB"C` / A'BeC` / A'B"Cf
: standard_overflow_setup(_G, { { "kikubaaqudgha", "A" }, { "sif_muna", "B" },
:                               { "vehumet", "C" } }, true)
MAP
     xxxxx
    xx.B.xx
  xxxG.".Gxxx
 xxGxx...xxGxx
 x...xx.xx...x
 xAd.......`Cx
 x...x.U.x...x
 xxGxx...xxGxx
  xxx  @  xxx
ENDMAP

# This doesn't place multiple gods, but it can place one of two distinct
# gods. Shouldn't get buniq_altar tags because it will eat both trog and makhleb
# while only placing one of the two.
# XXX: Maybe we should standardize this sort of thing, so shared generic
# overflow altar vaults feel a lot less generic when they choose 6 from 27?
NAME:  lightli_temple_of_fire
TAGS:  temple_overflow_1 temple_overflow_trog temple_overflow_makhleb
KPROP: Y = no_tele_into
KMASK: Y = no_monster_gen
{{
  local params = dgn.map_parameters()
  if params ~= nil then
    local tag = table.unpack(params)
    if tag ~= nil then
      if string.find(tag, "trog") ~= nil then
        kfeat('_ = altar_trog')
      elseif string.find(tag, "makhleb") ~= nil then
        kfeat('_ = altar_makhleb')
      else
        kfeat('_ = altar_trog / altar_makhleb')
      end
    else
      kfeat('_ = altar_trog / altar_makhleb')
    end
  else
    kfeat('_ = altar_trog / altar_makhleb')
  end
}}
MAP
llcccccc
lccYcYccc
lclllllcc
lcl...lcc
lcl...lYc
@+.._.lcc
lcl...lYc
lcl...lcc
lclllllcc
lccYcYccc
llcccccc
ENDMAP

NAME:    grunt_temple_overflow_opulence
TAGS:    transparent decor
SHUFFLE: GU, AB
FTILE:   .ABGU+ = floor_limestone
TILE:    x = wall_sandstone
COLOUR:  x = yellow
: vault_metal_statue_setup(_G, "G", "golden statue")
: standard_overflow_setup(_G, { { "gozag", "A" },
:                               { "nemelex_xobeh", "B" } }, true)
MAP
  xxxxxxx
 xx.....xx
xx...U...xx
x.........x
x.G.A.B.G.x
x.........x
xx...U...xx
 xx.....xx
  xxx+xxx
ENDMAP

NAME:   grunt_temple_overflow_gold_and_silver
TAGS:   transparent vaults_empty vaults_orient_s no_wall_fixup
DEPTH:  D:3-, Vaults, !Vaults:$
WEIGHT: 3 (Vaults), 10
KITEM:  $ = gold q:1 / gold q:2
: if crawl.one_chance_in(4) then
SUBST:  v = x
TILE:   x = wall_orc
FTILE:  +.ABG$ = floor_w_marble
:   vault_metal_statue_setup(_G, "G", "silver statue")
: else
COLOUR: v = white
TILE:   v = dngn_metal_wall_white
FTILE:  +.ABG$ = floor_limestone
:   vault_metal_statue_setup(_G, "G", "golden statue")
:   set_feature_name("metal_wall", "silver wall")
: end
: if you.in_branch("Vaults") then
SUBST: + = .
: end
: standard_overflow_setup(_G, { { "gozag", "A" }, { "zin", "B" } }, true)
MAP
vvvvvvvvv
v..$$$..v
v.A.G.B.v
v...$...v
vv.....vv
 vvv+vvv
ENDMAP

NAME:   grunt_temple_overflow_forces_of_nature
TAGS:   temple_overflow_2 temple_overflow_fedhas temple_overflow_qazlal
TAGS:   transparent
MONS:   fungus / plant / bush
KMONS:  D = pile of debris
SUBST:  2 = 1.
KPROP:  12Ll = no_tele_into
SUBST:  L = ll^., l = cll., c : cD
: if you.depth() ~= dgn.br_depth(you.branch()) then
KFEAT:  ^ = shaft trap
: end
: standard_overflow_setup(_G, { { "fedhas", "A" }, { "qazlal", "B" } }, true)
MAP
 222.@.LLL
21112.LlllL
21A.....BlL
21112.LlllL
 222.@.LLL
ENDMAP

NAME:   kennysheep_ying_yang
TAGS:   no_monster_gen no_trap_gen no_pool_fixup patrolling transparent decor
KFEAT:  D = tree
KFEAT:  '"wW = floor
TILE:   D = dngn_tree_dead
FTILE:  .t1ATW = floor_grass_dark
FTILE:  ` = floor_moss
COLOUR: tW = white
FTILE:  'D2BVw = floor_crypt
COLOUR: Dw = black
: standard_overflow_setup(_G, { { "elyvilon", "A" },
:                               { "yredelemnul", "B" } }, true)
MAP
       """""""
     """"`ccc"""
  """"""`''Dccc"""
  "ccccccD''DDccc"
 ""ctttttcD'''DDc""
 "cct....tcD'''Dcc"
 "ct.www.TtD''''Dc""
""ct.wwwA.tD''''Dcc"
"cct.www.TtD'''''Dc"
"ct......tcD'''''Dc"
"ct.....tccD'''''Dc"
"ct.....tcD''''''Dc"
"ct.....tDV'WWW'DDc"
"cct....tD'BWWW'Dcc"
""ct....tDV'WWW'Dc""
 "cct...tcD''''Dcc"
 ""ctt...tcDDDDDc""
  "ccctt..tcccccc"
  """ccct..`""""""
    """ccc`""""
      """""""
ENDMAP

NAME:    palyth_temple_overflow_mages
TAGS:    no_item_gen no_monster_gen patrolling transparent
# 3/5 chance for one altar to have a low-level randbook and extra orc wizards.
KMONS:   xyzXYZ~ = orc wizard
: local coinflip = util.random_from({"summoning", "forgecraft"})
: kitem("X = parchment disc:" .. coinflip .. " slevel:1")
KITEM:   Y = parchment disc:necromancy slevel:1
KITEM:   Z = parchment disc:conjuration slevel:1
SHUFFLE: x'y"z` / x'y"z` / X~y"z` / x'Y~z` / x'y"Z~
SUBST:   '"` = .
NSUBST:  ~ = 1:~ / 2:. / * = 1.
: standard_overflow_setup(_G, { { "sif_muna", "xX" }, { "kikubaaqudgha", "yY" },
:                               { "vehumet", "zZ" } }, true)
MAP
ccccccccccccc
c'x'c"y"c`z`c
c'''c"""c```c
cc+ccc+ccc+cc
c...........c
c....T.T....c
cc....T....cc
 cc..T.T..cc
  cc.....cc
   ccc@ccc
ENDMAP

# Xom seems to not think much of Hepliaklqana's ancestral focus,
# and mocks the species roots of incoming pilgrims.
# This will probably go over most players' heads, but it's neat anyway -- PF
NAME:    regret_index_temple_of_mockery
# we place the monster on demand via a marker rather than in the builder because
# the dependency on the player species otherwise can affect seed stability
{{
    local los_marker = TriggerableFunction:new {
      func="callback.do_species_mock",
      repeated=true,
      props = {mock_location=1}
    }
    los_marker:add_triggerer(DgnTriggerer:new {
      type="player_los"})

    lua_marker('D', los_marker)
}}
KMONS:   1 = spectral ugly thing
SHUFFLE: AB
SUBST:   G = G...
KPROP:   1D' = no_tele_into
KMASK:   1D' = no_item_gen
KMASK:   1D' = no_trap_gen
KMASK:   ' = no_monster_gen
MARKER:  1 = lua:fog_machine { cloud_type = "thin mist", \
             pow_min = 20, pow_max = 50, delay = 1, size = 1, \
             walk_dist = 1, start_clouds = 1, spread_rate = 10}
: standard_overflow_setup(_G, { { "xom", "A" }, { "hepliaklqana", "B" } }, true)
MAP
cccccc
ccb'bccccc
cbDn1bc.+.
c'nnnnc.c.
cb1nA...cc
ccbn.G.bc
cccc..Bcc
 c...bcc
 c+cccc
 c..c
ENDMAP

NAME:   gammafunk_temple_of_torment
TAGS:   no_monster_gen no_trap_gen temple_overflow_2 no_descent
WEIGHT: 2
: if you.depth() <= 4 then
MONS: zombie / hobgoblin draugr w:2 / orc draugr w:2
MONS: mummy / shadow imp / wight / mummy / phantom
KMONS: 3 = menkaure, wight
SUBST: 2 = 2---
: elseif you.depth() <= 7 then
MONS: zombie / gnoll draugr w:2 / adder draugr w:2 / mummy / \
      shadow imp / wight / mummy / phantom / bes kemwar
MONS: burial acolyte / wraith / vampire
KMONS: 3 = menkaure, burial acolyte / wraith / vampire
SUBST: 2 = 12--
: else
MONS: mummy / wight / zombie / steam dragon draugr w:2 / \
      howler monkey draugr w:2 / centaur draugr w:2 / phantom w:5 / \
      bes kemwar w:5
MONS: wraith / vampire / shadowghast / freezing wraith w:5 / skeletal warrior w:5
MONS: flayed ghost / phantasmal warrior
NSUBST: 2 = 2 / 2-
: end
SUBST:  1 = 11-
NSUBST: R = R / -
MARKER: P = lua:transp_loc("temple_of_torment_entry")
MARKER: Q = lua:transp_dest_loc("temple_of_torment_entry")
MARKER: R = lua:transp_loc("temple_of_torment_exit")
MARKER: S = lua:transp_dest_loc("temple_of_torment_exit")
TILE:   c = wall_tomb
FTILE:  -QRVDE|*$123Gcn = floor_tomb
COLOUR: -QR|*$123 = brown
: vault_granite_statue_setup(_G, "G", "sarcophagus")
: standard_overflow_setup(_G, { { "kikubaaqudgha", "A" },
:                               { "yredelemnul", "B" } }, true)
MAP
 ...............
 .nnnnnnnnnnnnn.
 .nR----1----Rn.
 .n-2-------2*n.
 .n--ccc-ccc-$n.
 .n--cGc-cGc-An.
..n----------|n..
@Pn1----Q---3YnS@
..n----------*n..
 .n--cGc-cGc-Bn.
 .n--ccc-ccc-$n.
 .n-2-------2|n.
 .nR----1----Rn.
 .nnnnnnnnnnnnn.
 ...............
ENDMAP

# Hep and Dith chose the same way to attract worshippers
NAME:   riverfiend_overflow_shadow_ancestor
KPROP:  12- = no_tele_into
KMASK:  12- = no_item_gen
KMASK:  12- = no_monster_gen
MONS:   ancestor, shadowghast
KFEAT:  DE = stone_wall
: local pm = "pow_min = 100, pow_max = 100, delay = 100, " ..
:            "size = 1, start_clouds = 1 , spread_rate = 50"
: marker("1 = lua:fog_machine { cloud_type = 'thin mist', " .. pm .. " }")
: marker("2 = lua:fog_machine { cloud_type = 'black smoke', " .. pm .. " }")
TILE:   D = wall_stone_smooth
TILE:   E = wall_stone_dark
: standard_overflow_setup(_G, { { "hepliaklqana", "A" },
:                               { "dithmenos", "B" } }, true)
MAP
   ccccc
 DDD...cEE
DD-n....nEE
D-1n....n-EE
D--nA..Bn2-E
DD-n....n--E
 DDD....n-EE
   cc@@cEEE
ENDMAP

NAME:   pdpol_temple_overflow_zin_treasury_gozag_greed
TAGS:   no_item_gen no_monster_gen
KITEM:  O = wand of digging charges:1 no_pickup
KFEAT:  m = iron_grate
KPROP:  $ = no_tele_into
KITEM:  $ = gold q:1 / gold q:2
RTILE:  x = wall_sandstone
COLOUR: x = yellow
COLOUR: c = white
TILE:   c = wall_church
FTILE:  .AB+c$ = floor_limestone
FTILE:  xm = floor_sandstone
: standard_overflow_setup(_G, { { "gozag", "A" }, { "zin", "B" } }, true)
MAP
  ccccccxxxxx
 cc..mm$x...xx
@+..Bm$$x.A..+@
 cc..mm$x...xx
  ccccccxxxxx
ENDMAP

NAME:    nzn_overflow_gifts_of_might_and_magic
TAGS:    temple_overflow_2 temple_overflow_trog temple_overflow_sif_muna
TAGS:    no_item_gen no_monster_gen patrolling transparent
COLOUR:  1- = red
COLOUR:  2' = blue
: local egos = {["antimagic"] = 1, ["heavy"] = 2, ["flaming"] = 2}
: if you.absdepth() <= 3 then
{{
local enchant = 2 + (crawl.one_chance_in(3) and 1 or 0)
local weapons = {["spear"] = 1, ["hand axe"] = 1, ["mace"] = 1,
                 ["falchion"] = 1}
kitem("1 = " .. dgn.random_item_def(weapons, nil, "ego:none plus:" .. enchant))
}}
KMONS:   1 = gnoll ; animal skin / Terence w:2
KMONS:   2 = white imp / Jessica w:2
KITEM:   2 = parchment slevel:1
: elseif you.absdepth() <= 7 then
:     if crawl.one_chance_in(5) then
KMONS:   1 = duvessa
KMONS:   2 = dowan
:     else
KMONS:   1 = orc warrior
KMONS:   2 = orc wizard
:     end
{{
local weapons = {["trident"] = 1, ["war axe"] = 1, ["flail"] = 1,
                 ["long sword"] = 1}
kitem("1 = " .. dgn.random_item_def(weapons, egos, "plus:0"))
}}
KITEM:   2 = randbook owner:Sif_Muna numspells:2 slevels:2
: else
KMONS:   1 = troll
KMONS:   2 = ynoxinul
{{
local weapons = {["partisan"] = 1, ["war axe"] = 1, ["morningstar"] = 1,
                 ["scimitar"] = 1}
kitem("1 = " .. dgn.random_item_def(weapons, egos, "plus:0"))
}}
KITEM:   2 = randbook owner:Sif_Muna numspells:3 slevels:4
: end
: standard_overflow_setup(_G, { { "trog", "A" }, { "sif_muna", "B" } }, true)
MAP
     xx@@@x
    xx...xx
   xx...xxxxx
  xx...xx-A-x
 xx...xcx-1-x
xx...xAx...xx
x'2'xcx...xx
x'B'xx...xx
xxxxx...xx
  xx...xx
  x@@@xx
ENDMAP

NAME:   hellmonk_overflow_destroyed_library
TAGS:   transparent no_item_gen no_monster_gen decor
KFEAT:  J = closed_clear_door
KFEAT:  H = iron_grate
ITEM:   any book
NSUBST: D = 1:c / *=c......
SUBST:  -:Hmm., J:JJ., l:Lll
: single_cloud(_G, "L", "flame", false)
TILE:   c = wall_studio
: standard_overflow_setup(_G, { { "trog", "A" }, { "sif_muna", "B" } }, true)
MAP
      @
    xx+xx
    x...x
   xx...xx
  xxD...Dxx
 xxD.....Dxx
 xD.......Dx
 xD..DDD..Dx
xxD..DlD..Dxx
xD....A....Dx
xx.DD...DD.xx
xx----J----xx
xx.ccc.ccc.xx
xc....B....cx
xxc..cdc..cxx
 xc..ccc..cx
 xc.......cx
 xxc.....cxx
  xxc...cxx
   xx...xx
    x...x
    xx+xx
      @
ENDMAP

NAME:    dolorous_overflow_abandoned_chaos_spawn_temple
TAGS:    transparent no_item_gen no_monster_gen no_trap_gen decor
SHUFFLE: DEF
NSUBST:  G = 2:g / *:G
NSUBST:  H = 1:+ / *:b
NSUBST:  . = 1:i / *:.
KPROP:   1 = no_tele_into
MONS:    generate_awake chaos spawn
KMONS:   g = pile of debris
KITEM:   i = any damaged weapon ego:chaos pre_id
COLOUR:  b = lightred
TILE:    b = dngn_crystal_lightred
KMASK:   1 = opaque
: vault_granite_statue_setup(_G, "G", "scintillating statue")
: set_feature_name("crystal_wall", "wall of orange crystal")
: standard_overflow_setup(_G, { { "xom", "D" }, { "makhleb", "E" },
:                               { "nemelex_xobeh", "F" } }, true)
MAP
   bbHbb
 bbbb.bbbb
bbb.....bbb
H....G....H
b.........b
b..D...E..b
b...mmm...b
H.G.m1m.G.H
b...mmm...b
b....F....b
b.........b
H....G....H
bbb.....bbb
 bbbb.bbbb
   bbHbb
ENDMAP

### Variable overflow altars ##################################################

# To make an overflow temple for N altars, give it the tag
# "temple_overflow_generic_N".

# The boring standard.
# B places the altar to a guaranteed god.
NAME:   overflow_temple_1_default
TAGS:   temple_overflow_generic_1 allow_dup transparent
MAP
B
ENDMAP

# General overflow vault, can be used for all gods.
NAME:     general_overflow_altar
TAGS:     no_monster_gen no_pool_fixup no_descent
SHUFFLE:  xXY / xXY / xXY / abc
SHUFFLE:  XY
SUBST:    X=+, Y=x, a=w, b=w, c=w
SHUFFLE:  ABCD
SUBST:    A=>, C='GTU, D='
SHUFFLE:  wll
KMASK:    . = !opaque
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
........
.xXYYxx.
.xwwwwx.
.xwABwx.
.xwCDwx.
.xwwwwx.
.xxxxxx.
........
ENDMAP

NAME:    old_standard_altar
TAGS:    transparent allow_dup
KFEAT:   z = c
TILE:    z = wall_stone_magic_shelf
SUBST:   y : zx, z : zx, x : xxxxcv
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...........
.xxxx.xxxx.
.xy.....zx.
.x.......x.
.x.......x.
.....B.....
.x.......x.
.x.......x.
.xz.....yx.
.xxxx.xxxx.
...........
ENDMAP

NAME:    lemuel_round_altar
TAGS:    transparent decor allow_dup
KFEAT:   z = c
TILE:    z = wall_stone_magic_shelf
SUBST:   X : x@, y : z., z : z., x : xxcv
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
  xxXxx
 xx...xx
xx.....xx
x.y...z.x
X...B...@
x.z...y.x
xx.....xx
 xx...xx
  xxXxx
ENDMAP

NAME:  lemuel_crystal_altar
TAGS:  transparent allow_dup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
b@b
@B@
b@b
ENDMAP

NAME:    lemuel_doored_altar
TAGS:    transparent decor temple_overflow_generic_1
SHUFFLE: XY
SUBST:   X = ., Y = +
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
.........
.xxxmxxx.
.xxxmxxx.
.xxxmxxx.
.X.YBY.X.
.xxxYxxx.
.xxx.xxx.
.xxxXxxx.
.........
ENDMAP

NAME:   lemuel_coloured_pillars_altar
TAGS:   transparent no_rotate decor
COLOUR: c = blue / yellow / red / cyan
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
xxxxxxxxxxxxxxxxxxxx
...................x
c...c...c...c...c..x
@.................Bx
c...c...c...c...c..x
...................x
xxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME: nicolae_overflow_crystal_walls
TAGS: transparent
SHUFFLE: ACDE, FGHI
SUBST: A : b, C : b., D : b., E : b., F : b, G : b., H : b., I : b.
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
AAAAA@FFFFF
ACCCC.GGGGF
ACDDD.HHHGF
ACDEE.IIHGF
ACDE...IHGF
@....B....@
FGHI...EDCA
FGHII.EEDCA
FGHHH.DDDCA
FGGGG.CCCCA
FFFFF@AAAAA
ENDMAP

NAME:    marbit_many_paths
TAGS:    transparent
SHUFFLE: pqr / bqr / pbr / pqb / bbr / pbb / bqb
SUBST:   pqr = .
NSUBST:  . = 1:0 / *:.
FTILE:   .B0 = FLOOR_PEBBLE_GREEN
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
 xxxxxxxxx
xx..qxq..xx
xpqrpqrpqrxx
@qrpqrpqrpBx
xrpqrpqrpqxx
xx..pxp..xx
 xxxxxxxxx
ENDMAP

NAME:  lemuel_tele_altar
TAGS:  transparent decor no_descent
SUBST: D = ^ x
KFEAT: ^ = teleport trap
KMASK: 'B = opaque
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...........
.xxxx^xxxx.
.x'''''''x.
.x'''''''x.
.x'''''''x.
.D'''B'''D.
.x'''''''x.
.x'''''''x.
.x'''''''x.
.xxxxDxxxx.
...........
ENDMAP

NAME:   pf_just_have_faith
TAGS:   no_monster_gen
WEIGHT: 1
KMASK:  $ = no_trap_gen
KFEAT:  m = lava mimic
# We use a statue mimic to stop autoexplore before the player reaches the lava.
KFEAT:  G = granite_statue mimic
# The gold pulls an unspoiled player next to the mimics.
KITEM:  $ = gold q:3 no_pickup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
xxxxx
xl.lx
x.B.x
x.$.x
xlmlx
xl$lx
xlmlx
x.$.x
x.G.x
..@..
ENDMAP

NAME:   amcnicky_altar_gilded
TAGS:   transparent no_monster_gen
SUBST: p = . $:5
SUBST: q = . $:2
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
.........
.mmmmmmm.
.mqqqqqm.
.mqpppqm.
.+qpBpqm.
.mqpppqm.
.mqqqqqm.
.mmmmmmm.
.........
ENDMAP

NAME:   mainiacjoe_overflow_brackets
TAGS:   transparent
KFEAT:  z = c
SUBST:  z : zzc, c : ccnvt
NSUBST: w = 1:. / *:w
SUBST:  w : wl
KMASK:  lw = no_monster_gen
KMASK:  w = no_pool_fixup
TILE:   z = wall_stone_magic_shelf
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...........
.wwwwwwwww.
.w.......w.
.w.ccccc.w.
.w.c.....w.
.w.z.B.z.w.
.w.....c.w.
.w.ccccc.w.
.w.......w.
.wwwwwwwww.
...........
ENDMAP

NAME:  mainiacjoe_overflow_boulevard
TAGS:  transparent
SUBST: P : cnvbtwl123
SUBST: Q : cnvbtwl123
MONS:  plant, bush, fungus
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
.............................
@.PPPP..QQQQ..B..QQQQ..PPPP.@
.............................
ENDMAP

NAME:  mainiacjoe_overflow_six_doors_small
TAGS:  transparent
SUBST: c : cvt
SUBST: P : cnvbtwl
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
cccc+cccc
+.......+
c.P...P.c
c.P.B.P.c
c.P...P.c
+.......+
cccc+cccc
ENDMAP

NAME:  mainiacjoe_overflow_tiny_flanked
TAGS:  transparent
SUBST: P : cnvbtwl123
MONS:  plant, bush, fungus
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
.......
.P.B.P.
.......
ENDMAP

NAME:   mainiacjoe_overflow_cross_hatched
TAGS:   transparent
SUBST:  p : cnvbtwl123
MONS:   plant, bush, fungus
KMASK:  wl = no_monster_gen
KMASK:  w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...........
.p.ppppp.p.
.p.......p.
.p.p...p.p.
.p.p.B.p.p.
.p.p...p.p.
.p.......p.
.p.ppppp.p.
...........
ENDMAP

NAME:  mainiacjoe_overflow_chevrons
SUBST: c : cvbn
SUBST: p : cnvbtwl123
SUBST: q : cnvbtwl123G
MONS:  plant, bush, fungus
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...........
...........
..ppppppp..
..ppppppp..
..pp.......
..pp.......
..pp..qqqq.
..pp..q....
..pp..q.B..
......q....
...........
ENDMAP

NAME:  mainiacjoe_overflow_24_doors
TAGS:  transparent
SUBST: c : xcvb
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
ccc+cc+cc+ccc
c.....c.....c
c.....c.....c
+cc+cc+cc+cc+
c..c.....c..c
c..c+ccc+c..c
c..c.....c..c
+..+..B..+..+
c..c.....c..c
c..c+ccc+c..c
c..c.....c..c
+cc+cc+cc+cc+
c.....c.....c
c.....c.....c
ccc+cc+cc+ccc
ENDMAP

NAME:   mainiacjoe_overflow_surrounded_room
TAGS:   transparent
SUBST:  c : cvb
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
    .......
.....ccccc.....
.ccccc...ccccc.
.+.....B.....+.
.ccccc...ccccc.
.....ccccc.....
    .......
ENDMAP

NAME:  mainiacjoe_overflow_alcove_1
TAGS:  transparent
SUBST: c : xcvbt
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
ccccccc
c.....c
c..B..c
cc@@@cc
ENDMAP

NAME:  mainiacjoe_overflow_alcove_2
TAGS:  transparent
SUBST: c : xcvb, G : GTUV
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
ccccccc
c.....c
c..B..c
c.....c
cGc.cGc
ccc@ccc
ENDMAP

NAME:  mainiacjoe_overflow_alcove_4
TAGS:  transparent
MONS:  plant, bush, fungus
SUBST: c : xcnvb, p : cnvbt123wl
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
ccccccccc
c.......c
c.p.B.p.c
c.p...p.c
c.ppppp.c
c.......c
ccc+++ccc
ENDMAP

NAME:    mainiacjoe_overflow_concentric_impassable
TAGS:    transparent
NSUBST:  l = 1:. / *:l, w = 1:. / *:w
KMASK:   wl = no_monster_gen
KMASK:   w = no_pool_fixup
SHUFFLE: wl
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...........
.lllllllll.
.l.......l.
.l.wwwww.l.
.l.w...w.l.
.l.w.B.w.l.
.l.w...w.l.
.l.wwwww.l.
.l.......l.
.lllllllll.
...........
ENDMAP

NAME:  mainiacjoe_overflow_catwalk
TAGS:  transparent
SUBST: l : lw
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
..........
..lllllll.
.llllll...
.llB....G.
.llllll...
..lllllll.
..........
ENDMAP

NAME:   mainiacjoe_overflow_paths
TAGS:   transparent
SUBST:  c : xcbvt, w : lw
KMASK:  wl = no_monster_gen
KMASK:  w = no_pool_fixup
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
@ccccccccc@
c..wwwww..c
c.w.....w.c
c.w.www.w.c
c.ww...ww.c
c.ww.B.ww.c
c.ww...ww.c
c.w.www.w.c
c.w.....w.c
c..wwwww..c
@ccccccccc@
ENDMAP

NAME:   mainiacjoe_overflow_small_starburst
TAGS:   transparent
SUBST:  c : cvbtwl
KMASK:  w = no_pool_fixup
KMASK:  wl = no_monster_gen
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
  .........
 ...cc.cc...
..c..c.c..c..
..cc.....cc..
......B......
..cc.....cc..
..c..c.c..c..
 ...cc.cc...
  .........
ENDMAP

# This overflow altar can only place on D:3, the bottom edge of where the early-
# game ecumenical altars place. It's supposed to count as both an overflow and
# an ecumenical altar vault, and this seemed the easiest way to implement that.
# The player can choose the ecumenical altar, or risk going downstairs and then
# coming back up for the known god.
NAME:    nicolae_overflow_ecumenical_swirl
TAGS:    transparent no_descent
DEPTH:   D:3
KFEAT:   _ = altar_ecumenical
KFEAT:   ~! = T
KFEAT:   HJ = G
SHUFFLE: !GH/JT~
SUBST:   } = }])
KMASK:   'B}])H~ = opaque
KMASK:   'B}])H~ = no_monster_gen
KMASK:   'B}])H~ = no_item_gen
COLOUR:  '` = yellow
FTILE:   '`_}])+~cnBGHT = floor_limestone
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...............
.....cc+cc.....
..!.cc```cc.!..
...cc`````cc...
..cc````ccccc..
.cc````ncH'Hcc.
.c`````n'''''c.
.c``_``n''B''c.
.c`````n'''''c.
.ccG`Gcn''''cc.
..ccccc''''cc..
...cc'''''cc...
..!.cc'}'cc.!..
.....ccccc.....
...............
ENDMAP

# Technically, you can also prove your dedication by burning a teleport scroll
# instead of dropping down a level, which I guess is also acceptable.
NAME:   nicolae_overflow_prove_your_dedication
TAGS:   transparent no_descent
DEPTH:  D:3-, !D:$, Depths, !Depths:$
KFEAT:  F : G w:20 / T / U
SUBST:  G : GGTU
KMASK:  `E>FB = opaque
KMASK:  `E>FB = no_monster_gen
KMASK:  `E>FB = no_item_gen
KPROP:  `E>FB = no_tele_into
MARKER: D = lua:transp_loc("nico_of_prove")
MARKER: E = lua:transp_dest_loc("nico_of_prove")
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
...........
.GcccncccG.
..cF```Fc..
.DnE`>`Bn.@
..cF```Fc..
.GcccncccG.
...........
ENDMAP

# I don't even see the code anymore. I just see shop, altar, bad pun.
NAME:  nicolae_overflow_streaming_green_lines
TAGS:  transparent decor
SUBST: p = bb.
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
      ...
    ...b...
  ...b...b...
...b...b...b...
.b...b.p.b...b.
...b.p.b.p.b...
.b.p.b...b.p.b.
.p.b.p.B.p.b.p.
.b.p.b...b.p.b.
...b.p.b.p.b...
.b...b.p.b...b.
...b...b...b...
  ...b...b...
    ...b...
      ...
ENDMAP

NAME:    nicolae_overflow_four_feature_corners
TAGS:    no_pool_fixup transparent decor
KFEAT:   M = iron_grate
SHUFFLE: bvcmwlM
KPROP:   l = no_cloud_gen
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
xxxx@xxxx
xbx...xbx
xx..v..xx
x.......x
@.v.B.v.@
x.......x
xx..v..xx
xbx...xbx
xxxx@xxxx
ENDMAP

NAME: nicolae_overflow_four_foyers_diagonal
TAGS: transparent decor
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
+xxx@xxx+
x..mTm..x
x.+xmx+.x
xmx...xmx
@Tm.B.mT@
xmx...xmx
x.+xmx+.x
x..mTm..x
+xxx@xxx+
ENDMAP

NAME: nicolae_overflow_four_foyers_orthogonal
TAGS: transparent decor
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
@..x+x..@
.T.m.m.T.
..mx+xm..
xmx...xmx
+.+.B.+.+
xmx...xmx
..mx+xm..
.T.m.m.T.
@..x+x..@
ENDMAP

NAME:    nicolae_overflow_lobbying_the_gods
TAGS:    transparent decor
SHUFFLE: {}/[]/(), DE, pq
SUBST:   D = c, E = @, p = T, q = G
SHUFFLE: TG
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
cEEEcccccEEEc
D...c...c...D
D.T.+.G.+.T.D
D...c...c...D
ccccc...ccccc
c...c...c...c
c.{.+.B.+.}.c
c...c...c...c
ccccc...ccccc
D...c...c...D
D.p.+.q.+.p.D
D...c...c...D
cEEEcccccEEEc
ENDMAP

NAME:    nicolae_overflow_rhomboverflow
TAGS:    no_pool_fixup transparent decor
SHUFFLE: cw
SUBST:   w : wwwwl
KPROP:   l = no_cloud_gen
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
    w
   wcw
  wc.cw
 wc...cw
wc..B..cw
 wc...cw
  wc.cw
   w.w
    @
ENDMAP

NAME:    nicolae_overflow_some_kind_of_shallow_water_thing
TAGS:    no_pool_fixup transparent decor
SHUFFLE: Ww
SUBST:   w : w:90 c:30 l
KPROP:   l = no_cloud_gen
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
.......
.wWwWw.
.WwWwW.
.wWBWw.
.WwWwW.
.wWwWw.
.......
ENDMAP

# Each transporter will take you in a straight line across the intersection, but
# only one will stop in the middle with the altar first.
NAME:    nicolae_overflow_soul_deal_at_the_crossroads
TAGS:    transparent decor
WEIGHT:  2
SHUFFLE: Sz/UB, Sz, UB
KMASK:   `BUSz = opaque
MARKER:  p = lua:transp_loc("nico_xroads_s")
MARKER:  P = lua:transp_dest_loc("nico_xroads_s")
MARKER:  q = lua:transp_loc("nico_xroads_e")
MARKER:  Q = lua:transp_dest_loc("nico_xroads_e")
MARKER:  r = lua:transp_loc("nico_xroads_n")
MARKER:  R = lua:transp_dest_loc("nico_xroads_n")
MARKER:  s = lua:transp_loc("nico_xroads_altar")
MARKER:  S = lua:transp_dest_loc("nico_xroads_altar")
MARKER:  z = lua:transp_loc("nico_xroads_w")
MARKER:  Z = lua:transp_dest_loc("nico_xroads_w")
: standard_overflow_setup(_G, { { "generic", "B" } }, true)
MAP
     xb@@bx
    xxc..cxx
   xxxc..cxxx
  xxxxc..cxxxx
 xxxxxcpRcxxxxx
xxxxxbcnncbxxxxx
bccccc````cccccb
@...Zn`SB`ns...@
@...qn`Uz`nQ...@
bccccc````cccccb
xxxxxbcnncbxxxxx
 xxxxxcPrcxxxxx
  xxxxc..cxxxx
   xxxc..cxxx
    xxc..cxx
     xb@@bx
ENDMAP

NAME:   amethyst_overflow_temple_binary
TAGS:   temple_overflow_generic_2 transparent
SUBST:  p : .:15 c:10 g:3 n:2
SUBST:  G : G:20 T:10 U:1 .:1
SUBST:  g : t:10 T:10 .:5 w:5 U:1 l:1
SUBST:  c : c:20 x:5 v:1 b:1
SUBST:  + : +:10 .:10 A:5
KMASK:  TUw = no_monster_gen
MAP
  ccc     ccc
 ccGcccccccGcc
cc...ccgcc...cc
cB.p..+.+..p.Bc
cc...cc.cc...cc
 ccGccg.gccGcc
  ccccc+ccccc
       @
ENDMAP

NAME:   gammafunk_temple_overflow_statue
TAGS:   temple_overflow_generic_2 transparent
SUBST:  g : t:10 T:10 .:5 w:5 l:5 U:1
KMASK:  wlTU = no_monster_gen
MAP
  ccc
cccGccc
c.B.B.c
cc...cc
ccg.gcc
 cc+cc
   @
ENDMAP

NAME:   gammafunk_temple_overflow_pools
TAGS:   temple_overflow_generic_2 transparent
SUBST:  G : G:20 T:10 U:1 .:1
KMASK:  TU = no_monster_gen
MAP
 ccccc ccccc
cc.B.ccc.B.cc
c.....G.....c
c..T.....T..c
cc.........cc
 ccc.....ccc
   ccc+ccc
      @
ENDMAP

NAME:    gammafunk_temple_overflow_elements
TAGS:    temple_overflow_generic_2 transparent
SHUFFLE: lw
KMASK:   lw = no_monster_gen
MAP
 ccccccc
ccB...Bcc
cclc+cwcc
 ccc@ccc
ENDMAP

NAME:    gammafunk_temple_overflow_wave
TAGS:    temple_overflow_generic_2 transparent
SUBST:   p = G:20 c:20 1 w:5 l:5
MONS:    plant / bush
KMASK:   Twl = no_monster_gen
MAP
   ccccc
 cccpcc
ccTB.+@
ccTB.+@
 cccpcc
   ccccc
ENDMAP

NAME:    jmf_multi_god_temple
TAGS:    transparent temple_overflow_generic_2
SHUFFLE: abc
SUBST:   a:+, b:x, c:x
MAP
............
.axxxxxxxxa.
.x........x.
.bT......Tb.
.x..B..B..x.
.cT......Tc.
.xxxxmmxxxx.
.xxx$$$$xxx.
.xx0....0xx.
..xx....xx..
...xG..Gx...
............
ENDMAP

NAME:  jmf_multi_god_temple2
TAGS:  transparent temple_overflow_generic_2
MAP
............
..vvvvvvvv..
.vv......vv.
.v..x..x..v.
.v.Bx..xB.v.
.v..x..x..v.
.vT0x..x0Tv.
.vvvx++xvvv.
...Gx..xG...
...+....+...
...GxxxxG...
............
ENDMAP

NAME:   mainiacjoe_overflow_catch_the_wave
TAGS:   temple_overflow_generic_2 transparent
NSUBST: p = 1:@ / *:.
NSUBST: q = 1:@ / *:.
SUBST:  b : cvbtwl123
MONS:   plant, bush, fungus
MAP
              .......
            ...bbbbb...
    ... .....bbb...bbb...
.....B...bbbbb......bbbb.
.bbb...bbb......bbb....b.
..bbbbbb......bbbbbb.....
....bbb...bbbbbb...bbbb..
.b......bbbbbb...B...bbb.
.bbb...bbb..... ... .....
...bbbbb...
  .......
ENDMAP

NAME:  mainiacjoe_overflow_two_lobes
TAGS:  temple_overflow_generic_2 transparent
SUBST: l : lwn
SUBST: b : bvt
KMASK: w = no_pool_fixup
KMASK: wl = no_monster_gen
MAP
  cccccc        cccccc
 cc....ccc    ccc....cc
 c.......cc  cc.......c
cc.bbb....c  c....bbb.cc
c....bbb..cccc..bbb....c
c......bb..ll..bb......c
c...B...b..ll..b...B...c
c......bb..ll..bb......c
c....bbb..+cc+..bbb....c
cc.bbb....c@@c....bbb.cc
 c.......cc  cc.......c
 cc....ccc    ccc....cc
  cccccc        cccccc
ENDMAP

NAME:  mainiacjoe_overflow_catwalk_spiral
TAGS:  temple_overflow_generic_2 transparent
SUBST: w : wl
KMASK: w = no_pool_fixup
KMASK: wl = no_monster_gen
MAP
...............
.wwwww.wwwwwww.
.w.....w.....w.
.w.wwwww.www.w.
.w.w...w.wBw.w.
.w.w.w.w.w.w.w.
.w.wBw.w...w.w.
.w.www.wwwww.w.
.w.....w.....w.
.wwwwwww.wwwww.
...............
ENDMAP

NAME:  mainiacjoe_overflow_big_doors
TAGS:  temple_overflow_generic_2 transparent
SUBST: c : cvb
SUBST: p : nvbtwl123G
MONS:  plant, bush, fungus
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
MAP
cccccc+++cccccc
c...+.....+...c
c.B.+.ppp.+.B.c
c...+.....+...c
cccccc+++cccccc
ENDMAP

NAME:  mainiacjoe_overflow_swirl
TAGS:  temple_overflow_generic_2 transparent
SUBST: c : cvb
MAP
       ccccc
       c...c
       c.B.c
 +cccccc...c
 c...c.ccc.c
 c.c.c....cc
 c.c...cc.c
 c.cc...c.c
cc....c.c.c
c.ccc.c...c
c...cccccc+
c.B.c
c...c
ccccc
ENDMAP

NAME:  mainiacjoe_overflow_divided_tiny
TAGS:  temple_overflow_generic_2 transparent
SUBST: c : xcvb
SUBST: l : wl
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
MAP
+cccccccc
c...l...c
c.B.l.B.c
c...l...c
cccccccc+
ENDMAP

NAME:  mainiacjoe_overflow_large_starburst
TAGS:  temple_overflow_generic_2 transparent
SUBST: b : cnvbtwl
KMASK: wl = no_monster_gen
KMASK: w = no_pool_fixup
MAP
.............
.b.bbb.bbb.b.
.b...b.b...b.
.bbb.b.b.bbb.
...b.b.b.b...
.B.........B.
...b.b.b.b...
.bbb.b.b.bbb.
.b...b.b...b.
.b.bbb.bbb.b.
.............
ENDMAP

NAME:  nicolae_overflow_squiral
TAGS:  temple_overflow_generic_2 no_pool_fixup transparent
MAP
........wwwwwwww
.wwwwwww.......w
.w......cccccc.w
.w.ccccc.....c.w
.w.c....wwww.c.w
.w.c.www...w.c.w
.w.c.wB.cc.w.c.w
.w.c.w...c.w.c.w
c.w.c.w...c.w.c.
c.w.c.ww.Bc.w.c.
c.w.c...ccc.w.c.
c.w.cccc....w.c.
c.w.....wwwww.c.
c.wwwwww......c.
c.......ccccccc.
cccccccc........
ENDMAP

NAME:    nicolae_overflow_two_pavilions
TAGS:    temple_overflow_generic_2 no_pool_fixup transparent
SHUFFLE: DEFH
SUBST:   DE : wl, FH : wl
KPROP:   l = no_cloud_gen
MAP
DDDDDDD@FFFFFFF
DcccccD.FcccccF
DcEEEcD.FcHHHcF
DcEB.......BHcF
DcEEEcD.FcHHHcF
DcccccD.FcccccF
DDDDDDD@FFFFFFF
ENDMAP

NAME:  nicolae_overflow_divine_pier_pressure
TAGS:  temple_overflow_generic_2 transparent decor no_pool_fixup
FTILE: @.mB : floor_sprouting_squares / floor_sprouting_stone / floor_vines / \
              floor_moss / floor_sprouting_ruin
MAP
wwwwwwwww
wwwwwwwww
wwmmmmmww
wwm.B.mww
@.......@
wwm.B.mww
wwmmmmmww
wwwwwwwww
wwwwwwwww
ENDMAP

NAME: minmay_overflow_temple_star_quad
TAGS: temple_overflow_generic_3 transparent
: decorative_floor(_G, 'V', "floral vase")
MAP
           c
           c
          ccc
          cBc
         cc.cc
         c...c
        cc...cc
        c.....c
      ccc.....ccc
    ccc....G....ccc
  ccc.....Vc......ccc
cccB.....GcccG.....Bccc
  ccc......cV.....ccc
    ccc....G....ccc
      ccc.....ccc
        c.....c
        cc...cc
         c...c
         cc.cc
          c.c
          c+c
           @
ENDMAP

NAME:   gammafunk_temple_overflow_forgotten
TAGS:   temple_overflow_generic_3 transparent
SUBST:  p = x:50 . 1, T = V:30 T, + = +:20 .
NSUBST: _ = 3:1 / *:_
MONS:   plant / bush
KMASK:  T = no_monster_gen
TILE:   x = wall_brick_brown_vines
FTILE:  _.+TV12B = floor_sprouting_stone
MAP
 ppppppp
pxB_B_Bxp
p_______p
p___T___p
px_____xp
 xxx+xxx
    @
ENDMAP

NAME:   grunt_temple_overflow_diamond
TAGS:   temple_overflow_generic_3 transparent
SUBST:  T = T G V:1 U:1 t:1
MAP
      c
     ccc
    ccBcc
   cc...cc
  cccc+cccc
 cc.c...c.cc
ccB.+.T.+.Bcc
 cc.c...c.cc
  cccc+cccc
   cc...cc
    cc.cc
     c.c
      @
ENDMAP

NAME:   gammafunk_temple_overflow_claw
TAGS:   temple_overflow_generic_3 transparent
SUBST:  l : lw
KMASK:  lw = no_monster_gen
MAP
  ...........
 ..cc..c..cc..
..cc..ccc..cc..
.ccc..ccc..ccc.
.ccc.ccccc.ccc.
.ccccccGcccccc.
.ccGB..B..BGcc.
..ccl.....lcc..
..ccll...llcc..
 ..ccll.llcc..
  ..ccl.lcc..
   ..cc+cc..
    ...@...
ENDMAP

NAME:   grunt_temple_overflow_cloverleaf
TAGS:   temple_overflow_generic_4 transparent
SUBST:  T : T U:1 V:1
FTILE:  .@TUVBG+m = floor_sprouting_squares
TILE:   c : dngn_stone_wall_green / dngn_stone_wall_blue
MAP
 ccccc.@.ccccc
cc...cc.cc...cc
c.m.G.c.c.G.m.c
c..B..c.c..B..c
c.G...c.c...G.c
cc...+c.c+...cc
.ccccc...ccccc.
@......T......@
.ccccc...ccccc.
cc...+c.c+...cc
c.G...c.c...G.c
c..B..c.c..B..c
c.m.G.c.c.G.m.c
cc...cc.cc...cc
 ccccc.@.ccccc
ENDMAP

NAME: nicolae_overflow_quartered_altars
TAGS: temple_overflow_generic_4 transparent
SHUFFLE: fgh/ijk, pq/rs
SUBST: pqi = ., rk = c, s = +, z : cm, j : GTt
CLEAR: fgh
MAP
  ffghgff
 @.ccccc.@
f.qp.c.pq.f
fcp..z..pcf
gc..BcB..cg
hcczccczcch
gc..BcB..cg
fcp..z..pcf
f.qp.c.pq.f
 @.ccccc.@
  ffghgff
ENDMAP

NAME:   mainiacjoe_overflow_alcove_3
TAGS:   temple_overflow_generic_4 transparent
MONS:   plant, bush, fungus
KMONS:  4 = sacred lotus
KFEAT:  4 = w
SUBST:  c : xccv
SUBST:  p : cnvbt1234wl
NSUBST: 4 = 1:4 / * = W
KMASK:  wl = no_monster_gen
KMASK:  w = no_pool_fixup
MAP
ccccccc
cB.c.Bc
c.....c
cc.p.cc
c..p..c
cB...Bc
ccc@ccc
ENDMAP

NAME:   nicolae_overflow_macrodata_refinement
TAGS:   temple_overflow_generic_4 transparent
COLOUR: n = white
COLOUR: . = green
TILE:   n = dngn_transparent_stone_white
FTILE:  .Bcn = floor_pebble_green
MAP
.........
....bn...
..B.bnB..
.nnnbn...
.bbbnbbb.
...nbnnn.
..Bnb.B..
...nb....
.........
ENDMAP

NAME:   minmay_overflow_temple_star_hex
TAGS:   temple_overflow_generic_5 transparent
KMASK:  T = no_monster_gen
MAP
          ccc
         ccBcc
        cc...cc
       cc.....cc
cccccccc...G...cccccccc
cB...................Bc
ccc......G...G......ccc
  ccc.............ccc
    ccc....T....ccc
  ccc.............ccc
ccc......G...G......ccc
cB...................Bc
cccccccc...G...cccccccc
       cc.....cc
        cc...cc
         cc.cc
          c+c
          ...
          .@.
ENDMAP

NAME:   minmay_overflow_temple_hex
TAGS:   temple_overflow_generic_6 transparent
: decorative_floor(_G, 'V', "floral vase")
MAP
   cccccccccc
   cB......Bc
  cc........cc
  cV..c..c..Vc
 cc..........cc
 c...c....c...c
cc............cc
cB..c......c..Bc
cc............cc
 c...c....c...c
 cc..........cc
  cV..c..c..Vc
  cc........cc
   cB......Bc
   cccc++cccc
      ....
      ....
      .@@.
ENDMAP

NAME:  grunt_temple_overflow_octagram
TAGS:  temple_overflow_generic_7 transparent
SUBST: T : T G t V:1
: decorative_floor(_G, 'p', "garden patch")
MAP
          c
         ccc
        ccBcc
   cccccc...cccccc
   cB..ccc+ccc..Bc
   c..cc.....cc..c
   c.c+.......+c.c
   ccc....T....ccc
  ccc...p...T...ccc
 cc.c...........c.cc
ccB.+..T..T..T..+.Bcc
 cc.c...........c.cc
  ccc...T...p...ccc
   ccc....T....ccc
   c.c+.......+c.c
   c..cc.....cc..c
   cB..ccc+ccc..Bc
   cccccc...cccccc
        cc.cc
         c.c
          @
ENDMAP

NAME:    grunt_temple_overflow_open
TAGS:    temple_overflow_generic_8 temple_overflow_generic_7
TAGS:    temple_overflow_generic_6 temple_overflow_generic_5
TAGS:    temple_overflow_generic_4 temple_overflow_generic_3
TAGS:    temple_overflow_generic_2
TAGS:    transparent
SHUFFLE: defghijk / efghijkd
{{
  local altarcount = 1
  if is_validating() then
    altarcount = 8
  else
    altarcount = get_overflow_altar_count(_G)
  end
  if altarcount == "1" then
    subst("d = B")
    subst("efghijk = .")
  elseif altarcount == "2" then
    subst("dh = B")
    subst("efgijk = .")
  elseif altarcount == "3" then
    subst("dgi = B")
    subst("efhjk = .")
  elseif altarcount == "4" then
    subst("dfhj = B")
    subst("egik = .")
  elseif altarcount == "5" then
    subst("dfgij = B")
    subst("ehk = .")
  elseif altarcount == "6" then
    subst("defhij = B")
    subst("gk = .")
  elseif altarcount == "7" then
    subst("defghij = B")
    subst("k = .")
  else
    subst("defghijk = B")
  end
}}
SUBST: G = G T V:1 U:1 t:1
MAP
   ...
 ...d...
 .k...e.
.........
.j..G..f.
.........
 .i...g.
 ...h...
   ...
ENDMAP

# Formerly minivault_3; resurrected after being removed way back in late 2009.
NAME:  minitemple
TAGS:  temple_overflow_generic_14 temple_overflow_generic_13
TAGS:  temple_overflow_generic_12 temple_overflow_generic_11
TAGS:  temple_overflow_generic_10 temple_overflow_generic_9
TAGS:  temple_overflow_generic_8 temple_overflow_generic_7
TAGS:  temple_overflow_generic_6 temple_overflow_generic_5
TAGS:  temple_overflow_generic_4 temple_overflow_generic_3
TAGS:  temple_overflow_generic_2
TAGS:  transparent
# The original vault had allow_dup; I think that's overkill.
{{
  local altarcount = get_overflow_altar_count(_G)
  if is_validating() or altarcount == nil then
    altarcount = 14
  end
  nsubst("B : " .. altarcount .. ":B / *:x")
}}
SUBST: x = .:50 c:50 G T t:1 V:1 U:1
MAP
cccccccccccc
cBcBcBcBcBcc
G.c.c.c.c.Bc
@.........Bc
@.........Bc
G.c.c.c.c.Bc
cBcBcBcBcBcc
cccccccccccc
ENDMAP

NAME: nicolae_overflow_hidden_temple
TAGS: temple_overflow_generic_5 temple_overflow_generic_4 temple_overflow_generic_3 \
      temple_overflow_generic_2 temple_overflow_generic_1 no_monster_gen no_descent
{{
  local altarcount = 1
  if is_validating() then
    altarcount = 5
  else
    altarcount = get_overflow_altar_count(_G)
  end
  if altarcount == "1" then
    subst("c = B")
    subst("abde = G")
  elseif altarcount == "2" then
    subst("bd = B")
    subst("ace = G")
  elseif altarcount == "3" then
    shuffle("ae/bd")
    subst("cbd = B")
    subst("ae = G")
  elseif altarcount == "4" then
    subst("abde = B")
    subst("c = G")
  else
    subst("abcde = B")
  end
}}
SUBST: } = })]
MAP
 xxxxxxxxxxxxx
 xxxxaxxxbxxxx
 xxG...G...Gxx
 mm.........mm
@m}.........cm@
 mm.........mm
 xxG...G...Gxx
 xxxxexxxdxxxx
 xxxxxxxxxxxxx
ENDMAP

NAME:    nicolae_overflows_in_rows
TAGS:    temple_overflow_generic_15 temple_overflow_generic_14 \
         temple_overflow_generic_13 temple_overflow_generic_12 \
         temple_overflow_generic_11 temple_overflow_generic_10 \
         temple_overflow_generic_9 transparent allow_dup
# I don't think temple_overflow_generic_15 is ever actually used, but I figured
# I might as well include it in the layout just in case it's used in the future.
{{
  local altarcount = 1
  if is_validating() then
    altarcount = 15
  else
    altarcount = tonumber(get_overflow_altar_count(_G))
  end
  if not altarcount then
    altarcount = 9
  end
  -- altar arrangements by row. rows of 3 have G or T at the ends.
  -- 9: 3/3/3. 10: 3/4/3. 11: 4/3/4. 12: 4/4/4. 13: 4/5/4. 14: 5/4/5. 15: 5/5/5.
  if altarcount >= 13 then
    subst("T=F")
  end
  if altarcount % 2 == 0 then
    subst("T=.")
    subst("F=Z")
    subst("H=F")
    subst("Z=H")
  end
  if altarcount >= 11 then
    subst("G=D")
  end
  if altarcount >= 11 and altarcount <= 13 then
    subst("D=Z")
    subst("E=D")
    subst("Z=E")
  end
}}
SUBST:   DF : B
SHUFFLE: GT
MAP
ccccccccccccc
c...........c
c.GEDEDEDEG.c
.............
..THFHFHFHT..
.............
c.GEDEDEDEG.c
c...........c
ccccccccccccc
ENDMAP

NAME:    nicolae_overflow_hallway_of_the_gods
TAGS:    temple_overflow_generic_11 temple_overflow_generic_10 \
         temple_overflow_generic_9 temple_overflow_generic_8 \
         temple_overflow_generic_7 temple_overflow_generic_6 \
         temple_overflow_generic_5 transparent allow_dup
{{
  local altarcount = 1
  if is_validating() then
    altarcount = 11
  else
    altarcount = tonumber(get_overflow_altar_count(_G))
  end
  if altarcount == 5 then
    subst("DFJ : B")
  elseif altarcount == 6 then
    subst("EHK : B")
  elseif altarcount == 7 then
    shuffle("EFHJK")
    subst("DEFH : B")
  elseif altarcount == 8 then
    shuffle("EFHJK")
    subst("EFHJ : B")
  elseif altarcount == 9 then
    shuffle("FK")
    subst("DEFHJ : B")
  elseif altarcount == 10 then
    subst("EFHJK : B")
  else
    subst("DEFHJK : B")
  end
}}
SUBST:   D : GGTTUt, E : GGTTUt, F : GGTTUt, H : GGTTUt, J : GGTTUt, K : GGTTUt
FTILE:   @ = floor_pebble_brown
FTILE:   .BGTUt = floor_sprouting_ruin
TILE:    c = dngn_stone_wall_brown
MAP
ccccccccccc
ccc.....ccc
cc...H...cc
c..J...F..c
c....c....c
c.K.ccc.E.c
c...cc....c
c@@@c..D..c@@@c
    c....cc...c
    c.E.ccc.K.c
    c....c....c
    c..F...J..c
    cc...H...cc
    ccc.....ccc
    ccccccccccc
ENDMAP

NAME:   chequers_temple_overflow_statue_of_worship
TAGS:   temple_overflow_generic_2 temple_overflow_generic_3
TAGS:   temple_overflow_generic_4 transparent
{{
  local altarcount = get_overflow_altar_count(_G)
  if altarcount == nil then
    altarcount = "2"
  end
  if altarcount == "2" then
    subst("C = .")
  else
    subst("C = B")
  end
  nsubst("B = " .. altarcount .. ":B / *:.")
}}
MAP
.....
..C..
.BGB.
..C..
.....
ENDMAP

NAME:  chequers_temple_overflow_minitemple
TAGS:  temple_overflow_generic_5 temple_overflow_generic_4
TAGS:  temple_overflow_generic_3
TAGS:  transparent
{{
  local altarcount = get_overflow_altar_count(_G)
  if is_validating() or altarcount == nil then
    altarcount = 5
  end
  nsubst("O = " .. altarcount .. ":B / *:l")
}}
KFEAT: l = altar_ecumenical
FTILE: .Bl = floor_mystic_chasm
FTILE: + = floor_pebble_blue
TILE:  c = dngn_stone_wall_blue
MAP
        @
       c+c
   ccccc.ccccc
  cc.........cc
ccc..ccccccc..ccc
cO..cccO.Occc..Oc
ccc..cc...cc..ccc
  cc.........cc
   cccc...cccc
      ccOcc
       ccc
ENDMAP

NAME: gammafunk_temple_overflow_arena
TAGS: temple_overflow_generic_3 temple_overflow_generic_2
TAGS: temple_overflow_generic_1 no_monster_gen no_trap_gen no_tele_into no_descent
WEIGHT: 1
{{
  local altarcount = 3
  if not is_validating() then
    altarcount = tonumber(get_overflow_altar_count(_G))
  end
  if altarcount == 1 then
    subst("h = a")
  elseif altarcount == 2 then
    subst("B = a")
  end
}}
SUBST: a = |*%$ .:80, 0 = 09., h = B, i : x., j : x., x : bcvx
NSUBST: R = R / .
MARKER: P = lua:transp_loc("temple_overflow_arena_entry")
MARKER: Q = lua:transp_dest_loc("temple_overflow_arena_entry")
MARKER: R = lua:transp_loc("temple_overflow_arena_exit")
MARKER: S = lua:transp_dest_loc("temple_overflow_arena_exit")
MAP
  ...........
 ..nnnnnnnnn..
 .nn0..R...nn.
 .nG.ji0ij.Gn.
 .n..ij.ji%$n.
..n......8*hn..
@Pn..Q....$BnS@
..n......9*hn..
 .n..ij.ji%$n.
 .nG.ji0ij.Gn.
 .nn0..R...nn.
 ..nnnnnnnnn..
  ...........
ENDMAP

NAME:  nicolae_overflow_sandstone_temple
TAGS:  temple_overflow_generic_7 temple_overflow_generic_6 \
       temple_overflow_generic_4 temple_overflow_generic_3 \
       temple_overflow_generic_1 transparent decor
{{
  local altarcount = 1
  if is_validating() then
    altarcount = 1
  else
    altarcount = tonumber(get_overflow_altar_count(_G))
  end
  if altarcount == 7 then
    subst("DEF : B")
  elseif altarcount == 6 then
    subst("EF : B")
  elseif altarcount == 4 then
    subst("DF : B")
  elseif altarcount == 3 then
    subst("E : B")
  elseif altarcount == 1 then
    subst("D : B")
  else
    subst("D : B")
  end
}}
SUBST:   D : G, E : T, F : U
SHUFFLE: GTU
COLOUR:  c` = brown
FTILE:   c`GTUB = floor_sandstone
TILE:    c = wall_sandstone
MAP
    ...
 .ccc.ccc.
 ..`````..
 cc`F`E`cc
.c```````c.
..`E`D`F`..
.c```````c.
 cc`F`E`cc
 ..`````..
 .ccc.ccc.
    ...
ENDMAP
