##############################################################################
#
# The Ossuary, a Tomb en miniature (Zaba)
#
#
# The Ossuary tries to pose an unusual early challenge: many alarm traps and
# slow monsters, making the player choose between pressing on towards the loot
# or leaving the vault.
#
# Flavour: Mini versions of Tomb and otherwise crypt like.
#
##############################################################################

{{
function ossuary_portal(e)
  local timeout_turns = crawl.random_range(600, 800)

  local messager =
    timed_msg {
      initmsg = { "You hear the hiss of flowing sand.",
                  "There is an entrance to an ossuary on this level. "
                  .. "Hurry and find it before the portal is buried!" },
      finalmsg = "The hiss of flowing sand is almost imperceptible now.",

      verb = 'hiss',
      -- This is always preceded by an article, so...
      noisemaker = 'avalanche of sand',
      ranges = {
        { 5000, 'slow ' },  { 4000, '' },
        { 2500, 'brisk ' }, { 1500, 'quick ' },
        { 0, 'rapid ' }
      }
    }

  e.lua_marker('O',
      timed_marker {
        disappear = "The hiss of flowing sand is gone.",
        entity = 'staircase',
        turns = timeout_turns,
        single_timed = true,
        floor = "expired_portal",
        feat_tile = "dngn_portal_ossuary_gone",
        msg = messager })
  e.tags("uniq_ossuary no_monster_gen chance_ossuary")
  e.chance(500)
  e.kfeat("O = enter_ossuary")
  e.colour("' = yellow")
  e.ftile("' = floor_sandstone")
  e.tile("c = wall_tomb")
end

-- Use the following line in destination maps after all SUBSTs
-- : ossuary_setup_features(_G)
-- Note that the function also defines < to be the exit portal.
function ossuary_setup_features(e)
  e.kfeat("< = exit_ossuary")
end

function callback.badplayer_boxes_open_up(data, triggerable, triggerer, marker,
                                          ev)
  if not data.triggered then
    data.triggered = true
    for slave in iter.slave_iterator("disappearing_wall", 1) do
      dgn.terrain_changed(slave.x, slave.y, "floor", false)
    end
    crawl.mpr("There is a click, and some walls slide away!", 'warning')
  end
end
}}

#### Portal entry vaults.
default-depth: D:4-8

NAME:   enter_ossuary_1
TAGS:   transparent
SUBST:  . = . ':7
: ossuary_portal(_G)
MAP
.....
.'''.
.'O'.
.'''.
.....
ENDMAP

NAME:    enter_ossuary_2
TAGS:    transparent
SHUFFLE: C+
SUBST:   C = c
: ossuary_portal(_G)
MAP
.......
.cc+cc.
.c'''c.
.C'O'C.
.c'''c.
.ccCcc.
.......
ENDMAP

NAME:   enter_ossuary_3
TAGS:   transparent
SUBST:  . = ' .
MONS:   rat zombie / jackal zombie / worm zombie
MONS:   kobold zombie / goblin zombie / hobgoblin zombie
MONS:   orc zombie / gnoll zombie / human zombie
SUBST:  . = .:100 11 2 3
: ossuary_portal(_G)
MAP
...
.O.
...
ENDMAP

NAME:   enter_ossuary_4
TAGS:   transparent
COLOUR: 1 = yellow, x = white
MONS:   rat zombie / quokka zombie / goblin zombie
FTILE:  1 = floor_sandstone, x = floor_sandstone, O = floor_sandstone
: ossuary_portal(_G)
MAP
.........
.ccccccc.
.c''O''c.
.c'''''c.
.c'c'c'c.
.c1c'c1c.
.ccc'ccc.
....'....
ENDMAP

NAME:   enter_ossuary_5
TAGS:   transparent
COLOUR: c = white, + = white, ' = yellow
: ossuary_portal(_G)
MAP
   ...
  ..c..
 ..cc+..
..cc'cc..
.cc'O'cc.
..cc'cc..
 ..ccc..
  ..c..
   ...
ENDMAP

NAME:   gup_ossuary_entry_pyramid
TAGS:   transparent
KMONS:  O = mummy
: ossuary_portal(_G)
MAP
     ...
    ..c..
   ..ccc..
  ..ccOcc..
 ..cc...cc..
..cc.....cc..
.ccccc+ccccc.
.............
ENDMAP

NAME: nicolae_ossuary_entry_catacombs
TAGS:   transparent
FTILE: O1s+ABC = floor_sandstone
COLOUR: 1s = yellow
NSUBST: A = + / c, B = + / c, C = + / c, s = 1:O / 4:1 / *:1.....
KMONS: O1 = orc skeleton / orc zombie w:5 / elf skeleton / elf zombie w:5 / \
            human skeleton / human zombie w:5
: ossuary_portal(_G)
MAP
ccccccccc
+'1'csAsc
ccc+c+cAc
cs+'''+sc
ccc'''ccc
cs+'''+sc
cCc+c+cBc
csCscsBsc
ccccccccc
ENDMAP

NAME: nicolae_ossuary_entry_false_entrances
TAGS: transparent
NSUBST: O = O / >
SHUFFLE: AB/AB/AB/BA
SUBST: A = m, B = c
FTILE: Om> = floor_sandstone
: ossuary_portal(_G)
MAP
   xxxxx
 +ccccccc+
 c'''c'''c
xc'O'A'O'cx
xc'''B'''cx
xccABBBAccx
xc'''B'''cx
xc'O'A'O'cx
 c'''c'''c
 +ccccccc+
   xxxxx
ENDMAP

