###
# V for Volcano!
#
# A combined effort of ideas, execution and tweaking by Jude, dpeg, and Zaba!
###
#
# i. Threats
#
# Initial threat is the volcano itself; while there is quite a
# delay between explosions, the flame clouds are quite powerful
# and cover quite a large area; this could kill an early level
# character easily, so beware!
#
# Loot-guard threats are defined in the fiery_guardians function.
# Please see the comments there for explanations, and lists of
# possible threats.
#
# Extra threats will be listed as MONS: lines.
#
# ii. Loot
#
# All volcanoes have a combination of the following items, though
# the amounts of each usually vary. In addition, they also have
# whatever armour or weapons have been created for the monsters that
# populate the level.
#
#   Fire resistance ego armour (any type of armour; this also
#                               includes dragon scales, which is not
#                               given extra rF+)
#   Flaming ego weapons        (a selection of high-damage weapons)
#   Gold
#   "Good" potions with fire themes (see setup_loot() for the list)
#
# In addition, some volcanos have extra items taken from:
#   "Random item"
#   "Fruit"
#
# See setup_loot() for more information.
#
###
{{
-- ####
-- # General setup and design functions: (head to line 382 for the maps)

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

    local messager =
      timed_msg {
        initmsg = { "You feel an oppressive heat about you.",
                    "There is an entrance to a volcano on this level. "
                    .. "Hurry and find it before the entrance collapses!" },
        finalmsg = "The sound of falling rocks suddenly begins to subside.",

        verb = 'rumble',
        noisemaker = 'avalanche of rocks',
        ranges = {
          { 5000, 'slow ' },  { 4000, '' },
          { 2500, 'brisk ' }, { 1500, 'quick ' },
          { 0, 'rapid ' }
        }
      }

    e.lua_marker('O',
      timed_marker {
        disappear = "There is a deep roar from within the tunnel. Moments " ..
                    "later, a river of lava pours forth, sealing it permanently.",
        entity = 'tunnel',
        turns = timeout_turns,
        single_timed = true,
        floor = "expired_portal",
        feat_tile = "dngn_portal_volcano_gone",
        msg = messager })
    e.tags("uniq_volcano chance_volcano")
    e.chance(500)
    e.kfeat("O = enter_volcano")
    e.kfeat("S = .")
    e.colour("XS = red")
    e.rtile("X = wall_volcanic")
    e.kfeat("X = rock_wall")
    e.ftile("OS = floor_rough_red")
end

-- Destinations:
function volcano_setup (e)
    setup_loot(e)
    e.kfeat("< = exit_volcano")
    e.kfeat("I = exit_volcano")
    e.kfeat("^ = alarm trap")
    e.subst("L : LLL.l")
    e.subst("L = lll.")
    e.subst("y : yyy.x")
    e.subst("y = xxx.")
    e.colour("c = lightred")
    e.set_feature_name("stone_arch", "rock-blocked tunnel")
end

-- "Volcano" functions. While the sizes may appear extreme, they are carefully
-- weighted and balanced and have been tested extensively.
function callback.volcano_in_radius_12(x, y)
  return dgn.point_in_radius(dgn.point(x, y), dgn.point(you.pos()), 12)
end

local large_warning = tw_machine(3, "The air gets thick with the scent of sulphur.",
                                 "In the distance, the volcano erupts with a roar.",
                                 "The volcano comes to life with a roar!")

local small_warning = tw_machine(3, nil, nil, nil, "The volcano roars to life, " ..
                                 "belching forth lava!", "The air gets thick with " ..
                                 "the scent of sulphur.",
                                 "callback.volcano_in_radius_12")

function place_large_volcano(e)
    e.kfeat("V = l")
    e.lua_marker('V', fog_machine { cloud_type = "flame", walk_dist=15, pow_max=6,
                                   delay = 300, size = 10000, spread_rate = 30,
                                   listener = large_warning, excl_rad = -1 })
end

function place_chained_volcano(e)
    e.kfeat("V = l")
    e.lua_marker('V', chained_fog_machine { cloud_type = "flame", walk_dist=15, pow_max=6,
                                            delay = 300, size = 100, spread_rate = 30,
                                            listener = large_warning, excl_rad = -1 } )
end


function place_small_volcano(e)
    e.kfeat("V = l")
    e.lua_marker('V', fog_machine { cloud_type = "flame", walk_dist=15, pow_max=6,
                                   delay = 300, size = 800, spread_rate = 30,
                                   listener = small_warning, excl_rad = -1 })
end

function place_lake_volcanoes (e, glyphs)
    for _, glyph in ipairs(glyphs) do
        place_lake_volcano(e, glyph)
    end
end

function place_lake_volcano (e, glyph)
    e.kfeat(glyph .. " = l")
    e.lua_marker(glyph, chained_fog_machine { cloud_type = "flame", walk_dist=0,
                            pow_max=6, delay_min = 300, delay_max = 800,
                            size = 125, spread_rate = 5,
                            listener = small_warning, excl_rad = -1 })
end

function place_tiny_volcano(e)
    e.kfeat("V = l")
    e.lua_marker('V', fog_machine { cloud_type = "flame", walk_dist=10, pow_max=6,
                                   delay = 800, size = 40, spread_rate = 10,
                                   listener = large_warning, excl_rad = -1 })
end
-- #
-- ###

-- ###
-- # Loot functions:

function make_fiery_armour (e, armour)
    local armour_string = ""
    for _, at in ipairs(armour) do
        armour_string = armour_string .. " / " .. at .. " ego:fire_resistance ident:type good_item"
    end
    return string.gsub(armour_string, "%s*/$", "")
end

function make_fiery_weapon (e, weapon)
    local weapon_string = ""
    for _, wt in ipairs(weapon) do
       weapon_string = weapon_string .. " / " .. wt .. " ego:flaming ident:type"
    end
    local n_weapon = string.gsub(weapon_string, "%s*/$", "")
    e.item(n_weapon)
end

function setup_loot (e)
    e.item(make_fiery_armour(e, {"leather armour w:65", "ring mail w:25",
                                 "scale mail w:25", "chain mail w:40",
                                 "plate armour w:25", "cloak w:11",
                                 "tower shield w:1", "kite shield w:2", "buckler w:1"}) .. " / " ..
                                 "pair of gloves good_item w:6 / helmet good_item w:4 / " ..
                                 "hat good_item w:2 / pair of boots good_item w:6 / " ..
                                 "fire dragon scales w:8 / granite talisman w:2 / " ..
                                 "dragon-blood talisman w:2")
    e.item(dgn.loot_potions)
    e.item(make_fiery_weapon(e, {"rapier w:10", "quick blade w:5", "eveningstar w:2",
                                 "demon whip w:2", "great mace w:16", "demon blade w:2",
                                 "great sword w:16", "triple sword w:2", "broad axe w:3",
                                 "battleaxe w:16", "executioner's axe w:1",
                                 "demon trident w:2", "glaive w:16", "bardiche w:2",
                                 "longbow w:8", "arbalest w:8", "hand cannon w:8",
                                 "quarterstaff", "lajatang w:5"}))
    e.item("any / star_item w:4")
end

-- #
-- ###

-- ###
-- # Monster functions:

-- This function sets up three slots of monsters of ascending tiers
-- Use one each of the second and third tier, with accompanying
-- and scatter first tier placements. Current sets:
--  * Humanoids with fiery equipment
--    * Ogres - 15%
--    * Centaurs - 15%
--    * Salamanders - 15%
--  * Beastial - 20%
--  * Demonic - 20%
--  * Elemental - 15%

function fiery_guardians (e, intelligent, village)
    -- Shorthand abbreviations.
    local flame = "ego:flaming"
    local res = "ego:fire_resistance"
    local magestuff = "spear " .. flame .. " | whip " .. flame
                      .. " . robe " .. res
    local goodgear = "scimitar " .. flame
                     .. " | halberd " .. flame
                     .. " | broad axe w:8 " .. flame
                     .. " | flail " .. flame

    -- Weighings back and forth with humanoids or not.
    if crawl.x_chance_in_y(9, 20) or village or intelligent then
        local ogrestuff = "great mace " .. flame .. " | giant club w:14 " .. flame
        local centaurstuff = "shortbow " .. flame
        if village then
            e.mons("two-headed ogre ; " .. ogrestuff .. " . " .. ogrestuff ..
                   " / centaur ; " .. centaurstuff ..
                   " / salamander w:15 ; spear " .. flame .. " | trident " .. flame)
            e.mons("fire bat / hell hound")
            e.mons("fire crab / hell hog")
            return
        end
        local set_weight = crawl.random2(3)
        if set_weight < 1 then
            e.mons("two-headed ogre ; " .. ogrestuff .. " . " .. ogrestuff)
            e.mons("ogre mage w:40 ; " .. magestuff)
        elseif set_weight < 2 then
            e.mons("centaur ; " .. centaurstuff ..
                   " / yaktaur w:5 ; arbalest " .. flame)
            e.mons("centaur warrior ; " .. centaurstuff)
        else
           e.mons("salamander ; spear " .. flame .. " | trident " .. flame)
           e.mons("salamander mystic")
        end
        e.mons("hell knight ; " .. goodgear .. " . chain mail " .. res ..
               " / red draconian ; " .. goodgear .. " . cloak")
    else
    -- Unintelligent map! Even more mixed.
        local set_weight = crawl.random2(11)
        if set_weight < 4 then
            -- "Beastial" monster pack.
            e.mons("hell hound / steam dragon w:8 / fire bat band w:8")
            e.mons("fire crab / lindwurm w:12")
            e.mons("hell hog w:12 / fire dragon")
        elseif set_weight < 8 then
            -- "Demonic" monster pack.
            e.mons("hell hound / red ugly thing / " ..
                   "red devil ; trident " .. flame)
            e.mons("sun demon / smoke demon")
            e.mons("orc sorcerer ; " .. magestuff .. " / " ..
                   "hell knight ; " .. goodgear .. " . chain mail " .. res)
        else
            -- "Elemental" monster pack.
            e.mons("fire elemental w:12 / earth elemental / gargoyle w:8")
            e.mons("efreet")
            e.mons("stone giant")
        end
    end
end

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

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

  if you_x == x and you_y == y then
    crawl.mpr("There is a rumble as the volcano erupts. The roof shakes.",
              "warning")
    return
  end

  if you.see_cell(marker:pos()) then
    crawl.mpr("The volcano erupts! Nearby, a roof collapses.", "warning")
  else
    crawl.mpr("There is a rumble as the volcano erupts. The roof shakes.",
              "warning")
  end
  dgn.terrain_changed(x, y, "stone_wall", false)
  dgn.colour_at(x, y, "lightred")
  dgn.apply_area_cloud(x, y, 1, 6, 1, 10, "grey smoke", "other", -1)

  -- Don't collapse same doorway twice.
  triggerable:remove(marker)
end


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

  data.lava_phase = data.lava_phase + 1
  local lp = data.lava_phase
  local my_replicas = {}

  -- So we don't have to duplicate code too much.
  local function convert_replicas_to_lava (mreplicas, opposite)
   local yp = dgn.point(you.pos())
    for _, pos in ipairs(mreplicas) do
      if pos ~= yp then
        if opposite then
          dgn.terrain_changed(pos.x, pos.y, "floor", false)
        else
          dgn.terrain_changed(pos.x, pos.y, "lava", false, false)
        end
      end
    end
  end

  if lp == 1 then
    crawl.mpr("The ground shudders ominously.", "warning")
  elseif lp == 2 then
    my_replicas = dgn.find_marker_positions_by_prop("lava_phase", 2)
    crawl.mpr("In the distance, the volcano explodes with a roar! Lava spreads "
               .. "onto the path.", "warning")
    convert_replicas_to_lava(my_replicas)
  elseif lp == 3 then
    crawl.mpr("The air is thick with the scent of sulphur.", "warning")
  elseif lp == 4 then
    my_replicas = dgn.find_marker_positions_by_prop("lava_phase", 4)
    crawl.mpr("There is another distant roar. More lava overflows!", "warning")
    convert_replicas_to_lava(my_replicas)
  elseif lp == 5 then
    crawl.mpr("The ground moves violently!", "warning")
  elseif lp == 6 then
    my_replicas = dgn.find_marker_positions_by_prop("lava_phase", 6)
    crawl.mpr("The volcano erupts again! A thin layer of lava overflows to " ..
              "fill the cavern.", "warning")
    convert_replicas_to_lava(my_replicas)
  elseif lp == 7 then
    my_replicas = dgn.find_marker_positions_by_prop("lava_phase", 6)
    crawl.mpr("The ground shudders. Some of the lava has hardened enough to walk " ..
              "over!", "warning")
    convert_replicas_to_lava(my_replicas, true)
  elseif lp == 8 then
    my_replicas = dgn.find_marker_positions_by_prop("lava_phase", 4)
    crawl.mpr("The ground shudders. Some of the lava has hardened enough to walk " ..
              "over!", "warning")
    convert_replicas_to_lava(my_replicas, true)
  elseif lp == 9 then
    my_replicas = dgn.find_marker_positions_by_prop("lava_phase", 2)
    crawl.mpr("The ground shudders. Some of the lava has hardened enough to walk " ..
              "over!", "warning")
    convert_replicas_to_lava(my_replicas, true)
  end
end

}}

default-depth: Lair, Orc

###############################################################################
# Entries:

NAME: enter_volcano_1
: volcano_portal(_G)
MAP
 xx
xXX..
XXS..@
XOSS...
XXSS...
xXXx.xx
 xxxxxx
ENDMAP

NAME: enter_volcano_2
: volcano_portal(_G)
MAP
xxxxx
xXXXx
xXOXx
xSSSx
xx.Sxx
 x.S.xx
 xx.@.x
ENDMAP

NAME: enter_volcano_3
MONS: patrolling hell hound
# Their names are Howard and Harry.
: volcano_portal(_G)
MAP
  xxxxx
 xxXXXxx
 xXXOXXx
 xxSSSxx
 xx11xx
xx...x
x..xxx.
xx....@
 xxxxx.
ENDMAP

NAME:    enter_volcano_4
SHUFFLE: JKL
SUBST:   JK = l, L = .
: volcano_portal(_G)
MAP
 xxxxx
 xXXXx
 xXOXx
xxSSSxx
xxxSxxx
 xxx.xx
  xxx.x
   xx.xx
  xxJKLxx
 xxJlKlLxx
 xJllKllLx
 xxJlKlLxx
  xxJKLxx
   x.@.x
ENDMAP

NAME:  nicolae_volcano_entry_batcave
MONS:  patrolling fire bat
SUBST: s = Xs, Z = Xx, Y = x.
: volcano_portal(_G)
MAP
      xxxx
   xxxxYYxxx
 xxxZYY..YYxxx
 xXZs.1.....Yxx
xxXXS........Yxx
xxXOS..1........@
xxXXS........Yxx
 xXZs.1.....Yxx
 xxxZYY..YYxxx
   xxxxYYxxx
      xxxx
ENDMAP

NAME:  nicolae_volcano_entry_hallway
TAGS:  transparent
SUBST: L = xl, Z = XXXXl, _ = _xx
CLEAR: _
: volcano_portal(_G)
MAP
  _xx@@xx_
 _xxx..xxx_
_xxXX..Lxxx_
_xxXZ..llLx_
_xxXO..llLx_
_xxXZ..llLx_
_xxXX..Lxxx_
 _xxx..xxx_
  _xx@@xx_
ENDMAP

NAME:    nicolae_volcano_entry_lava_flow
TAGS:    transparent
NSUBST:  V = 3:X / 1:XS / 1:lS / *:S, A = 2:X / 2:. / *:S
NSUBST:  B = 2:X / 2:. / *:S, C = 2:X / 2:. / *:S, D = 2:X / 2:. / *:S
NSUBST:  E = 2:X / 2:. / *:S, F = 2:X / 2:. / *:S
SHUFFLE: abcdef
SUBST:   ab = S, cde = l, f : .l, ' = ..S, _ = .._
CLEAR:   _
: volcano_portal(_G)
MAP
    _____
   _'''''_
  _'AAAAb'_
 _'aAAAAbB'_
_'FFaAAbBBB'_
'FFFaAAbBBBB'_
'ffFFVVVBBcc'_
'fEfFVOVccCC._
'EEffVVVCCCC'_
'EEEEEedCCCC'_
_'EEeeDDdCC'_
 _'eDDDDdd'_
  _'DDDDD'_
   _'''''_
    _____
ENDMAP