NAME: nicolae_ossuary_entry_giza
TAGS: transparent
NSUBST: M = 1:O / *:z
KMONS: O = mummy
KMONS: z = goblin zombie / hobgoblin zombie / kobold zombie / orc zombie
FTILE: Oz = floor_sandstone
COLOUR: z = yellow
: ossuary_portal(_G)
MAP
          .
         ...
        ..c..
       ..ccc..
      ..ccMcc..
     ..ccc+ccc..
    ..c.......c..
   ..ccc.....ccc..
  ..ccMcc...ccMcc..
 ..ccc+ccc.ccc+ccc..
.....................
ENDMAP

NAME: nicolae_ossuary_entry_monument
TAGS: transparent
FTILE: G = floor_sandstone
: ossuary_portal(_G)
MAP
..G..
.'''.
G'O'G
.'''.
..G..
ENDMAP

NAME: nicolae_ossuary_entry_plus
TAGS: transparent
: if crawl.coinflip() then
SUBST: Dd = +, o = O, p = '
: else
SUBST: d = +, D = c, o = '
NSUBST: p = O / '
: end
FTILE: + = floor_sandstone
: ossuary_portal(_G)
MAP
.........
...cDc...
..'cpc'..
.ccc'ccc.
.Dp'o''d.
.ccc'ccc.
..'cpc'..
...cDc...
.........
ENDMAP

NAME: nicolae_ossuary_entry_ruins
TAGS: transparent
FTILE: GO = floor_sandstone
SUBST: c = -c, - = ''., ^ = '..
: ossuary_portal(_G)
MAP
.......
.cc-cc.
.c---c.
.--O--.
.c---c.
.cc-cc.
.......
ENDMAP

NAME: lightli_ossuary_entry_decrepit_ruins
TAGS: transparent ruin
NSUBST: a = 1:' / *:c
: ossuary_portal(_G)
MAP
GcccccG
cc'O'cc
caaaaac
c'''''c
c'''''c
cc'''cc
Gcc'ccG
   @
ENDMAP

NAME: chequers_ossuary_entry_cave
TAGS: transparent
: ossuary_portal(_G)
MAP
xxxxxcccccccxxxxx
xxxxcc'''''ccxxxx
xxxxcG''O''Gcxxxx
xxxxcc'''''ccxxxx
xxxxxccc'cccxxxxx
xxxxxxxc'cxxxxxxx
xxxxxxxcAcxxxxxxx
.................
@@@@@@@@@@@@@@@@@
ENDMAP

#### The portal vaults ####################################

# Reset default depth to prevent random generation of portal vaults.
# Sort destination maps by WEIGHT.
default-depth: Ossuary

###########################################################
# Common: WEIGHT 40
###########################################################

NAME:    ossuary_tomb_1
WEIGHT:  40
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen no_rotate
SHUFFLE: dwyz
SUBST:   w=2, y=2
NSUBST:  z= 1:1 / *:3
KFEAT:   T = alarm trap / floor
# loot: 12.5 items
ITEM:    any scroll w:2 / any scroll q:2 w:3 / \
         any potion w:4 / any potion q:2 w:6
MONS:    mummy
MONS:    rat zombie / jackal zombie / adder zombie / goblin zombie / \
         hobgoblin zombie / kobold zombie / \
         human zombie / elf zombie / centaur zombie
MONS:    kobold zombie / orc zombie / hobgoblin zombie
: ossuary_setup_features(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxx
x.........<A.........x
x....................x
x...cccccccccccccc...x
x...c.22*c...cdddc...x
x3..c1cccc...cdddc..3x
x..3c........+cccc3..x
x3..cccccc.<.....c..3x
x..3c.zzzc.......c3..x
x3..c.czzc.......c..3x
x...c.cccc.......c...x
x...c............c...x
x...c.ccccTTcccc.c...x
x...c.cyycTTcwwc.c...x
x...c.yyycTTcwww.c...x
x...ccccccTTcccccc...x
x....................x
x.3.3.3..G..G..3.3.3.x
x..3.3..........3.3..x
x....................x
xxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    ossuary_tomb_2
WEIGHT:  40
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen no_rotate
# Number of 1's is 53.
: if crawl.one_chance_in(10) then
SUBST:   ' = 1
SUBST:   1 = 1:20 2:10 .:80
: else
SHUFFLE: 1'
SUBST:   1 = 1:20 2:10 .:20
:end
SUBST:   z = 1
NSUBST:  B = 1:+ / *:c
NSUBST:  C = 1:+ / *:c
NSUBST:  D = 1:+ / *:c
NSUBST:  E = 1:+ / *:c
NSUBST:  F = 1:+ / *:c
NSUBST:  G = 1:+ / *:c
NSUBST:  H = 1:+ / *:c
NSUBST:  I = 1:+ / *:c
NSUBST:  J = 1:+ / *:c
NSUBST:  K = 1:+ / *:c
# loot: 12 items
ITEM:    any scroll w:6 / any potion / any potion q:2 w:2
MONS:    adder zombie / hobgoblin zombie / orc zombie / kobold zombie / nothing
MONS:    water moccasin zombie / gnoll zombie / nothing
MONS:    mummy
: ossuary_setup_features(_G)
MAP
cccccccccccccccccccccc
c<11H'''G1111F'''E111c
c111H'''G1111F'''E111c
c111H'''G1111F'''E111c
cIIIccccccccccccccDDDc
c'''c            c'''c
c'''c            c'''c
c'''c            c'''c
c'''c            c'''c
cJJJc            cCCCc
c111c            c111c
c111c            c111c
c111c            c111c
c111c            c111c
cKKKc            cBBBc
c'''c            c...c
c'''cccccccccccccc...c
c'''c...cddddc...c.z.c
c'''+3<3+d**dn.A.+...c
c'''c...cddddc...c.z<c
cccccccccccccccccccccc
ENDMAP

NAME:    ossuary_tomb_3
WEIGHT:  40
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen no_rotate no_vmirror
# zombies should be awake, so they march downwards in a line
MONS:    generate_awake orc zombie / generate_awake kobold zombie / \
         generate_awake hobgoblin zombie / generate_awake gnoll zombie
MONS:    mummy
MONS:    orc zombie / kobold zombie / hobgoblin zombie
ITEM:    nothing / any scroll w:5 / any potion
: ossuary_setup_features(_G)
MAP
cccccccccccccccccccccc
cccc.....2..2.....cccc
ccc..2...cccc...2..ccc
cc......cc..cc......cc
cc.....cc....cc.....cc
cc........22........cc
ccc..3....22....3..ccc
cccc..............cccc
cccc+cc........cc+cccc
cccc..cc111111cc..cccc
ccc....cc....cc....ccc
ccd.....c....c.....dcc
c$dd....c....c....dd$c
c$dd....c....c....dd$c
c$$d....c....c....d$$c
cc$dd...c....c...dd$cc
cc$$d..cc....cc..d$$cc
ccc$d..cc....cc..d$ccc
ccc$d.ccc.<A.ccc.d$ccc
cccccccccccccccccccccc
ENDMAP

###########################################################
# Rare: WEIGHT 20
###########################################################

NAME:    minmay_ossuary_two_tombs
WEIGHT:  20
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen
# Loot: between 5 scrolls/potions and 9 scrolls/potions, with some gold.
# The tomb close to the player is a bit easier than the other one, and is
# more likely to be the one with less loot, giving weak players a chance.
SHUFFLE: def$
NSUBST:  d = 1:1 / *:d
NSUBST:  e = 1:1 / *:e
NSUBST:  $ = 1:1 / *:$
SUBST:   2 = 2 3:1 .:1
SUBST:   3 = 3 2:1 .:1
ITEM:    any scroll, any potion
MONS:    mummy
MONS:    rat zombie / jackal zombie / quokka zombie / adder zombie / \
         goblin zombie / hobgoblin zombie / kobold zombie
MONS:    gnoll zombie / orc zombie / hound zombie / \
         human zombie / elf zombie / centaur zombie