NAME:  nicolae_volcano_entry_s_turn
SUBST: Z = xx.
: volcano_portal(_G)
MAP
    xxxxxx
  xxxZZZZxxx..@..x
 xxZ.....Zxxz...xx
xxZ....Z..ZxZ...x
xx...xZ...ZxZ..Zx
xxSSSxZ....Z...Zx
xxXOXxZ...Z...Zxx
xxXXXxxZZ...ZZxx
 xxxxxxxxZZZxxx
    xxxxxxxxx
ENDMAP

NAME:  nicolae_volcano_entry_two_sided
SUBST: s = S., z = Xx, L = lX, q = lS, y = x.
: volcano_portal(_G)
MAP
    xxxxx
  xxxxxxxxx
 xxxXXXXxxxx
yyxzXLLXXXzxy
..sSSqlLXSSs..
@.sSSqllOSSs.@
..szXXLLXSSs..
 yxxxXXXXXzzy
   xxxxxxxxxx
    xxxxxx
ENDMAP

NAME:    nicolae_volcano_entry_vermiform
NSUBST:  A = l / ., B = l / ., C = l / ., D = l / .
SHUFFLE: 1V'/Ov-
SUBST:   Y = xxxx., y = ....x, v = X, V = x, - = S, ' = ., _ = xxxx_
KMONS:   1 = patrolling lindwurm
CLEAR:   _
: volcano_portal(_G)
MAP
 __xxxxxx________xxx