: ossuary_setup_features(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxx
x........<..A........x
x....................x
x......cccccccc......x
x...cccc3223+ecccc...x
x..cc.......ceec2cc..x
x..c<.ccccc.cccc..+..x
x..cc.+dddc.....2cc..x
x..2ccccddc...cccc2..x
x2.....cccccccc.....2x
x..2....2.3.2.....2..x
x..2.....2.3.2....2..x
x2.....cccccccc.....2x
x..2cccc3+ffc3cccc2..x
x..cc2.2.cccc.c$$cc..x
x..+..........+$$<c..x
x..cc2.2.cccc.c$$cc..x
x...cccc3+ffc3cccc...x
x......cccccccc......x
x.......2.3.2........x
x........2.3.2.......x
xxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    ossuary_crypta
WEIGHT:  20
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen no_rotate no_vmirror
MONS:    mummy
MONS:    gnoll zombie / hobgoblin zombie / orc zombie / \
         human zombie / kobold zombie / goblin zombie / \
         centaur zombie
# mix of good items with useless ones
: item( dgn.loot_scrolls .. " / " .. dgn.loot_potions .. " / " ..
:       "scroll of noise ident:type w:33 / " ..
:       "potion of degeneration ident:type w:33" )
# and sometimes mostly useless ones
ITEM:    scroll of noise ident:type w:30 / scroll of immolation ident:type / \
         potion of mutation ident:type w:5 / \
         potion of degeneration ident:type w:40
# occasionally just use this
ITEM:    any potion / any scroll w:5 / nothing
SHUFFLE: hjkl
SUBST:   h:d, j:e, k:de, l:.de
NSUBST:  f = 6:f / *:e
NSUBST:  d = 2:M / *:d
NSUBST:  e = 2:M / *:e
SUBST:   M = 1f, d = dddf, e = eeef
NSUBST:  . = 6:^ / *:.
KFEAT:   ^ = alarm trap / floor w:20
: ossuary_setup_features(_G)
MAP
          vvv
        vvv1vvv
 ccccc vvfffffvv ccccc
 clllc vfff1fffv chhhc
 clllc vvvv^vvvv chhhc
 cc^cc    c^c    cc^cc
ccc.c   ccc+ccc   c.ccc
c2+.cc cc.....cc cc.+2c
ccc..ccc.......ccc..ccc
c2+...c.........c...+2c
ccc...+....U....+...ccc
c2+...c.........c...+2c
ccc..ccc.......ccc..ccc
c2+.cc cc.....cc cc.+2c
ccc.c   ccc+ccc   c.ccc
 cc^cc    c.c    cc^cc
 ckkkc   cc.cc   cjjjc
 ckkkc   c.A.c   cjjjc
 ccccc   c.<.c   ccccc
         ccccc
ENDMAP

# Scorpions, and lots of them. Hope you weren't expecting to breeze through
# the ossuary just because you found a mace of holy wrath!
NAME:   ossuary_minmay_scorpions
WEIGHT: 20
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen
MONS:   scorpion
MONS:   mummy
MONS:   gnoll zombie / hobgoblin zombie / orc zombie / \
        human zombie / kobold zombie / goblin zombie / \
        centaur zombie / scorpion zombie w:20
ITEM:   any scroll / any potion / any jewellery w:1 / nothing
SUBST:  1 = 1.
SUBST:  3 = 3.
: ossuary_setup_features(_G)
MAP
ccccccccccccccccccccccccc
c...c..3c..1c...ndddc131c
c.A.c...G...+...nd2d+313c
c...c3......c...ndddc131c
cc+cccG...Gccc+ccccccc+cc
c...c......3c...c3.1c...c
c.<.+...G...c...G...c...c
c...c...c3..c......3c...c
ccccccccccccccG...Gcc...c
c1.1cdddn...c3.....3c...c
c.3.+d2dn...+...G...c...c
c3.3cdddn...c..3c3.1c...c
cc+ccccccc+ccccccccccc+cc
c1...3c.....c...c...c3.1c
c.....c.....c...+...G...c
c.....G.....c...c......3c
c...........cc+cccG...Gcc
c3..........c3.3c3.....3c
cccG..3..Gccc...c...G...c
c3.........3c3.3c1.3c3.1c
c...........cc+ccccccc+cc
c.....G.....c...ndddc3.3c
c.....c.....+...nd2d+.3.c
c3...3c3...1c...ndddc1.1c
ccccccccccccccccccccccccc
ENDMAP

# Another ossuary (loosely) based on Tomb:2
NAME:    ossuary_minmay_tomb_2a
WEIGHT:  20
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen no_rotate
MONS:    rat zombie / jackal zombie / goblin zombie / hobgoblin zombie / \
         adder zombie / gnoll zombie / orc zombie / kobold zombie / \
         hound zombie / human zombie / elf zombie
MONS:    mummy
ITEM:    any scroll / any scroll q:2, any potion / any potion q:2
SHUFFLE: $de*
NSUBST:  B = 1:+ / *:n
NSUBST:  C = 1:+ / *:n
NSUBST:  D = 1:+ / *:n
NSUBST:  E = 1:+ / *:n
NSUBST:  X = 1:< / *:.
: ossuary_setup_features(_G)
MAP
ccccccccccccccccccccccccccccccc
c$$B...........<...........Cddc
c$$B.......................Cddc
cBBB.........ccccc.........CCCc
c.............................c
c....2.........1.........2....c
c.....cc....1.....1....cc.....c
c.....cc...............cc.....c
c.........1.........1.........c
c..c.......................c..c
c..cc..........X..........cc..c
c<.cc....1....XAX....1....cc.<c
c..cc..........X..........cc..c
c..c.......................c..c
c.........1.........1.........c
c.............................c
c.....cc....1.....1....cc.....c
c.....cc.......1.......cc.....c
c....2...................2....c
c.............................c
cEEE.........ccccc.........DDDc
c**E.......................Deec
c**E...........<...........Deec
ccccccccccccccccccccccccccccccc
ENDMAP

NAME:    ossuary_zaba_flooded
WEIGHT:  20
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen
{{
local flood_x, flood_y, n = -1, -1, 0

-- Find where to start the flood.
for x = 0, width() - 1 do
    for y = 0, height() - 1 do
        if mapgrd[x][y] == '.' then
            n = n + 1
            if crawl.one_chance_in(n) then
                flood_x, flood_y = x, y
            end
        end
    end
end

-- Flood it!
flood(flood_x, flood_y, crawl.random_range(6, 16), function(x, y, distance)
    local c = mapgrd[x][y]

    local replacements = {
        ['.'] = { {'.', 1}, {'W', 2} },
        ['x'] = { {'x', 5}, {'w', 5} },
        ['c'] = { {'c', 5}, {'w', 3}, {'W', 2}, {'x', 1} },
        ['+'] = { {'+', 10}, {'W', 5} },
        ['1'] = { {'2', 1} }
    }

    if replacements[c] then
        mapgrd[x][y] = util.random_choose_weighted(replacements[c])
    end

    if c == '+' or c == 'v' then
        return 0
    end

    return distance - 1
end)

}}
SHUFFLE: ABI/CDJ/EFK/GHL
SUBST:   A : ., B : A, I : <
SUBST:   EFKGHL : d
SUBST:   CDJ = 1112
MONS:    generate_awake zombie place:D:6 /\
         w:5 generate_awake mummy
MONS:    w:15 withered plant /\
         mummy \
         spells:throw_frost.18.wizard;slow.27.wizard \
         name:bog n_adj col:green/\
         w:5 nothing
ITEM:    any potion / any scroll / any jewellery w:1
: ossuary_setup_features(_G)
: lrockcol('brown')
MAP
      xxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxxxxxxxxxx
 xxxxxxxxxxxxxxxxxxxxxxxxx
 xxxxxcccccccccccccccxxxxx
 xxxxxc1c1c1c1c1c1c1cxxxxx
xxxxccc+c+c+c+c+c+c+cccxxxx
xxxxc1+.............+1cxxxx
xxxxccc.vv+vv+vv+vv.cccxxxx
xxxxc1+.vAAAv1vCCCv.+1cxxxx
xxxxccc.vABAvvvCDCv.cccxxxx
xxxxc1+.vAAIv1vJCCv.+1cxxxx
xxxxccc.vvvvv+vvvvv.cccxxxx
xxxxc1+.............+1cxxxx
xxxxccc.vvvvv+vvvvv.cccxxxx
xxxxc1+.vEEKv1vLGGv.+1cxxxx
xxxxccc.vEFEvvvGHGv.cccxxxx
xxxxc1+.vEEEv1vGGGv.+1cxxxx
xxxxccc.vv+vv+vv+vv.cccxxxx
xxxxc1+.............+1cxxxx
xxxxccc+c+c+c+c+c+c+cccxxxx
 xxxxxc1c1c1c1c1c1c1cxxxxx
 xxxxxcccccccccccccccxxxxx
 xxxxxxxxxxxxxxxxxxxxxxxxx
  xxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxx
      xxxxxxxxxxxxxxx
ENDMAP

###########################################################
# Very rare: WEIGHT 10
###########################################################

# Players have two choices: they can try to hang back and slowly fight the
# undead, or they can run to the gold relying on their speed/stealth.
#
# The former option is difficult since there's no choke point, whereas the
# latter option is inherently risky.  Gold averages a bit less than 200.
#
# Originally this vault had the monsters behind doors and an alarm trap
# before the gold, but then I found out that zombies can't open doors anymore.
NAME:   minmay_ossuary_gauntlet
WEIGHT: 10
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen
NSUBST: 1 = 2:1 / *:2
MONS:   mummy
MONS:   goblin zombie / hobgoblin zombie / gnoll zombie / \
        orc zombie / human zombie w:2 / elf zombie w:2 / centaur zombie w:2
: ossuary_setup_features(_G)
MAP
         ccccccccccccccccc
         c1c1c1c1c1c1c1c1c
  ccccc  c...............c
 cc...cc c...............c   ccccc
cc.....ccc...............cc cc$$$cc
c.........................ccc$$$$$c
c..<.A..................<....$$$$$c
c.........................ccc$$$$$c
cc.....ccc...............cc cc$$$cc
 cc...cc c...............c   ccccc
  ccccc  c...............c
         c1c1c1c1c1c1c1c1c
         ccccccccccccccccc
ENDMAP

NAME:    ossuary_the_hunt_dpeg
WEIGHT:  10
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen
# loot: 8 items of which 6 should be good.
# Most of the loot helps right here, if need be.
: item( dgn.loot_scrolls .. " / " .. dgn.loot_potions )
SUBST:   M = 111.
MONS:    mummy
MONS:    centaur zombie / hobgoblin zombie / nothing w:20
KFEAT:   ~ = net trap / alarm trap / dispersal trap w:5 / floor w:100
KFEAT:   ^ = net trap w:20 / dispersal trap w:5 / floor w:25
: ossuary_setup_features(_G)
MAP
           ccccccccccccccccccccc
 ccccccccccc2c2c2c2c2c2c2ccddddcc
cc1.......~~~~~~~~~~~~~~~~^.....cc
c.........~~~~~~~~~~~~~~~~^.....Mcc
c1....A.<.~~~~~~~~~~~~~~~~^.....M<c
c.........~~~~~~~~~~~~~~~~^.....Mcc
cc1.......~~~~~~~~~~~~~~~~^.....cc
 ccccccccccc2c2c2c2c2c2c2ccddddcc
           ccccccccccccccccccccc
ENDMAP

NAME:    ossuary_due_mausoleum
WEIGHT:  10
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen no_rotate no_vmirror
MONS:    orc skeleton / kobold skeleton / gnoll skeleton / orc skeleton
MONS:    mummy
MONS:    wraith
NSUBST:  = = 1:+ / *:c
ITEM:    any scroll / any potion / nothing
KITEM:   x = any scroll / any potion
KMONS:   x = wraith
: ossuary_setup_features(_G)
MAP
ccccccccccccccccccccccccccccc
ccccccccccccccccccccccccccccc
cc1.1...................1.1cc
cc.<.....................<.cc
cc1.1....ccccc+ccccc....1.1cc
cc......cc.........cc......cc
cc.....cc...cc=cc...cc.....cc
cc....cc...cm...mc...cc....cc
cc....c...cm.ddd.mc...c....cc
cc....+...=.ddxdd.=...+....cc
cc....c...cm.ddd.mc...c....cc
cc....cc...cm...mc...cc....cc
cc.....cc...cc=cc...cc.....cc
cc......cc.........cc......cc
cc1.1....ccccc+ccccc....1.1cc
cc.<.....................<.cc
cc1.1...................1.1cc
ccccccccccccc+++ccccccccccccc
ccccccccccccc...ccccccccccccc
ccccccccccdd+.2.+ddcccccccccc
ccccccccccddc111cddcccccccccc
ccccccccccccc111ccccccccccccc
ccccccccccccc111ccccccccccccc
ccccccccccccc...ccccccccccccc
ccccccccccccc...ccccccccccccc
ccccccccccccc...ccccccccccccc
ccccccccccccc...ccccccccccccc
ccccccccccccc+++ccccccccccccc
cccccccccccc.....cccccccccccc
ccccccccccc.......ccccccccccc
cccccccc3o...<.A...o3cccccccc
ccccccccccc.......ccccccccccc
cccccccccccc.....cccccccccccc
ccccccccccccc...ccccccccccccc
ccccccccccccccocccccccccccccc
cccccccccccccc3cccccccccccccc
ccccccccccccccccccccccccccccc
ENDMAP

# INDY: Oh, rats! ... He hates rats. He's scared to death of 'em.
NAME:    ossuary_due_small_catacomb
WEIGHT:  10
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen
ITEM:    any scroll / any potion
MONS:    kobold skeleton / goblin skeleton / gnoll skeleton / \
         orc skeleton
MONS:    mummy
# Loot: 10-19
# Some random content.
SHUFFLE: Bb/Zz, Dd/Ww, Ee/Vv
SUBST:   Z=c, z=c, W=c, w=c, V=c, v=c
SUBST:   B=X, D=X, E=X
NSUBST:  b = 1:+ / c
NSUBST:  d = 1:+ / c
NSUBST:  e = 1:+ / c
SUBST:   X = x2
# Guaranteed 10 items and 10 mummies, two in hidden rooms.
# 50/50 chance of loot for each of the eleven rats in the rat room.
KITEM:   x = any scroll / any potion
KMONS:   x = mummy
KITEM:   y = any scroll w:5 / any potion w:5 / nothing w:10
KMONS:   y = rat skeleton
: ossuary_setup_features(_G)
MAP
           ccc
         cccxccccc
       ccc....+..c      cccccc
      cc...ccccc.c     cc.+.1cc
     cc1.ccc  cc+cc   cc..cc..cc
    cc..cc   cc...ccccc..cccc..ccc
ccc cc+cc    c+.x.+.1...cc  cc...cc
cAccc...cc  ccb...cccxccc   cecc.cc
c..+..1.+c  cBcc+cc ccc   cceEec+cc
c<ccc...cc  ccb..cc   cccccxccc...ccc
ccc cc+cc   cc..+cccccc..+....+.x.+Xc
     c.cc  cc1.cc.cdDd.1ccccccc...ccc
     c1cc cc..cccc.cdd.cc     cc+cc
     c..cccc+cc  cc.cc+cc      cXc
     cc..cc...cccccc+yyyccccc  ccc
      cc.+..x..+...+yyyyy+.1cc
       cccc...cccxcccyyyccc..cc
          cc+cc ccc cc+cc cc..ccccc
           cxc       ccc   cc...+Xc
           ccc              ccccccc
ENDMAP

# Menkaure's pyramid
NAME:    ossuary_due_pyramid
WEIGHT:  10
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen no_rotate no_vmirror no_hmirror
MONS:    kobold zombie / gnoll zombie / orc zombie / rat zombie / \
         goblin zombie / hobgoblin zombie
MONS:    kobold skeleton / gnoll skeleton / orc skeleton / rat skeleton / \
         goblin skeleton / hobgoblin skeleton
MONS:    mummy
KMONS:   4 = Menkaure, mummy
# Loot: 1-16 items
ITEM:    any scroll / any potion / w:5 nothing
KFEAT:   ^ = floor w:20 / alarm trap
NSUBST:  ' = 25:1 / 25:2 / 30:^ / .
: ossuary_setup_features(_G)
MAP
                            cc
                           cccc
                          cccccc
                         cc''''cc
                        cc''cc''cc
                       cc''cccc''cc
                      cc''cccccc''cc
                     cc''cc''''cc''cc
                    cc''cc''cc''cc''cc
                   cc''cc''cccc''cc''cc
                  cc''cc''cccccc''cc''cc
                 cc''cc''cc''''cc''cc''cc
                cc''cc''cc''cc''cc''cc''cc
               cc''cc''cc''cccc''cc''cc''cc
              cc''cc''cc''ccddcc''cc''cc''cc
             cc''cc''cc''ccddddcc''cc''cc''cc
            cc''cc''cc''ccd3dd3dcc''cc''cc''cc
           cc''cc''cc''cc..d<<d..cc''cc''cc''cc
          cc''cc''cc''cc...4dd3...cc''cc''cc''cc
         cc''cc''cc''cc.....dd.....cc''cc''cc''cc
        cc''cc''cc''cccccccccccccc++cc''cc''cc''cc
       cc''cc''cc''''''''''''''''''''cc''cc''cc''cc
      cc''cc''cccccccccccccccccccccccccc''cc''cc''cc
     cc''cc''''''''''''''''''''''''''''''''cc''cc''cc
    cc''cccccccccccccccccccccccccccccccccccccc''cc''cc
   cc''''''''''''''''''''''''''''''''''''''''''''cc<Acc
  cccccccccccccccccccccccccccccccccccccccccccccccccccccc
ENDMAP

NAME:   ossuary_zaba_two_paths
# There is no way up in the end. This is to give the zombies in the beginning
# more time to go for a walk and another chance to meet the player.
ORIENT: encompass
WEIGHT: 10
TAGS:   no_item_gen no_monster_gen no_rotate
#
# Standard monsters: small zombies, large zombies, boss:
MONS:   kobold zombie / goblin zombie / orc zombie / hobgoblin zombie
MONS:   gnoll zombie
MONS:   mummy
#
KFEAT:  F = floor
COLOUR: F = cyan
KMONS:  F = rat simulacrum / goblin simulacrum / kobold simulacrum /\
            bat simulacrum / nothing w:80
KFEAT:  S = floor
COLOUR: S = green
KMONS:  S = spectral rat / spectral goblin / spectral kobold /\
            spectral bat / nothing w:80
# Loot.
ITEM:   any potion / any scroll / nothing w:1
KFEAT:  ' = alarm trap / floor w:90
#
: ossuary_setup_features(_G)
MAP
ccccccccccccccccccccccccccc
c2c2c2cc...........cc2c2c2c
c+c+c+c.............c+c+c+c
c..........G...G..........c
c.........................c
c+c+ccccccccc+ccccccccc+c+c
bScc'ccG2+.......+2Gcc'ccFv
bSScc'ccGc.......cGcc'ccFFv
bSSScc'ccc.12321.ccc'ccFFFv
bSSSScc'cc.......cc'ccFFFFv
bSSSSScc'c.......c'ccFFFFFv
bSSSSSS+'c...G...c'+FFFFFFv
bSSSSScc'c.......c'ccFFFFFv
bSSSScc'cc.......cc'ccFFFFv
bSSScc'ccc..ddd..ccc'ccFFFv
bSScc'ccGc..ddd..cGcc'ccFFv
bScc'ccG2+..ddd..+2Gcc'ccFv
ccc+ccccccccccccccccccc+ccc
c11111cc1c1c1c1c1c1cc11111c
c......c+c+c+c+c+c+c......c
c.........................c
c..........<.A.<..........c
ccccccccccccccccccccccccccc
ENDMAP

# A larger ossuary than usual: there is a corridor with some monsters (and
# chances of wights) to get past, and then a little treasure room at the end.
#
# A door in the treasure room leads to another corridor flanked with a wraith
# (a hint of what's to come) on one side, and a flying skull on the other:
# the flying skull is basically an intelligent alarm trap, both behind glass.
#
# At the end of the corridor is a second treasure room, this one also
# containing more flying skeleton alarm traps, plus wraiths inside 3x3 rooms.
#
NAME:    ossuary_due_cavern
WEIGHT:  10
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen
MONS:    centaur zombie w:1 / orc zombie / hobgoblin zombie /\
         kobold zombie / adder zombie / orc skeleton / hobgoblin skeleton /\
         ball python skeleton / nothing w:5
MONS:    wight
MONS:    flying skull
MONS:    wraith
ITEM:    any scroll / any potion
ITEM:    any scroll / any potion / any wand w:4
KMONS:   V = wraith
KMONS:   X = flying skull
SHUFFLE: VX
SUBST:   x = c:20 n:8
SUBST:   z = c:20 n:4
SUBST:   y = c:20 n:1
SUBST:   $ = 1:10 2:1
NSUBST:  4 = 2:4 / *:2
: ossuary_setup_features(_G)
MAP
  ccccccccc
 cc.......cc
cc.........c
c...<..A..cc
cc.......cc
 ccc.....cc
   cc...cc
    cc.ccc
     cc.cc
     cc.cc
     cc.cc
    cc.cc
   cc.cc                            ccccccccccccccccc
   cc..ccc                          c...............c
    cc...cc                         c.+cc..xxx..cc+.c
  ccc...ccc                         c.c4c..x3x..c4c.c
 cc......cccccccccccccccccccccccccccc.ccc..yzy..ccc.c
cc........cc$c$c$c$c$cc.....cccccVccc...............c
c..........c+c+c+c+c+cc.GdG.cccccoccc.cxy..eee..yxx.c
c..c.......+..........+..d....+.....+.c3z..eee..z3x.c
cc.cc......c+c+c+c+c+cc.GdG.cccccoccc.cxy..eee..yxx.c
cc.c......cc$c$c$c$c$cc.....cccccXccc...............c
cc.cc....cccccccccccccccccccccccccccc.ccc..yzy..ccc.c
 cc.....cc                          c.c4c..x3x..c4c.c
  cc...cc                           c.+cc..xxx..cc+.c
   ccccc                            c...............c
                                    ccccccccccccccccc
ENDMAP


# Four chambers, one with loot and the exit, three with zombies and a mummy.
# (The player won't know which is which because Crawl rotates the vault.)
#
# Stealthy players can close the doors without the mummy noticing. This is
# probably okay, but may turn out to be too easy.... -- dpeg
NAME:   ossuary_minmay_four_chambers
WEIGHT: 10
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen
MONS:   human zombie / elf zombie / centaur zombie
MONS:   mummy
ITEM:   any scroll / any potion / any scroll q:2 w:2 / any potion q:2 w:2
: ossuary_setup_features(_G)
MAP
            ccc
          cccdccc
         ccdddddcc
         c..ddd..c
         c...d...c
         c.......c
         cc.....cc
          ccc.ccc
            c+c
  ccccc   ccc.ccc   ccccc
 cc1.1cc cc.....cc cc1.1cc
 c.....c c.......c c.....c
cc.....ccc...<...ccc.....cc
c2......+...<A<...+......2c
cc.....ccc...<...ccc.....cc
 c.....c c.......c c.....c
 cc1.1cc cc.....cc cc1.1cc
  ccccc   ccc.ccc   ccccc
            c+c
          ccc.ccc
         cc.....cc
         c1.....1c
         c.......c
         c1.....1c
         cc.....cc
          ccc2ccc
            ccc
ENDMAP

# The intent is that the mummies chase the player through the whole ossuary,
# forcing the player to either move quickly or soak up some death curses.
#
# rip -- PF
NAME:   ossuary_minmay_chase
WEIGHT: 10
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen
MONS:   rat zombie / quokka zombie / adder zombie /\
        goblin zombie / hobgoblin zombie / kobold zombie / gnoll zombie w:2 /\
        human zombie w:1 / elf zombie w:1 / orc zombie w:1
MONS:   generate_awake mummy
ITEM:   any scroll / any potion / gold w:4
KFEAT:  ~ = net trap / floor
: ossuary_setup_features(_G)
MAP
ccccc     ccc ccc ccc
cdddccccccc1ccc1ccc1ccccccc
cddd~~~~c.............c~~~c
cd<d~~<~+.............+~<~c
cddd~~~~c.............c~~~c
cdddccccccc1ccc1ccc1cccc+cc
ccccc     ccc ccc ccc c...c
                     cc...cc
                     c1...1c
                     cc...cc
                      c...c
                     cc...cc
                     c1...1c
                     cc...cc
                      c...c
                     cc...cc
                     c1...1c
                     cc...cc
cccc      ccc ccc ccc c...c
c2.cccccccc1ccc1ccc1cccc+cc
cc......c.............c~~~c
c2..A.<.+.............+~<~c
cc......c.............c~~~c
c2.cccccccc1ccc1ccc1ccccccc
cccc      ccc ccc ccc
ENDMAP

NAME:   ossuary_boxes_badplayer
WEIGHT: 10
TAGS:   no_item_gen no_monster_gen
ORIENT: encompass
MONS:   rat zombie / quokka zombie / adder zombie /\
        goblin zombie / hobgoblin zombie / kobold zombie / gnoll zombie w:2 /\
        human zombie w:1 / elf zombie w:1 / orc zombie w:1
MONS:   mummy
MONS:   ogre zombie w:45 / centaur zombie w:50 / troll zombie w:5
KMONS:  N  = mummy
KMONS:  O  = Menkaure w:5 / mummy, mummy
KFEAT:  N  = $
KFEAT:  O  = exit_ossuary
KFEAT:  ab = stone_wall
KITEM:  $  = any scroll w:49 / any potion w:49 / any wand w:1 / any ring w:1
NSUBST: `  = 2:2 / *:.
NSUBST: 1  = 25:1 / *:. , 3 = 5:3 / *:.
NSUBST: a  = 1:+ / *:a , B = 1:+ / *:c , C = 1:+ / *:c , D = 1:+ / *:c
NSUBST: E  = 1:+ / *:c , F = 1:+ / *:c , G = 1:+ / *:c , H = 1:+ / *:c
NSUBST: I  = 1:+ / *:c , J = 1:+ / *:c , K = 1:+ / *:c , L = 1:+ / *:c
NSUBST: M  = 1:+ / *:c
{{
lua_marker(":", Triggerable.synchronized_markers(
  function_at_spot( "callback.badplayer_boxes_open_up",
                    { triggered = false }, true,
                    { only_at_slave = true, listen_to_slaves = true })))

lua_marker('ab', props_marker {disappearing_wall = 1})
}}
: ossuary_setup_features(_G)
MAP
ccccccccccccccccccccccccccccccc
cA```````````````````````````<c
c`````````````````````````````c
c``ccccc+ccc+ccc+ccc+ccc+ccc``c
c``c111c111c111c111c111c111c``c
c``c1cGcGGccHHHcIIIccJJcJc1c``c
c``+1G....c....c....c....J1c``c
c``ccc....c....c....c....ccc``c
c``c1G....c....c....c....J1+``c
c``c1G...3b3...c3...b3...J1c``c
c``+1ccccbbaaaacaaaabbcccc1c``c
c``ccc....a:::::::::a....ccc``c
c``c1F....a:.......:a....K1+``c
c``c1F....a:..$$$..:a....K1c``c
c``+1F3...a:.$$N$$.:a3...K1c``c
c``cccccccc:.$NON$.:cccccccc``c
c``c1E....a:.$$N$$.:a....L1+``c
c``c1E....a:..$$$..:a....L1c``c
c``+1E....a:.......:a....L1c``c
c``ccc3...a:::::::::a3...ccc``c
c``c1ccccbbaaaacaaaabbcccc1+``c
c``c1D....b....c....b....M1c``c
c``+1D....c....c....c....M1c``c
c``ccc....c....c....c....ccc``c
c``c1D3...c3...c3...c3...M1+``c
c``c1cDcDDccCCCcBBBccMMcMc1c``c
c``c111c111c111c111c111c111c``c
c``ccc+ccc+ccc+ccc+ccc+ccccc``c
c`````````````````````````````c
c<```````````````````````````Ac
ccccccccccccccccccccccccccccccc
ENDMAP

NAME:   ossuary_kennysheep_city_of_the_dead
WEIGHT: 10
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen
KMONS:  1W = wraith
KMONS:  2 = mummy
KMONS:  3 = goblin zombie / hobgoblin zombie / kobold zombie / gnoll zombie w:2 /\
        human zombie w:1 / elf zombie w:1 / orc zombie w:1 / nothing w:36
KITEM:  12d = any potion / any scroll / any jewellery w:1
NSUBST: d = 1:1 / 3:2 / 4:. / *:d
: ossuary_setup_features(_G)
MAP
ccccccccccccccccccccccccccccc
c...........................c
c...........................c
c..xxx..xxx..xxx..xxx..xxx..c
c..xdx..xdx..xdx..xdx..xdx..c
c..x+x..x+x..x+x..x+x..x+x..c
c..x.x..x.x..x.x..x.x..x.x..c
c...........................c
c...........................c
c..xxxx..3...xxx...3..xxxx..c
c..xd+..3G3..xdx..3G3..+dx..c
c..xxxx..3...x+x...3..xxxx..c
c............x.x............c
c...........................c
c..xxxx.xxxx..3..xxxx.xxxx..c
c..xd+..xd+..3G3..+dx..+dx..c
c..xxxx.xxxx..3..xxxx.xxxx..c
c...........................c
c............x.x............c
c..xxxx..3...x+x...3..xxxx..c
c..xd+..3G3..xdx..3G3..+dx..c
c..xxxx..3...xxx...3..xxxx..c
c...........................c
c...........................c
c..x.x..x.x..x.x..x.x..x.x..c
c..x+x..x+x..x+x..x+x..x+x..c
c..xdx..xdx..xdx..xdx..xdx..c
c..xxx..xxx..xxx..xxx..xxx..c
c...........................c
c...........................c
ccccccccccccc+++ccccccccccccc
           cc...cc
          cc.....cc
       cccc.......cccc
       cWn...<.A...nWc
       cccc.......cccc
          cc.....cc
           cc...cc
            ccncc
             cWc
             ccc
ENDMAP