xxxxYYYYxxxxxxxxxxYxx
xvv--....YYxxxYYx...x
xvO-AlllB...y....yx..
xXlllA.BlllC.Dllllx.@
xV1'''....ClllD..yx..
xVVxxYYYYy......x...x
xxxxxxxxxxYYYYYxxxYxx
 ________xxxxxxx_xxx
ENDMAP

NAME: lightli_volcano_entry_magma_tube
: volcano_portal(_G)
MAP
  xxxxxxx
 xx.....xx
 x.......x
xx...x...xx
xxlSlxx...x
xllSllx...x
xllSllx...x
xllSllx...x
xxXOXxx...x
xxXXXx...xx
 xxxxx@@xx
ENDMAP

###############################################################################

default-depth: Volcano

## Generic maps. Weight 50, three present, ~15.15% chance each.

###############################################################################
# "Forgotten grotto Temple"
#
# In the bowels of a volcano, some renegade priests of
# Makhleb / Trog / Vehumet have built a temple, which has
# since been forgotten... yet the temple guardians still remain.
NAME:     volcano_grotto
TAGS:     no_item_gen no_monster_gen
ORIENT:   encompass
WEIGHT:   50
SUBVAULT: B : volcano_grotto_subvault
KMONS:    5 = lava snake
KMONS:    6 = fire bat
KFEAT:    56 = lava
NSUBST:   l = 3:5 / 3 = 5l / 3:6 / 3 = 66lll / *:l
: volcano_setup(_G)
: place_tiny_volcano(_G)
MAP
                                    BBBBBBBBBBB
                                    BBBBBBBBBBB
                                    BBBBBBBBBBB
                                    BBBBBBBBBBB
                         xxxx       BBBBBBBBBBB
                    xxxxxxyyxxxx    BBBBBBBBBBB
                 xxxxy......yyyxx   BBBBBBBBBBB
              xxxxyyy.LLLLL....yxxx BBBBBBBBBBB
            xxxyyy...LlllllL.....GxxBBBBBBBBBBB
          xxxyy....LLlllllllL......BBBBBBBBBBBB
        xxxyy....LLlllllllllL....GxxBBBBBBBBBBB
       xxyy.....LllllllllllllL..yxx BBBBBBBBBBB
      xxy......LlllllllllllllL..yxxxBBBBBBBBBBB
     xxy......LlllllllllllllllL..yyxBBBBBBBBBBB
    xxy.....LllllllllllllllllllL..yyBBBBBBBBBBB
   xxy.....LllllllllllllllllllllL...BBBBBBBBBBB
  xxy....LllllllllllVlllllllllllL...BBBBBBBBBBB
  xy....LlllllllllllllllllllllLL...yBBBBBBBBBBB
  xxy....LlllllllllllllllllllL....yxBBBBBBBBBBB
   xy.....LlllllllllllllllllLL...yxx
   xy.y...LllllllllllllllllLL...yxx
   xxyxy...LllllllllllllllL...yyx
    xxxxy...LllllllllllllL...yxxx
       xxy...LL....LlllllL..yxx
        xxy....xxx..LlllL...yx
         xy.yxxx<xxy.LLL...yxx
         xx.xx....xxx.....yxx
          x.xxx.....xxy....yx
          xx..xxxAxx.xxy..yxx
           xxx..xxx.xxxx..xx
             xxx.x.xx  xxxx
               x...x
               xxxxx
ENDMAP

NAME:  vgs_original
TAGS:  volcano_grotto_subvault no_item_gen no_monster_gen no_vmirror unrand
KFEAT: _ = altar_makhleb / altar_trog / altar_vehumet
:      fiery_guardians(_G)
KMONS: 4 = molten gargoyle w:90 / gargoyle
#      Loot: 9 items, 8 gold.
:      volcano_setup(_G)
MAP
         .
xxxxxxxxx+xxxxxxxxx
xcccccxx.1.xxcccccx
xc.3.cx.....xc.1..x
ccf$dcc..<..ccd$fcc
c.$e$.c.....c.$e$.c
c.g$g.ccc+ccc.g$g.c
cc.4.ccc...ccc.4.cc
xc...+..1.1..+...cx
xcccccccG_Gcccccccx
xxxxxxxc.2.cxxxxxxx
xxxxxxxcccccxxxxxxx
ENDMAP

NAME:    vgs_dualism
TAGS:    volcano_grotto_subvault no_item_gen no_monster_gen no_vmirror unrand
KFEAT:   BC = altar_makhleb / altar_trog / altar_vehumet
:        fiery_guardians(_G)
KMONS:   4 = obsidian statue / molten gargoyle
# Loot:  8 items, 2 gold piles.
NSUBST:  X = 1:+ / *:c
:        volcano_setup(_G)
SHUFFLE: defg
MAP
         .
xxxxxxxxx+xxxxxxxxx
x.$.xxxx...xxxx.$.x
x.B.xxx..<..xxx.C.x
x...xx..ccc..xx...x
xx.xx..ccdcc..xx.xx
xx.x1.cXefgXc.1x.xx
x....cXdexfgXc....x
x....cXXX4XXXc....x
x1...............1x
xxx2.....1.....3xxx
xxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    vgs_hot_hot_hot
TAGS:    volcano_grotto_subvault no_item_gen no_monster_gen unrand
WEIGHT:  5
: fiery_guardians(_G)
KMONS:   4 = lava snake / fire bat
KFEAT:   4 = l
KFEAT:   _ = altar_makhleb / altar_trog / altar_vehumet
NSUBST:  l = 3:4 / 2 = 4l / *:l
# Loot: 8 items.
: volcano_setup(_G)
SHUFFLE: 23
NSUBST:  X = 1:Gl / *:x, Y = 1:Gl / *:x
MAP
         .
xxxxxxxxx.xxxxxxxxx
xxx..xxxx.xcccccccc
xx.xx..x.xxc.l.ldlc
x.xXXXx.xxccl1l.lec
x.xXGXxxxxGc.l.l.lc
xx.XXX..<...l1l.l2c
xx.xx.lxxxGc.l.l.lc
xx.xxx.xccccl1l.lfc
x.xx..YYc....l.lelc
xx..xxYGc3_.l.ldlfc
xxxxxxxxccccccccccc
ENDMAP

NAME:   vgs_many_chambers
TAGS:   volcano_grotto_subvault no_item_gen no_monster_gen unrand
KFEAT:  _ = altar_makhleb / altar_trog / altar_vehumet
NSUBST: X = 1:+ / *:x, Y = 1:+ / *:x
:       fiery_guardians(_G)
KMONS:  4 =  molten gargoyle w:90 / gargoyle
#       Loot: 8 items, 10 gold.
:       volcano_setup(_G)
MAP
         .
xxxxxxxxx+xxxxxxxxx
xx....xx...xx....xx
x$.....+.<.+.....$x
x$G..T.x...x.T..G$x
x$..1..xx+xx..1..$x
xx....xx...xx....xx
xxxxGxxx121xxxGxxxx
xxxxdefX._.Ydefxxxx
xxx3g$$X...Y$$g1xxx
xxxxxxxxx4xxxxxxxxx
xxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   vgs_statue_spotlight
TAGS:   volcano_grotto_subvault no_item_gen no_monster_gen no_vmirror unrand
WEIGHT: 5
KFEAT:  _ = altar_makhleb / altar_trog / altar_vehumet
#       Sets up the temple guardians.
:       fiery_guardians(_G)
KMONS:  4 = obsidian statue
#       Loot: 12 items, 6 gold.
:       volcano_setup(_G)
MAP
         .
xxxxxxxxc+cxxxxxxxx
xcccccccc.ccccccccx
xc$$$gggc.......<cx
xc...defc....cccccx
xc.l...cc...1...ccx
xc42....+....31_.cx
xc.l...cc...1...ccx
xc...defc....cccccx
xc$$$gggc.......<cx
xcccccccccccccccccx
xxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   vgs_trial_by_fire
TAGS:   volcano_grotto_subvault no_item_gen no_monster_gen no_vmirror unrand
WEIGHT: 5
: fiery_guardians(_G)
KMONS:  4 = obsidian statue
KFEAT:  _ = altar_makhleb / altar_trog / altar_vehumet
KFEAT:  F = lava
KPROP:  lF = no_cloud_gen
# Loot: 10 items.
: volcano_setup(_G)
MARKER: F = lua:fog_machine {cloud_type = "flame", \
             pow_min = 6, pow_max = 6, delay = 90, \
             size_min = 3, size_max = 3, walk_dist = 0, excl_rad = -1 }
TILE:   G = dngn_statue_dragon
MAP
         .
xxxxxxxxx+xxxxxxxxx
xcccccccc........xx
ccg.1ccccccccccc1.x
cg....ccGcGccGccc.x
c4..c.ccFcFccFccc.x
c1.2c..clclcclcc..x
cdgdccc.........cxx
ce_eccccclcclclccxx
cfgfcccccFccFcFccxx
cc<3cccccGccGcGccxx
cccccccccccccccccxx
ENDMAP

###############################################################################

###############################################################################
# "Lava lake Temple"
#
# Somehow, some priests have constructed a temple right over the lava!
# Who knows what magic spells keep this structure afloat,
# and its occupants from roasting to death!
#
# XXX: volcano_lake subvaults, akin to volcano_grotto, would be nice.
NAME:     volcano_lake
TAGS:     no_item_gen no_monster_gen no_rotate
ORIENT:   encompass
WEIGHT:   50
SUBVAULT: B : volcano_lake_subvault
KMONS:    5 = lava snake
KMONS:    6 = fire bat
KFEAT:    56 = lava
NSUBST:   l = 2:5 / 4 = 5l / 2:6 / 4 = 5l
# One path is built out of one glyph from q, r, s, t, u, v
SHUFFLE: qrstuv
SUBST:   q = ., r : l:19 .:1, stuv = l
: volcano_setup(_G)
: place_lake_volcanoes(_G, {"Q", "R", "S", "T", "U", "V"})
MAP
                      xxxx     xxxxx xxxxx xxxxxx
                    xxxyyxxx  xxyyxxxxyyyxxxyyyyxx
             xxxx  xxx....xxxxx....xx.....xxx...xxxxxx
             xyyxxxxyyy.yyyyyyyy.y....yyy...yyyy...yyxx
           xxxx..yyy.................................yxx
         xxxyyy.......................................yxxx
       xxxyyy...........................................yxxx
    xxxxy...............LLLllLLllLLLllllLLllLLlllL........yxxxx
    xy..............LllllllllllllllllllllllllllllllLL........yxxx
   xxxy............LlllllllllllllllllllllllQtttlllllltL........yxxx
  xxy............LLlllllllllllllllllllllllttQllttllttlllLLL......<x
  xy............Lqqlllllllllllllllllllllttlllllllttlllllll.......yxx
  xxxy........LllllqqlRlllllllllllllllttllllllllllllllllllL.......yx
 xxy...........Llllllqqlllllllllllllltlllllllllllllllllllll.....yxxx
  xxy.........LlllllRllqqllLlLLllLLltllLLLllLllllllllllllLL......yx
   xxy.....LlllllllllllllqL..................LlllllllllllllL.....yxxxx
   xy......Lllllllllllllll.BBBBBBBBBBBBBBBBB.lllllllllllllllL.......yx
   xy.......LllllllllllllL.BBBBBBBBBBBBBBBBB.LllllllllllllllL......yxx
   xxy.....Lrrllllllllllll.BBBBBBBBBBBBBBBBB.llllllllllllllLL.......yx
   xy......LllrrSllllllllL.BBBBBBBBBBBBBBBBB.Lllllllllllluuu.......yxx
   xxy.....Lllllrrllllllll.BBBBBBBBBBBBBBBBB.LllllllllluullL......yxx
   xy.....LlllllllrllllllL.BBBBBBBBBBBBBBBBB.lllllllTuullllL.....yxx
   xxy.....LllllllSrllllll.BBBBBBBBBBBBBBBBB.LllllluulllllllL.....yxx
   xy......LllllllllrrlllL.BBBBBBBBBBBBBBBBB.lllluulTlllllllL......yxx
   xxy......Lllllllllrllll.BBBBBBBBBBBBBBBBB.LluulllllllllllL......yxx
   xxy.......LllllllllrllL.BBBBBBBBBBBBBBBBB.uullllllllllllL.....yxxx
   xy........LlllllllllrlL.BBBBBBBBBBBBBBBBB.LllllllllllllL......yxx
   xxy.....Lllllllllllllrr.BBBBBBBBBBBBBBBBB.llllllllllllllL......yxx
    xy.....LllllllVvvvllvvL.......BBB.......LLllllllllllllL.....yxxx
    xxxy....LllllvvVllvvlllLllLlLllllLllLlLlslllllllllllllL.......yxx
     xA.<.....vvvllllllllllLlllllllllllllllllssllllllllllllL.......yxx
     xxxxy.....LllllllllllllllllllllllllllllllUssUllllllllllL.....yxx
       xy........LLllllllllllllllllllllllllllllllssllllllllL.....yxx
       xxxy..........LllllllllllllllllllLllllllllllslllllLL......yxx
         xxxy.........LLlllllllllllllLL...LLllllllllsssL......yxxxx
           xxxy.........LLlLLlLllllLL.......LLllLlLlLL.......yxxx
             xxxxxxxy...................yy.................yxxx
                   xxxxy..............yxxxxxy.............yxxx
                      xxxyyy.yy.yy.yyyxx   xxy..........yxxx
                        xxxxxxxxxxxxxxx     xxyyyy.yyy.yxxx
                                             xxxxxxxxxxxx
ENDMAP

NAME:  vl_original
TAGS:  volcano_lake_subvault no_item_gen no_monster_gen unrand
:      fiery_guardians(_G)
KMONS: 4 = molten gargoyle w:90 / gargoyle
KFEAT: _ = altar_makhleb / altar_trog / altar_vehumet
#      Loot: 10 items, 6 gold piles.
: volcano_setup(_G)
MAP
ccccccccccccccccc
c....+.121.+....c
c.<1.c.G_G.c.3<.c
c....c..1..c....c
ccc++ccc+ccc++ccc
n......c.c......n
cccccc.c.c.cccccc
c.$f$c.c.c.cgd$.c
c.$gec.c.c.c$e$.c
c.4dgc.c.c.cfg4.c
c......c.c......c
cccccccc+cccccccc
       ...
ENDMAP

###############################################################################

###############################################################################
# "Many pools Pyramid"
#
# There's no pyramid as such, but it was originally supposed to be a pyramid!
# Instead, we have randomly placed loot in little rooms off the central chamber.
# Nice place to take a holiday, wouldn't want to live here...
NAME:    volcano_pools
TAGS:    no_item_gen no_monster_gen no_rotate
ORIENT:  encompass
WEIGHT:  50
: fiery_guardians(_G)
SHUFFLE: QRSTU
# Two pools with loot (ten items, six gold) and bosses,
# two nearly empty pools, and an empty entrance pool.
NSUBST:  Q = 2:1 / 1:2 / 1:d / 1:e / 2:$ / 2:f / 2:g
NSUBST:  R = 2 = 1. / 1:3 / 2:d / 2:e / 2:$ / 1:f / 1:g
NSUBST:  S = 1:1 / *:., T = 1 = 1. / *:.
NSUBST:  U = 1:A / *:.
: volcano_setup(_G)
: place_tiny_volcano(_G)
KFEAT:   J = l
MARKER:  J = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
                               start_clouds = 1, cloud_type = "flame", excl_rad = -1 }
MAP
                               xxxx
              xxxx            xxllxx
             xxllx           xxLlllx
             xJlllxx        xxLllllx
             xlllLUxx      xxyLllllxx
            xxllUUUyxx     xyQ.Lllllx
            xllLUUUUyx     xxyQ.Llllxx
            xllU<UUyxx      xxQQ<Llllx
            xxlL.yyxx        xyQQllllx
             xxxy.xx         xQQQLllJx
             xxx.xxxxxx      xyQLlllxx
             xy.yxxxxyxxxxxxxxx.llllx
             xx...xy..xxy..yxx.xxllxx
             xx.............y.xxxxx
            xxy...LlLlLlL....xyxx      xxx
           xxy...LllllllllL....yx      xJx
           xy...LllllllllllL....x     xxllx
          xy...LlllllVllllL....xx    xxlllxx
          xy...LlllllllllllL....x   xxlLLllx
        xxx....LlllllllllL....yxxxxxxlLRRLlx
     xxxy........LllLlLlL.......xyxxy<RRRRyx
    xxx..yxyyxy..............yxx..yy.RRRRyxx
 xxyxy.Lyxxxxxxyyxxxyyxy.yyyxxxxxx..yy.Ryxx
 xyTyy.LllllJxxxxx xxxxxx.xxxxxx xxxxxxxxx
xy<TTT.Lllllxx         xx.y<ySyx  xxxx
xLTTTTLlllllx         xxyySSSyyx
xxLTTTLllllxx        xxySSSSSyxx
xlllLLlllxx          xxllLSSlLLx
xlllllllxx            xxllLlllxx
xxllllxxx              xxllllxx
 xxxJlxx                xxxllx
   xxxx                   xJxx
                          xxx
ENDMAP
###############################################################################

## Specific themes. Weight 20, 7 present, ~6.06% chance each.

###############################################################################
# "Volcano tomb"
#
# Some forgotten emperor was buried here! His tomb is guarded by charred bones.
# Perhaps there is loot!
NAME:       volcano_tomb
TAGS:       no_item_gen no_monster_gen no_rotate
WEIGHT:     20
ORIENT:     encompass
#           The skulls on lava.
KMONS:      u = weeping skull
KMONS:      U = laughing skull
KFEAT:      uU = lava
SUBVAULT:   B : volcano_tomb_subvault
:           volcano_setup(_G)
: place_chained_volcano(_G)
MAP
    xxxxxx       xxxx
   xx.<.Ax  xxxxxxyyxxxxx
  xx..xxxxxxxy..yy.....yxxx
  x..xxxxxxy........yyx...yxx        BBBBBBBBBBBBBBBBBBBBBBBBBB
  xx..yyyyy................yxxx      BBBBBBBBBBBBBBBBBBBBBBBBBB
   xx.............LLLL.......yxxx    BBBBBBBBBBBBBBBBBBBBBBBBBB
    xxy.........LLlullLL.......yxxx  BBBBBBBBBBBBBBBBBBBBBBBBBB
   xxy.........LllllllllLLL......yxxxBBBBBBBBBBBBBBBBBBBBBBBBBB
  xxy.........LllllllllllllLLL.....y.BBBBBBBBBBBBBBBBBBBBBBBBBB
 xxy........LLllllllllllllllllLLL...lBBBBBBBBBBBBBBBBBBBBBBBBBB
xxy....LLlLllllllllllllllllllllllL...BBBBBBBBBBBBBBBBBBBBBBBBBB
xy....LllllllllllllllllllllllllL....lBBBBBBBBBBBBBBBBBBBBBBBBBB
xLl.LlllllllllllllllllllllllllllL..y.BBBBBBBBBBBBBBBBBBBBBBBBBB
xlllllllllllllllllGllllllllllllllLLxxBBBBBBBBBBBBBBBBBBBBBBBBBB
xxlllllllllllllGlllllGllllllllllllxx BBBBBBBBBBBBBBBBBBBBBBBBBB
 xxlllllllllllVlllllllVllllllllllxx  BBBBBBBBBBBBBBBBBBBBBBBBBB
  xxUllllllllGlllllllllGlllllllUxx   BBBBBBBBBBBBBBBBBBBBBBBBBB
   xxxllllllllllllllllllllllllxxx    BBBBBBBBBBBBBBBBBBBBBBBBBB
     xxllllllllGlllllGlllllllxx      BBBBBBBBBBBBBBBBBBBBBBBBBB
      xxllllllllllGlllllllllxx       BBBBBBBBBBBBBBBBBBBBBBBBBB
       xxllllllllllllllllllxx        BBBBBBBBBBBBBBBBBBBBBBBBBB
        xxxllllllllllllllxxx
          xxxlxxlxxxxlxxxx
            xxxxxx  xxx
ENDMAP

# XXX: This could use a map redesign in general
# regarding where the loot chamber is hidden?...
NAME:    vts_original
TAGS:    volcano_tomb_subvault no_item_gen no_monster_gen no_rotate no_hmirror
TAGS:    no_vmirror unrand
MONS:    gargoyle w:99 / toenail golem w:1
MONS:    troll skeleton / spriggan skeleton / naga skeleton
MONS:    alligator skeleton / harpy skeleton / anaconda skeleton
MONS:    skeletal warrior ; halberd ego:flaming ident:type | \
                            dire flail ego:flaming ident:type | \
                            great sword ego:flaming ident:type
KFEAT:   ? = broken_door
# Only one loot chamber. Scatter tomb residents.
NSUBST:  4 = 1:l / 4:3 / *:4, ? = 1:? / 1:+? / *:+
SHUFFLE: 23, a-| / b_*
SUBST:   a = v, - = +, b_* = c
NSUBST:  | = 2:d / 3:e / 2:f / 3:g
# Loot: 3 gold, 8 items.
: volcano_setup(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxyyxxx
xxxxxxxxxxxxxxxxxxy.y.$Lxx
xxxxxxxxxcccccccxy.y.1Lllx
xxxxxxxxxc..Y..cy.xxx.lllx
cccccccccc.....+.xxx.xllJx
+...G....+..2..cccxxx.x.xx
+...$....+.1<1.?4cxxxx.xxx
+...G....+..2..cccxxxxxxxx
cccccccccc.....cxxxxxxxxxx
xaaaaxxc4c..Y..cxxxxxxxxxx
xa||accc?ccccc?cccbbbbbxxx
xa||a4c.........c4b***bbxx
xa||-4+.lllllll.+4_****bxx
xa||ccc....$....ccb***bbxx
xa||axcc?ccccc?ccxbbbbbxxx
xaaaaxxc4cxxxc4cxxxxxxxxxx
xxxxxxxcccxxxcccxxxxxxxxxx
ENDMAP

NAME:    vts_chambers
TAGS:    volcano_tomb_subvault no_item_gen no_monster_gen no_rotate no_hmirror
TAGS:    no_vmirror unrand
MONS:    gargoyle w:99 / toenail golem w:1
MONS:    troll skeleton / spriggan skeleton / naga skeleton
MONS:    alligator skeleton / harpy skeleton / anaconda skeleton
MONS:    skeletal warrior ; halberd ego:flaming ident:type | \
                            dire flail ego:flaming ident:type | \
                            great sword ego:flaming ident:type
SHUFFLE: 23
NSUBST:  5 = 1:1 / 1:23 / 1:4
NSUBST:  X = 1:+ / *:v, Y = 1:+ / *:c
#        Loot: 21 gold, 10 items.
:        volcano_setup(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxcccccxxxxxxxxxxxxxxxxx
xxxxc...cxxxxxxxxxxxxxxxxx
xxxcc.<.cccxxxccccvvvvvxxx
xccc......ccccc..$v$$$vxxx
cc1.........3....$X$$$vxxx
.ccc.c2.c.ccccc..$v...vxxx
...+...5..cxxxccccvv+vvxxx
.ccc.c2.c.ccccc..$X2.2vxxx
cc1.........3....$v.5.vxxx
xccc......ccccc..$X...vxxx
xxxcc.cc.ccddecccvvvv+vxxx
xxxxc3cc3c1eeg+^.+4Y..vvvx
xxccc.cc.cccccccYvvv..+1vx
xxc...cc...c...c..3v+vvvvx
xxc...cc...c...+.5.vffvxxx
xxc$$$cc$$$+$$$c3..+fgvxxx
xxcccccccccccccccccvvvvxxx
ENDMAP

###############################################################################

###############################################################################
# Lava "aerie".
#
# It doesn't look much like an aerie these days, but it still has some of
# the "aerie"-ish effects: flame clouds, flame elementals and lava!
NAME:   volcano_aerie
TAGS:   no_item_gen no_monster_gen
ORIENT: encompass
WEIGHT: 20
MONS:   lindwurm, efreet
MONS:   molten gargoyle w:20 / earth elemental w:18 / toenail golem w:2
MONS:   fire elemental / nothing w:6
KFEAT:  K = l
NSUBST: R = 2:1 / * = ll'
NSUBST: Y = 2:2 / 1:24 / 6:4 / 6:J / *:.
SUBST:  X = lx
KPROP:  l = no_cloud_gen
: volcano_setup(_G)
KPROP:  1' = no_tele_into
MARKER: J = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
                                  start_clouds = 1, cloud_type = "flame", excl_rad = -1 }
MARKER: K = lua:fog_machine { size = 3, pow_min = 7, pow_max = 7, delay = 80, \
                                  start_clouds = 1, cloud_type = "flame", excl_rad = -1 }
COLOUR: m = blue
# Left side has lindwurms and constructs, right side has elementals.
MAP
      xxxxxxxxx
     xxKlllllKxx
    xxllLLLLLllxx
   xxXl.d$$ef.lXxx
  xxy...$f<g$...yxx
   xxy..g$de$..yxx
    xxy..yyy..yxx
     xxx+mxm+xxxx
    xxy.xxllLYyxx
   xxy.yxXlllLYyxx
  xxy.3yxXKKllLYyx
   xxy3yxXlllLYyxx
    xxy.xxllLYyxx
     xxy.xxLYyxx
      xxy.xYyxx
     xxxx+x+xxxx
   xxxy.3xxxYYyxxx
 xxxy..LlXxXlLYYyxxx
xxy..LlllXxXlllLYYyxx
xy.LlllRRXxXllKllLYyx
xy.LlllRRXxXllKllLYyx
xxy..LlllXxXlllLYYyxx
 xxxy..LLXxXlLYYyxxx
   xxxy.3xxxYYyxxx
    xxxxx+x+xxxx
      xxy.xYyxx
     xxy.xxlYyxx
    xxy.xxllLYyxx
   xxy.yxXlllLYyxx
  xxy.3yxXKlllLYyx
   xxy3yxXlllLYyxx
    xxy.xxllLYyxx
     xxx+mxm+xxx
    xxy..yyy..yxx
   xxy.........yxx
  xxy...<...A...yxx
   xxy...LLL...yxx
    xxllLlllLllxx
     xxKlllllKxx
      xxxxxxxxx
ENDMAP
###############################################################################

###############################################################################
# Zaba's village!
#
# These stupid humanoids built their village right next to a dormant volcano.
# It has erupted! Most have fled, but some have stayed behind to guard their
# hard-earned loot. Idea kinda by dpeg, execution by Zaba.
NAME:       volcano_village
TAGS:       no_item_gen no_monster_gen
ORIENT:     encompass
WEIGHT:     20
SUBST:      p = lw, W = wW`, q = ll`, r = lx
SHUFFLE:    JK / LM / NO
NSUBST:     J = 4:. / * = $def
NSUBST:     L = 3:1 / 1:12. / 1:2 / 1:23 / 3 = $def / *:.
NSUBST:     N = 2:1 / 1:12. / 1:23 / 1 = $def / *:.
SUBST:      K = ^, MO = ., . = .:99 ^:1
KPROP:      ` = no_tele_into
:           fiery_guardians(_G, true, true)
:           volcano_setup(_G)
:           place_chained_volcano(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwx
xwwwwwwwwWwWwWwWwWwWwWwWwWwWwWwWwWwwwwwwwwx
xwwwwwwwWWWWWWWWWWWWWWWWWWWWWWWWWWWwwwwwwwx
xwwwwwwx....MMM.............OOO....xxwwwwwx
xwwwxxxx...xx+xx...xxxxx...xx+xx...'xxwwwwx
xwwxx.xx..xxLLLxx.xxJJJxx.xxNNNxx..x+xxxwwx
xppx.x.x..xLLLLLx.xJJJJJx.xNNNNNx..x'xAxppx
xppx<x.x..xLLLLLx.xJJJJJx.xNNNNNx..x'x<xppx
xlrxxx+x..xxLLLxx.xxJJJxx.xxNNNxx..xx'xxrlx
xrlllxx....xxxxx...xx+xx...xxxxx...xxxxllrx
xlrlllxx............KKK............xllllrlx
xrllllllqqqqqqqqqqqqqqqqqqqqqqqqqqqllllllrx
xlrllllllqlqlqlqlqlqlqlqlqlqlqlqlqllllllrlx
xrlllVllllllllllllllllllllllllllllllVllllrx
xlrlllllllllllVllllllVllllllllVlllllllllrlx
xrlrlllllllllllllllllllllllllllllllllllrlrx
xrlllrlllrlllrlllrlllrlllrlllrlllrlllrlllrx
xlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlx
xrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrlrx
xrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP
###############################################################################

###############################################################################
# A more explicitly temple-like volcano layout.
NAME:   kennysheep_volcano_temple
TAGS:   no_item_gen no_monster_gen no_rotate no_vmirror
ORIENT: encompass
WEIGHT: 20
: fiery_guardians(_G, true)
KFEAT:  _ = altar_makhleb / altar_trog / altar_vehumet
KFEAT:  O = l
NSUBST: z = 1:c / *:.
: volcano_setup(_G)
SUBST:  * = $$deef
KPROP:  O = no_cloud_gen
: place_chained_volcano(_G)
MAP
               xxx
            xxxxlxxxx
           xxlllllllxx
         xxxlllllllllxx
       xxxllllllllllllxxxx
       xlllllccnnncclllllxx
      xxlllcnc*****cncllllxx
      xlllcn.c.*3*.c.ncllllx
     xxllVn..+.*.*.+..nVlllxx
xxxxxxlllcc..+.._..+..ccllllxx
 xlllllllc1..c.....c..1clllllxx
 xxlllllln...cnnnnnc...nllllllx
  xlllllln...+**.**+...nllllllx
  xxllllln...c.1O2.c...nllllxxx
   xxllllc...cGOOOGc...clllxx
    xllllcc..+..O..+..ccllllx
    xlllllc..+.....+..clllllx
    xxllllcc1cG.z.Gc1ccllllxx
     xxllllccc.....cccllllxx
      xxllllll.....lllllxxx
      xxllllllG.z.Gllllxx
       xxlllll.....llxxx
        xxxlll..1..llx
          xlllG.z.Glxx
          xxxx.....xxx
             x.....x
             xG...Gx
             x.....x
             x.....x
             xG...Gx
             x.....x
             x.....x
             xG...Gx
             x.....x
             x.....x
             xG.A.Gx
             xx...xx
              xx<xx
               xxx
ENDMAP
###############################################################################

###############################################################################
# A smoke and steam themed volcano
NAME:   hellmonk_smoking_crater
TAGS:   no_item_gen no_monster_gen
ORIENT: encompass
WEIGHT: 20
MONS:   steam dragon / steam dragon / smoke demon / hell hound
MONS:   sun demon, lindwurm
KMONS:  4 = fire dragon
KITEM:  4 = scroll of fog q:2 ident:all w:20 / condensation vane / \
            cloak of the thief w:1
SUBST:  a = ..xxl, p = ..'xl, q = .x, ' = '.
NSUBST: 1 = 1:1 / 2:. / * = 1.., D2 = 1:., $ = 1:4 / *:$
SUBST:  D = 2., 2 : 22333
SUBST:  $ = $$deef
MARKER: ' = lua:fog_machine { cloud_type = "black smoke",  walk_dist=3, \
                              pow_min=4, pow_max=10, delay=25, size=2, \
                              spread_rate=0, }
:volcano_setup(_G)
MAP
            xxxxxxxxxxxxxxxx
           xxxqqqqqqqqqqqqqxxx
         xxx1...1.....1.....1xx
       xxx....ppppppppp..D....xx
      xx..2.pppppppppp.a.......xx
     xx1.....1....1..axxx...'...xx
    xx....xxxxaaaaaaaaxxxa1....1xx
   xx..'.xxxxxa1..1.axxxxa...1..xx
   x....xxxxxx.....xxxxxx......xx
   x.1..xxxxxx1.'..xxxxx......xx
   x....xxxxxxx..D..xxx...1..ax
   xG..Gxxxxxxxx.....pp......ax
   x....xxxxxxxxa..1..p......ax
   x2..2xxxxxxxxa.....p......ax
   xG..Gxxxxxxxxa.....p.1....ax
  ccc++cccxxxxxx.....ppp......xx
 cc......ccxxx..1..xxxxx...1..xx
cc........ccx.....xxxxxa......xx
c...llll...cx..'..xxxxxxa.....xx
cG.llllll.Gcxq....xxxxxa.....xx
c$..llll..$cxq.1..xxxx..'...xx
cc$$....$$ccxq....qqq....1.xx
 cc$$$$$$ccxxq....q'.....xxx
  ccc$$cccxxq....qq......xx
    ccccxxxq.1..xxx....1.xx
 xxxxxxxxqq.....xxq..'..xx
xxx<xxx........xxq.....xx
xx...xx..'....xxxq....xx
x..A..x......xxxq..1.xx
xx...xxqq..qqx....xxxx
xxx....qq..qq..qqxx
xxxxx.........xxxx
xxxxxxxxxxxxxxx
ENDMAP
###############################################################################

###############################################################################
# Zot tub redux
# Bonus points for shattering out and dying to an orb of fire
NAME:   hellmonk_zot_springs
TAGS:   no_item_gen no_monster_gen
WEIGHT: 20
ORIENT: encompass
:volcano_setup(_G)
KMONS:  1 = gargoyle / cyclops / \
            salamander ; spear ego:flaming | trident ego:flaming
KMONS:  2 = molten gargoyle
KMONS:  3 = red draconian / hell knight / \
            arcanist w:5 ; robe ego:fire_resistance . dagger ego:flaming / \
            occultist w:5 ; robe ego:fire_resistance . dagger ego:flaming
KMONS:  4 = salamander mystic / efreet / \
            deep elf pyromancer ; robe ego:fire_resistance / \
            orc knight ; dire flail ego:flaming . chain mail ego:fire_resistance
KMONS:  Z = orb of fire att:neutral
FTILE:  GT1E$- = floor_marble
COLOUR: c1E$- = white
SUBST:  h = $, $ = $$$d, d = defgg, 1 = 11-, 2 = .22, E = 1
NSUBST: 3 = 1:3 / 3 = 4W / W, F = W / x
KFEAT:  DH34 = W
MARKER: H = lua:fog_machine { cloud_type="steam", pow_min = 2, pow_max = 10, \
                delay = 25, size = 2, walk_dist = 3, spread_rate= 10 }
TILE:   c = wall_marble
MAP
          xxxxxxxxxxxxxxxxxxx
    xxxxxxxlllllllllllllllllxxxxx
    xhddddxllnnnxxxxxxxnnnllxdddx
    xh.hxxxllnZnW3WxW3WnZnllxxx.x
    xx2xx....nnnWWFxWWWnnn....x.x
     x.x...xxWHWWWxWWWHWxx.2.x2.x
     xx.2.xWWWWW3FFWWWW3WWx...xxx
     x...xWWWWWWWFWWW3WWWx....x
     x.2xxW3WWWWWFWWWWWWWx...xx
     xx...xWWW3WWFWW3WWWx..2xx
      xxx..xxWWWWFWWWWx....xx
        xxx..xWWWxWWWx..xxxx
          xx...x.x.x...xx
           xx....x....xx
  cccccccccccc++ccc++cccccccccccc
  c------1------ccc------1------c
  c1---------1--ccc--1---------1c
  c--ccc+cc+ccccccccccc+cc+ccc--c
  c--ccc$cc$cccG-E-Gccc$cc$ccc--c
  c--cccccccccc-----cccccccccc--c
ccc--cccccccccc-----cccccccccc--ccc
cWW-1------------T------------1-WWc
cWW--1---------G---G---------1--WWc
ccccccccccccccc-----ccccccccccccccc
            ccc++c++ccc
             xG.....Gx
             x.......x
             x.......x
             xG..A..Gx
             x.......x
             xxG.<.Gxx
              xxxxxxx
ENDMAP
###############################################################################

###############################################################################
# Deep Elf Pyromancer volcano
NAME:   hellmonk_pyromancer_palace
TAGS:   no_item_gen no_monster_gen
WEIGHT: 20
ORIENT: encompass
MONS:   fire elemental / hell hound, deep elf pyromancer
MONS:   deep elf archer ; shortbow ego:flaming . short sword ego:flaming . \
                          leather armour ego:fire_resistance
KPROP:  - = no_tele_into
KFEAT:  - = l
SUBST:  $ = $$$defg
NSUBST: 2 = 1:3 / * = 22., 1 = 1:2 / * = 11.
: volcano_setup(_G)
MAP
         ----
       x--cc--x
      x--cccc--x
      x--nA<n--x
     x--cc..cc--x
     x--n....n--x
    x--cc+ccccc--x
    x--n..c2..n--x
   x--cc..c..2cc--x
   x--n..cc.l..n--x
  x--cc..n.....cc--x
  x--n1.1c.1...2n--x
 x--cc..cc+cccc+cc--x
 x--n1.1c1..2n...n--x
x--cc+ccc...cc1..cc--
x--n...c....+..l.2n--
--cc.l1n..1cc..1..cc--
--n2.1.+...n.2...12n--
-ccccccccccccccccc+cc-
-n$$$$$$$$+2..1.....n-
-c$$$$$$$$+32..1....c-
-cccccccccccccccccccc-
ENDMAP

###############################################################################

## Severe gimmicks. Weight 10, four present, ~3.03% chance each.

###############################################################################
# Hidden bunker!
#
# There are scientists about; beware, as they may wish to experiment on you! The
# idea was by Zaba, and the execution by due!
NAME:   volcano_bunker
TAGS:   no_item_gen no_monster_gen no_rotate
WEIGHT: 20
ORIENT: encompass
# Loot: 11 items, 8 gold.
: volcano_setup(_G)
NSUBST: h = 1:h / *:W
KITEM:  h = gold
COLOUR: m = blue
MONS:   human ; mace ego:flaming . robe ego:fire_resistance
MONS:   occultist ; mace ego:flaming . robe ego:fire_resistance
MONS:   orc sorcerer, toenail golem
MONS:   dancing weapon ; mace ego:flaming
: place_chained_volcano(_G)
KFEAT:  K = w
KFEAT:  h = W
NSUBST: 1 = 1:2 / 1:3 / *:1
MARKER: K = lua:fog_machine ( { cloud_type = "rain", walk_dist=3, pow_max=2, \
                                    delay=250, size=3 } )
KPROP:  lVK = no_tele_into
MAP
      xxxx                 vvvvvvvvvvvvvvv
   xxxxllxxx xxx           v.............v
 xxxlllllllxxxlxxx         v..vvvvvvvvv..v
xxlllVlllllllllllxxxx      v..v4f$e$$2v..v
 xxlllllllllllllllllxxx    v..v$$egddgv..v
xxllllllllllllllllllllxx   v..+ggdf$$5v..v
 xxllllllllvmvmvmvmvmvvvvvvvvvvvvvvvvvv..v
 xxllllllllm..4..vKWhW..1.1..v.....+.....v
  xxlllllllv.414.vWWthW..4...+.<.vvvvvvvvv
   xxllllllm.....vlltth...1..v...vxxx
    xxxllllvvv+vvvvvvvvvvvvvvvv+vv.yxx
      xxlllm.....v.v..1v1....1v..m..yxx
     xxllllv.<.A.+.v+vvvvv+v+vvv.+..Lyxxx
    xxlllllm.....v...............mLLllllxx
    xxlllllvmvmvmvmvmvmvmvmvmvmvmvlllllxxx
   xxllVlllllllllllllllllllllllllllllllllxx
    xxxlllllllllllllllllllllllllllllVlllxx
      xxllllllllllllllllxxllxxxllllllllxx
       xxxxlllllVllllllxxxxxx xxxlllllxx
          xxxllllllllxxx        xxxllxx
            xxxlllllxx            xxxx
              xxxxxxxx
ENDMAP
###############################################################################

###############################################################################
# Collapsing caverns! These don't actually have flame clouds. Wow!
# idea by dpeg, original execution by due, reworked by hellmonk.
# Inner passages close over time, requiring the player to brave the harder outer
# section if they want all the loot, but nothing is ever permanently cut off.
#
NAME:   hellmonk_volcano_collapse
TAGS:   no_item_gen no_monster_gen
ORIENT: encompass
WEIGHT: 10
{{
local collapse_marker = TriggerableFunction:new (
  {
    func="volcano_caves_collapse_doorways",
    repeated=true,
    props = {
      -- Only collapse one doorway at a time, randomly.
      single_random_replica="true"
    }
  }
)

collapse_marker:add_triggerer(DgnTriggerer:new {
  type="turn",
  delay_min=50,
  delay_max=200
})

}}
SUBST: Z = c., 4 = 332.
SUBST: * = ddeeffgg$
: fiery_guardians(_G)
: lua_marker("M", Triggerable.synchronized_markers(collapse_marker))
: volcano_setup(_G)
MAP
  lllllllllllllllllllllllll
 lllllllllllllllllllllllllll
llllllllllllllllllllllllllllll
llll.......4......llllllllllll
llll.cccc...........lllllllllll
lll..cZZcccccccZZ.....llllllllll
lll.ccZ<ZZ.ccZccc..4..llllllllll
lll.=*2....M.ZZ.=...........llll
lll.=*1..ZZc..Z.=...........llll
lll.cc**ccccZ...cccccccccc..llll
lll..cccc<ccc...cc..Z<Z.Zc...lll
lll....c2..Zc.1..M...1..*=...lll
lll.4..c*..Zc....cZZ...Z*=...lll
lll....=*..cc...Zccccccccc...lll
lll....=*..M...ZZc..ZZc.....llll
llll...c*..c.c...M...*=.....llll
llll...c11cccc...cc.1*=..4..llll
llll...cZZcZ.M.1..cZ<ccc...lllll
lllll..cccc..c..Zccccc*=...lllll
lllll...cZ...cZ..cZ.Z.*=...lllll
lllll..cc..Zccc..M..1.cc...lllll
lllll4.=*1ZccZZ1.cccZ<c....lllll
lllll..=*<Zc..Z.Zc.ccccc....llll
lllll..cccccc......M..Zcc...llll
lllll..ccc..M......c<1.Zcc...lll
lllll..cZ<..c.....ZccZ..Zc..4lll
lllll..cZ.1ZccZ.A<..ccZ**c...lll
llllll.ccc**ccc.....ccc==c...lll
llllll...c==cccZ..Zcc.......llll
llllll.......ccc.Zcc........llll
llllll....4...ccccc....4....llll
 llllllll................llllll
  llllllllllllllllllllllllllll
   llllllllllllllllllllllllll
     llllllllllllllllllllll
ENDMAP
###############################################################################

###############################################################################
# Venture into the center of the Earth! Or a volcano. The dinosaurs await...
NAME:    pf_volcano_lost_world
TAGS:    no_item_gen no_monster_gen
ORIENT:  encompass
WEIGHT:  10
# groups of lesser enemies led by a few nastier ones
MONS:    patrolling fire dragon
MONS:    salamander
MONS:    ogre w:5 / two-headed ogre w:5 / steam dragon w:5 / wyvern / \
         komodo dragon / fire bat
MONS:    patrolling fire bat band
KMONS:   p = plant
NSUBST:  G = 1:2 / *:3, H = 1:2 / *:3, I = 1:2 / *:3
# fixed loot types for the cave, but shuffle it a little
SHUFFLE: def
SUBST:   g = def
: volcano_setup(_G)
SHUFFLE: JKM
MARKER:  J = lua:fog_machine { cloud_type = "flame", \
             pow_min = 2, pow_max = 3, delay = 20, start_clouds = 1, \
             size = 2, walk_dist = 0, spread_rate= 0 }
MARKER:  K = lua:fog_machine { cloud_type = "flame", \
             pow_min = 2, pow_max = 4, delay = 39, start_clouds = 1, \
             size = 2, walk_dist = 0, spread_rate= 0 }
MARKER:  M = lua:fog_machine { cloud_type = "flame", \
             pow_min = 2, pow_max = 5, delay = 47, start_clouds = 1, \
             size = 2, walk_dist = 0, spread_rate= 0 }
SUBST:   JKM = l
: dgn.delayed_decay(_G, 'C', 'human skeleton')
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxllllllllxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxllllllllllllxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxlllll.g.t.<.tllxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxllllll..t.$..$.g.llxxxxxxxxxxxxxx
xxxxxxxxxxxxxlllMlll.t$.gp.t.p.t.lxxxxxxxxxxxxxx
xxxxxxxxxxxxlllllllt.g.$..g$.g..tllxxxxxxxxxxxxx
xxxxxxxxxxxllllllllt.gt.3.1.p.t..lllxxxx<xxxxxxx
xxxxxxxxxxlllllJllltp..p.....$...lllxxxxxpxxxxxx
xxxxxxxxxlllKllllllt.......3...t.llxxxxxdCexxxxx
xxxxxxxxlllllllllllttp...tttttt.llxxxxxxxf4xxxxx
xxxxxxxxllllllllMlllttt..tt.ptttlxxxxxxxxx.xxxxx
xxxxxxxlllMllllllllllltt....ttlllxxxxxxxx..xxxxx
xxxxxxlllllllllllllJllltttp..llllxxxxxxx...xxxxx
xxxxxxllllllllllllllllllltt..plllxxxx..p..xxxxxx
xxxxxxlJllllpt.p.tlllllKlll...pllt.p.p...xxxxxxx
xxxxxllllll..p.....lllllllllt.ptlp...xxxxxxxxxxx
xxxxxlllllp.p...p.p.pllllll..p..l..pxxxxxxxxxxxx
xxxxlKlllt..tt.pt....tllll.tp..pllptxxxxxxxxxxxx
xxxxlllll...t...plp..p33pt....plllllllxxxxxxxxxx
xxxlllll..p.tt.lllltp..t3.p..tllllllllllxxxxxxxx
xxxlMlllp.....p.lllttp..3...ttlllJllMllllxxxxxxx
xxlllllp..It....tllltttpt.pttllKllllllllllxxxxxx
xxllllltpgpIII..plllllttttttllllllllllllJllxxxxx
xxlJlllttppgttI..pllKlllllllllltttttttllllllxxxx
xllllllttttttt.I.tllllllMllllltt.ptttttlllMllxxx
xlllllltptttt..t.tlllJllllltl..p...tgp.tlllllxxx
xllKlllp........ptllllllllttpt...tp.....plllKlxx
xllllll..t...ptttttlllltp.t...p......t.p.tllllxx
xllllllp.p..ttttp.ttt.p..p..tp..ttt.p.p.pplllllx
xllMlll.p..tttt...p..t.....ptlllllpp..tG..pllJlx
xlllllllt..tt.p.t....t..pp.llllllllpG.pG.ppllllx
xxllllllttH.pH.pp..p...t.llllllKlll.pGG.p.pllllx
xxlllJlllt.H.t.H.....pllllllttttllllp..t.plllMlx
xxxllllllttH.H....t.lllllttttp.ttllltt..ptlllllx
xxxxxllKlltt.p.tpllllltttt33..p.ttttttt..tlllllx
xxxxxxlllllllllllllllltpt3.tp....ppt....ttllKlxx
xxxxxxxlllMlllllllJllttp.tttttpp....p..ttllllxxx
xxxxxxxxlllllllMllllttp..tllltttttptttttllllxxxx
xxxxxxxxllllJllllllttpt.ttllllllltttlllllJlxxxxx
xxxxxxxxxxllllllKlltt..ptlllJllllllllMlllxxxxxxx
xxxxxxxxxxxxxxlllllt..pttllllllllKllllxxxxxxxxxx
xxxxxxxxxxxxxxxxllttpt..txxxxlllllxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxx..A..xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxx..<..xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxx....xxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP
