##############################################################################
#
# Treasure Trove (by due)
#
# Troves are once-only tolled portals to a treasure chamber, most of which
# are weighted acquirement-esque towards your skills.  Of course, there's a
# chance that you'll get rubbish (casters in an weapon/armour room and melee
# fighters in a library), but that's kind of the point.
#
##############################################################################
{{

trove = {}

function trove.get_trove_item(e, value, base_item)
  -- This function should return a table with the following values:
  --  quantity=0 (number of items, 1 unless consumables)
  --  base_type="armour" (armour, weapon, potion, scroll, jewellery, or miscellaneous)
  --  sub_type="robe" (short sword, etc)
  --  ego_type="resistance" (or false)
  --  plus1=4 (or false)
  --  artefact_name=false (setting this will compare artefact names and status
  --                       and will be used as the full title for artefact books
  --                       and so-on. leave as false for non-artefacts.)
  local item = {
    quantity=1,
    base_type="",
    sub_type="",
    ego_type=false,
    plus1=false,
-- start TAG_MAJOR_VERSION == 34
    plus2=false,
-- end TAG_MAJOR_VERSION
    artefact_name=false,
  }

  -- For testing purposes, you can force an item.
  if base_item ~= nil then
    item.quantity = base_item.quantity
    local p1 = base_item.pluses()
    item.plus1 = p1
    item.ego_type = base_item.ego_type
    item.base_type = base_item.base_type
    item.sub_type = base_item.sub_type
    item.artefact_name = base_item.artefact_name
    if (base_item.sub_type == "rune of Zot") then
      item.ego_type = base_item.name()
    end
    return item
  end

  -- 1/3 chance of trying to get a shop item
  if crawl.one_chance_in(3) then
  local floorlist, shoplist
  floorlist, shoplist = dgn.stash_items(value, true)
  if #shoplist ~= 0 then
    shop_item = shoplist[crawl.random2(#shoplist)+1]
    if not shop_item.identified() then
      shop_item = shoplist[crawl.random2(#shoplist)+1]
    end
    local jwith_pluses = {"ring of protection", "ring of evasion",
                          "ring of strength", "ring of intelligence",
                          "ring of dexterity", "ring of slaying",
                          "amulet of reflection"}
    local bt = shop_item.base_type
    if bt == "armour" or bt == "weapon" or bt == "jewellery" then
      if shop_item.identified() then
        item.quantity = shop_item.quantity
        item.base_type = shop_item.base_type
        item.sub_type = shop_item.sub_type
        item.ego_type = shop_item.ego_type
        if shop_item.artefact then
          item.artefact_name = shop_item.artefact_name
        end
        local shop_plus1 = shop_item.pluses()
        if item.base_type == "armour" then
          item.plus1 = shop_plus1
        elseif item.base_type == "weapon" then
          item.plus1 = shop_plus1
        elseif item.base_type == "jewellery" then
          if util.contains(jwith_pluses, item.sub_type) then
            item.plus1 = shop_plus1
          end
        else
          item.plus1 = false
        end
        return item
      end
    end
  end
  end

  local d = crawl.roll_dice

  -- base is item.base_type, type is item.sub_type, quant is an additional parameter (quantity, charges, etc)
  -- currently 20% armour, 15% weapon, 50% consumable, 15% miscellaneous
  local prices = {
       {base="scroll", type="acquirement", quant=2},
       {base="scroll", type="fear", quant=2+d(3)+d(3)},
       {base="scroll", type="fog", quant=2+d(3)+d(3)},
       {base="miscellaneous", type="rune of Zot", quant=3, name="slimy rune of Zot"},
       {base="miscellaneous", type="rune of Zot", quant=11, name="abyssal rune of Zot"},
       {base="miscellaneous", type="horn of Geryon"} }

  local wpn = {
       {base="weapon", type="demon whip", quant=2+d(3)+d(3)},
       {base="weapon", type="demon trident", quant=2+d(3)+d(3)},
       {base="weapon", type="demon blade", quant=2+d(3)+d(3)} }

  if you.race() ~= "Felid" then
    for _, toll in ipairs(wpn) do
      table.insert(prices, toll)
    end
  end

  local arm = {
       {base="armour", type="gold dragon scales", quant=1+d(2)},
       {base="armour", type="storm dragon scales", quant=d(2)+d(2)},
       {base="armour", type="shadow dragon scales", quant=d(2)+d(2)},
       {base="armour", type="fire dragon scales", quant=d(3)+d(3)},
       {base="armour", type="ice dragon scales", quant=d(3)+d(3)} }

  if you.race() ~= "Felid" and you.race() ~= "Octopode" then
    for _, toll in ipairs(arm) do
      table.insert(prices, toll)
    end
  end

  local pots = {
       {base="potion", type="resistance", quant=2+d(3)} }

  local heal_pots = {
       {base="potion", type="curing", quant=12+d(4)+d(4)},
       {base="potion", type="heal wounds", quant=8+d(3)+d(3)} }

  if you.race() ~= "Mummy" then
    if you.race() ~= "Vine Stalker" then
      for _, toll in ipairs(heal_pots) do
        table.insert(pots, toll)
      end
    end
    if you.race() ~= "Formicid" then
      table.insert(pots, {base="potion", type="haste", quant=4+d(3)+d(2)})
    end

    for _, toll in ipairs(pots) do
      table.insert(prices, toll)
    end
  end

  local stasis_tolls = {
       {base="scroll", type="blinking", quant=1+d(2)+d(2)},
       {base="scroll", type="teleportation", quant=10+d(4)+d(4)} }

  if you.race() ~= "Formicid" then
    for _, toll in ipairs(stasis_tolls) do
      table.insert(prices, toll)
    end
  end

  local chosen = util.random_from(prices)
  item.base_type = chosen.base
  item.sub_type = chosen.type
  if chosen.base == "armour" or chosen.base == "wand" then
    item.plus1 = chosen.quant
  elseif chosen.base == "weapon" then
    item.plus1 = chosen.quant
  elseif chosen.base == "scroll" or chosen.base == "potion" then
    item.quantity = chosen.quant
  end
  if chosen.type == "rune of Zot" then
    item.plus1 = chosen.quant
    item.ego_type = chosen.name -- not an actual ego, just the name of the rune
  end
  return item
end

function trove.get_trove_toll(e)
  if crawl.one_chance_in(20) and you.race() ~= "Demigod"
     and you.god() ~= "Gozag" and you.god() ~= "Ashenzari"
     and you.god() ~= "Uskayaw" and you.god() ~= "Yredelemnul" then
    return trove.get_toll_nopiety()
  else
    return trove.get_trove_toll_with_item(
        trove.get_trove_item(e, 1000))
  end
end

function trove.get_trove_toll_with_item(item)
  return { item = item }
end

function trove.get_toll_nopiety()
  return { nopiety = true }
end

function trove.portal(e)
    -- dependent on player stats (skills, race, etc) so needs to be isolated
    -- from gameplay rng.
    local toll = crawl.rng_wrap(function () return trove.get_trove_toll(e) end,
                                "subgenerator")

    local function stair ()
        return trove_marker  {
            toll = toll,
            entity = "portal",
            toll_desc = "to enter a treasure trove",
            floor = "expired_portal",
            feat_tile = "dngn_portal_trove_gone",
        }
    end
    e.tags("uniq_trove no_monster_gen chance_trove")
    e.lua_marker("O", stair)
    e.kfeat("O = enter_trove")
    e.colour(". = blue")
    e.ftile(".OcG+ = floor_marble")
    e.tile("c = wall_stone_dark")
end

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

-- "any scroll good_item" still gets you 'scroll of noise' etc so let's
-- limit it to the enchant scrolls, tloc scrolls, identify scrolls, mapping
-- scrolls with a low chance of silence, vulnerability or acquirement (lowest)
function trove.good_scroll (e)
    e.item([[scroll of enchant weapon / scroll of brand weapon w:3 /
             scroll of enchant armour / scroll of immolation w:8 /
             scroll of revelation w:8 / scroll of blinking /
             scroll of silence w:2 / scroll of acquirement w:1 /
             scroll of teleportation w:20 / scroll of vulnerability w:2 /
             scroll of fog w:8 / scroll of torment w:8 /
             any ally scroll w:1 ]])
end

function trove.place_fog(e, type, strength)
   e.lua_marker("m", fog_machine { pow_max = strength, cloud_type = type,
                     delay_min = 50, delay_max = 300, size = 12,
                     start_clouds = 1 } )
end

function trove.weapon_skills (e)
    local weapon_skills = { "Short Blades", "Long Blades", "Axes",
        "Maces & Flails", "Polearms", "Staves", "Ranged Weapons" }
    local skill_total = 0
    local nonzero_skills = 0
    for _, skill in ipairs(weapon_skills) do
        local base_skill = you.base_skill(skill)
        skill_total = skill_total + base_skill
        if base_skill > 0 then
            nonzero_skills = nonzero_skills + 1
        end
    end
    if nonzero_skills > 0 then
        return skill_total / nonzero_skills
    else
        return 0
    end
end

function trove.spell_skills (e)
    local spell_skills = { "Spellcasting", "Conjurations", "Hexes", "Summonings",
        "Necromancy", "Translocations", "Alchemy", "Fire Magic", "Ice Magic",
        "Air Magic", "Earth Magic" }
    local skill_total = 0
    local nonzero_skills = 0
    for _, skill in ipairs(spell_skills) do
        local base_skill = you.base_skill(skill)
        skill_total = skill_total + base_skill
        if base_skill > 0 then
            nonzero_skills = nonzero_skills + 1
        end
    end
    if nonzero_skills > 0 then
        return skill_total / nonzero_skills
    else
        return 0
    end
end
}}

default-depth: D:10-, Depths, Elf, Vaults

##############################################################################
#
# Relevant entry portals.
#
##############################################################################

NAME:   enter_trove_0
TAGS:   transparent no_descent
CHANCE: 5%
: trove.portal(_G)
MAP
O
ENDMAP

NAME:   enter_trove_1
TAGS:   transparent no_descent
CHANCE: 5%
: trove.portal(_G)
MAP
...
.O.
...
ENDMAP

NAME:   enter_trove_2
TAGS:   transparent no_descent
CHANCE: 5%
: trove.portal(_G)
MAP
 @G@
@G.G@
G.O.G
@G.G@
 @G@
ENDMAP

NAME:   enter_trove_3
TAGS:   uniq_trove no_monster_gen no_wall_fixup transparent no_descent
CHANCE: 5%
: trove.portal(_G)
COLOUR: c = blue
MAP
ccccc
c...c
c.O.c
c...c
cc+cc
ENDMAP

# Of course, not everyone is willing for you to take their treasure...
NAME:   enter_trove_5
TAGS:   transparent no_descent
CHANCE: 5%
: trove.portal(_G)
COLOUR: e = blue
FTILE:  e = floor_marble
: if you.absdepth() <= 15 then
# Got drafted in from Vaults:$, while the mages try and close the portal down.
KMONS:  e = vault guard
: else
# And this time he brought some friends...
KMONS:  el = vault guard
COLOUR: l = blue
FTILE:  l = floor_marble
: end
MAP
ccccc
c...c
c.O.c
c...c
cc+cc
cl.lc
c.e.c
cl.lc
cc+cc
ENDMAP

# Someone left some gold behind for you!
NAME:   enter_trove_6
TAGS:   transparent no_descent
CHANCE: 5%
: trove.portal(_G)
KFEAT:  X = +
MARKER: X = lua: props_marker { connected_exclude="true" }
COLOUR: $X = blue
MAP
ccccccc
c$$$$$c
c$XXX$c
c$XOX$c
c$XXX$c
c$$$$$c
ccc+ccc
ENDMAP

NAME: nicolae_trove_entry_columns
TAGS: transparent no_descent
CHANCE: 5%
: trove.portal(_G)
MAP
cccccccccccc
c.........cc
c.c.c.c.c.cc
+.........Oc
c.c.c.c.c.cc
c.........cc
cccccccccccc
ENDMAP


NAME: nicolae_trove_entry_crossroad
TAGS: transparent no_descent
CHANCE: 5%
: trove.portal(_G)
COLOUR: @ = blue
FTILE: @ = floor_marble
MAP
cc@cc
c...c
@.O.@
c...c
cc@cc
ENDMAP

NAME: nicolae_trove_entry_crystal
TAGS: transparent no_descent
CHANCE: 5%
: trove.portal(_G)
FTILE: b = floor_marble
MAP
ccccccccccc
cc.c.c.cccc
c.......bbc
+.......Obc
c.......bbc
cc.c.c.cccc
ccccccccccc
ENDMAP

NAME: nicolae_trove_entry_diagonal
TAGS: transparent no_descent
CHANCE: 5%
: trove.portal(_G)
MAP
   c
  ccc
 ccccc
cccO.cc
 cc...cc
  cc...cc
   cc...cc
    cc...cc
     cc...cc
      cc.+c
       ccc@
        c
ENDMAP

NAME: nicolae_trove_entry_free_sample
TAGS: transparent no_descent
CHANCE: 5%
: trove.portal(_G)
COLOUR: % = blue
FTILE: % = floor_marble
MAP
%.%
.O.
%.%
ENDMAP

NAME: nicolae_trove_entry_isolated
TAGS: no_pool_fixup transparent no_descent
CHANCE: 5%
KPROP: .O = no_tele_into
KMASK: .O = opaque
KFEAT: ' = .
: trove.portal(_G)
MAP
'''''''
'wwwww'
'w...w'
'w.O.w'
'w...w'
'wwwww'
'''''''
ENDMAP

NAME: nicolae_trove_entry_path_of_doom
TAGS: transparent no_descent
CHANCE: 5%
KMONS: O = patrolling guardian mummy
KMONS: m = patrolling guardian mummy / nothing w:20
: trove.portal(_G)
COLOUR: $m = blue
FTILE: $m = floor_marble
MAP
  ccccc
 cc.O.cc
cc.....cc
c$.G.G.$c
c$..m..$c
c$.G.G.$c
cc.....cc
 cc...cc
  cc+cc
ENDMAP

NAME: trove_entry_hex_spiral
TAGS: transparent no_descent
CHANCE: 5%
: trove.portal(_G)
MAP
             @cc
    ccccccccc..cc
   cc.......cc..cc
  cc..ccccc..cc..cc
 cc..cc..Occ..cc..cc
cc..cc..ccc..cc..cc
 cc..cc.....cc..cc
  cc..ccccccc..cc
   cc.........cc
    ccccccccccc
ENDMAP

##############################################################################
#
# The portal vaults:
#
# Most of the vaults have 16 items of loot. Usually weighted 'd', 'e', 'f', from
# good to "worse". Some vaults have more than 16 items for specific reasons.
#
##############################################################################

default-depth: Trove

NAME:    trove_simple
WEIGHT:  60
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen allow_dup
# Loot: 16 items.
ITEM:   any useful good_item
ITEM:   acquire jewellery / any useful good_item
ITEM:   acquire weapon / acquire armour / any useful good_item
: trove.setup_features(_G)
MAP
xxxxxx
xddddx
xfeedx
xefedx
xdefdx
xx++xx
xx..xx
xx..xx
xx..xx
x....x
x.<A.x
x....x
xxxxxx
ENDMAP

NAME:    trove_garden
WEIGHT:  40
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen allow_dup
# Loot: 16 items, spread out a bit.
KFEAT:   x = X
COLOUR:  o = blue
#
# Plants come in two pattern: regular or random. Vegetation can be thin or thick.
# There are more plants near the river.
SUBST:   W = w .
: if crawl.coinflip() then
SUBST:   " = . 1:20
SUBST:   1 = . 1:1
SUBST:   ' = .
:else
SUBST:   1 = .
SUBST:   " = '
SUBST:   w = w 1:2
NSUBST:  . = 12:M / 12:1 / *:.
SHUFFLE: Mm
SUBST:   M = .
SUBST:   . = . 1:1
SUBST:   ' = . 1:3
:end
#
SUBST:   V=w. , v=w, _=.
SUBST:   1 : 1 2
SUBST:   2 = 1 .
SUBST:   1 : 1 2:2 3:1
#
MONS:    plant col:white
MONS:    plant col:white / plant col:blue w:6
MONS:    plant col:white / plant col:cyan w:3 / plant col:blue w:3
#
# Items: d = scrolls from header function, e/E = jewellery/amulets,
#        f/F/B = armour/weapon/book, g = potions
SHUFFLE: eE, fFB
: trove.good_scroll(_G)
KITEM:   e = acquire jewellery w:5 / any useful jewellery good_item / any jewellery w:2
KITEM:   E = any amulet useful good_item / any amulet randart w:2
KITEM:   f = acquire armour w:5 / any useful armour good_item / any armour w:2
KITEM:   F = acquire weapon w:5 / any useful weapon good_item / any weapon w:2
KITEM:   B = acquire book / acquire:sif_muna book / any book
KITEM:   g = potion of curing / potion of heal wounds / potion of experience / \
             potion of might / potion of brilliance / potion of resistance / \
             potion of magic / potion of haste
KFEAT:   w = W
: trove.setup_features(_G)
: trove.place_fog(_G, "blue smoke", 30)
KFEAT:  m = .
MAP
'"WwwW'"'1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.<
"'"wwW"'".1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.
."'"ww'"'1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1
1'"'ww"'".1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.
.1'"WwW"'".1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1
1."'"ww'"'1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.
.1'"'www'"'m.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1
1."'"Www"'".1.1.1.1.m.1.1.1.1.m.1.1.1.1.1.
.1."'"ww'"'1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1
1.1'"'wwW'".1ooooooooooooooo1.1.1.1.1.1.1.
.1."'"wwW''1.o_____________o.1.1.1.1.1.1.1
1.1'"'Www'm'1o_____________o1.1.1.1.1.1.1.
.1.1'"'wwW'''o__xxxx+xxxx__o.1.m.1.1.1.1.1
1.1."'"Www'''o__xddx_xeex__o1.1.1.1.1.1.1.
.1.1."'"Www''o__xddx_xeex__o.1.1.1.1.1.1.1
1.1.1."'"Ww''o__xxx+_+xxx__o1.1.1.1.1.1.1.
.1.1.1."'"ww'o__+___1___+__o.1.m.1.1.1.1.1
1.1.1.1'"'mwWo__xxx+_+xxx__o1.1.1.1.1.1.1.
.1.1.1.1'"'wwo__xffx_xggx__o.1.1.1.1.1.1.1
1.1.1.1."'"WwoV_xffx_xggx__o1.1.1.1.1.1.1.
.1.1.1.1.1'"'ovvxxxx+xxxx__o.1.1.1.1.1.1.1
1.1.1.1.1.1'"oVvV__________o1.1.1.1.1.1.1.
.1.1.1.1.m.1'o_vvvV________o.1.m.1.1.1.1.1
1.1.1.1.1.1.1o_vvvvvv______o1.1.1.1.1.1.1.
.1.1.1.1.1.1.o__vvvvvvv____o.1.1.1.1.1.1.1
1.1.1.1.1.1.1o__Vvv<_Avv___o1.1.1.1.1.1.1.
.1.1.1.1.1.1.o____vvvvvvv__o.1.1.1.1.1.1.1
1.1.1.1.1.1.1o________VvvvVo"'1.1.1.1.1.1.
.1.1.1.1.1.1.ooooooooooooooo'"'1.1.1.1.1.1
1.1.1.1.1.1.1.1.1.1.1."'"Www"'".1.1.1.1.1.
.1.1.1.1.1.m.1.1.1.m.1.1'"'WwwW"'".1.1.1.1
1.1.1.1.1.1.1.1.1.1.1.1.1'"'WwmW"'".1.1.1.
.1.1.1.1.1.1.1.1.1.1.1.1.1'"'wwwW"'".1.1.1
1.1.1.1.1.1.1.1.1.1.1.1.1.1."'"WwWw'"'1.1.
.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1'"'wWwW"'".1
1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1."'"WwwwW"'
<1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1."'"WwW"
ENDMAP

# A "library", geared towards scrolls and books (either spell or manual).
NAME:   trove_library
WEIGHT: 30
veto {{ return crawl.game_started()
          and trove.spell_skills() < trove.weapon_skills()
          and not crawl.one_chance_in(6) }}
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup
: trove.setup_features(_G)
: trove.good_scroll(_G)
ITEM:   acquire book
ITEM:   acquire:sif_muna book
MAP
xxxxxxxxxxxxx
xd.........dx
xx.xxx.xxx.xx
xf.dxe.dxe.dx
xx.xxx.xxx.xx
xe.fxd.fxd.ex
xx.xxx.xxx.xx
xe.........dx
xxxxx+++xxxxx
    x...x
    x...x
    x...x
   xx...xx
   x.....x
   x.<.A.x
   xxxxxxx
ENDMAP

# A 'jewellery shoppe' or display cabinet.
NAME:   trove_jewel_1
WEIGHT: 20
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup
# Loot: once again, 16 items.
ITEM:   acquire jewellery / any useful jewellery good_item / any jewellery w:2
: trove.setup_features(_G)
MAP
xxxxxxxx
x......x
x.<..A.x
x......x
xxx++xxx
x......x
x+o..o+x
xdo..odx
xdo..odx
xdo..odx
xdo..odx
xdoooodx
xddddddx
xxxxxxxx
ENDMAP

# A simple treasure chamber.
NAME:   trove_jewel_2
WEIGHT: 20
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup
# Loot: 15 items this time.
ITEM:   acquire jewellery / any useful jewellery good_item / any jewellery w:2
COLOUR: x = blue
: trove.setup_features(_G)
MAP
xxxxxxxx
xddd+<Ax
xdddxxxx
xdddx
xdddx
xdddx
xxxxx
ENDMAP

# A 'weapon shoppe', same template as the jewellery shop.
NAME:   trove_weapon_1
veto {{ return crawl.game_started()
          and (trove.weapon_skills() < trove.spell_skills()
               or trove.weapon_skills() < you.base_skill("Unarmed Combat"))
          and not crawl.one_chance_in(3) }}
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup no_species_fe
# Loot: once again, 16 items.
ITEM:   acquire weapon / any useful weapon good_item / any weapon w:2
: trove.setup_features(_G)
MAP
xxxxxxxx
x......x
x.<..A.x
x......x
xxx++xxx
x......x
x+o..o+x
xdo..odx
xdo..odx
xdo..odx
xdo..odx
xdoooodx
xddddddx
xxxxxxxx
ENDMAP

# A simple treasure chamber.
NAME:   trove_weapon_2
veto {{ return crawl.game_started()
          and (trove.weapon_skills() < trove.spell_skills()
               or trove.weapon_skills() < you.base_skill("Unarmed Combat"))
          and not crawl.one_chance_in(3) }}
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup no_species_fe
# Loot: 15 items.
COLOUR: x = blue
ITEM:   acquire weapon / any useful weapon good_item / any weapon w:2
: trove.setup_features(_G)
MAP
xxxxxxxx
xddd+<Ax
xdddxxxx
xdddx
xdddx
xdddx
xxxxx
ENDMAP

# An 'armour shoppe', same template as the jewellery shop.
NAME:   trove_armour_1
WEIGHT: 15
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup no_species_fe no_species_op
# Loot: once again, 16 items.
ITEM:   acquire armour / any useful armour good_item / any armour w:2
: trove.setup_features(_G)
MAP
xxxxxxxx
x......x
x.<..A.x
x......x
xxx++xxx
x......x
x+o..o+x
xdo..odx
xdo..odx
xdo..odx
xdo..odx
xdoooodx
xddddddx
xxxxxxxx
ENDMAP

# A simple treasure chamber.
NAME:   trove_armour_2
WEIGHT: 15
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup no_species_fe no_species_op
# Loot: 15 items.
COLOUR: x = blue
ITEM:   acquire armour / any useful armour good_item / any armour w:2
: trove.setup_features(_G)
MAP
xxxxxxxx
xddd+<Ax
xdddxxxx
xdddx
xdddx
xdddx
xxxxx
ENDMAP

# A "themed" trove.
NAME:    trove_hunter_1
WEIGHT:  5
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen allow_dup no_species_fe no_species_op \
         no_species_dr
# Loot:  15 items, this time.
COLOUR:  x = blue
MONS:    storm dragon zombie
MONS:    golden dragon zombie
MONS:    fire dragon skeleton
ITEM:    animal skin good_item / any armour good_item
ITEM:    gold dragon scales / storm dragon scales / fire dragon scales / troll leather armour / any useful armour good_item
ITEM:    javelin good_item / dart good_item
ITEM:    longbow good_item / arbalest good_item / any useful weapon good_item
SHUFFLE: 123
SHUFFLE: defg
: trove.setup_features(_G)
MAP
xxxxxxx
x1x2x3x
xooooox
xdededx
xfgfgfx
xgfffgx
xxx+xxx
x.....x
x.<.A.x
x.....x
xxxxxxx
ENDMAP

# Did you ever wonder who the treasure was taken from?
NAME:   trove_nasty
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup no_vmirror no_rotate
WEIGHT: 2
COLOUR: x = blue
NSUBST: " = 1:+ / *:x
NSUBST: ' = 1:+ / *:x
# 24 items, just because we're feeling generous.
ITEM:   any useful good_item w:10 / any
ITEM:   any useful jewellery good_item / any useful good_item
ITEM:   acquire weapon / acquire armour / any useful good_item
ITEM:   human skeleton
KFEAT:  m = iron_grate
: trove.setup_features(_G)
MAP
        mmmmmmmmmm
        m..gmmg..m
xxxxxxxxmmmmmmmmmmxxxxxxxx
x........................x
x.x'x'xxxxxxxxxxxxxxxxxx.x
x.'edd+...............<x.x
x.xdedx.mmmmmmmmmm.xx"xx"x
x.'ddex.m..gmmg..m."dedddx
x'xxxxx.mmmmmmmmmm.xededfx
xA................."fffedx
xxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# It's better down where it's wetter.
NAME:   trove_treasure_island
ORIENT: encompass
TAGS:   no_item_gen no_monster_gen allow_dup no_vmirror no_rotate no_pool_fixup
WEIGHT: 2
COLOUR: x = blue
# 17 items.
ITEM:   any useful good_item / any
ITEM:   any useful jewellery good_item / any useful good_item
ITEM:   acquire weapon / acquire armour / any useful good_item
: trove.setup_features(_G)
: set_border_fill_type("open_sea")
MAP
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwww.wwwwwwwwwwwwww
wwwwwwwwwwww....wwwwwwwwwwwww
wwwwwwwwww....e...wwwwwwwwwww
wwwwwwwwww..<dded.wwwwwwwwwww
wwwwwwwww...d...d..wwwwwwwwww
wwwwwwww.e.fd.A.d..dwwwwwwwww
wwwwwwwww...d...df..wwwwwwwww
wwwwwwwwww...ddd<d.wwwwwwwwww
wwwwwwwwwww....dd..wwwwwwwwww
wwwwwwwwwwwww.f..wwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
ENDMAP

# Misc items/evocations trove. 15 items.
NAME:    trove_misc_throne_room
ORIENT:  encompass
WEIGHT:  15
TAGS:    no_item_gen no_monster_gen allow_dup
ITEM:    manual of evocations, lightning rod, acquire magical staff
ITEM:    any area misc, phial of floods, any ally misc, phantom mirror
ITEM:    acquire wand
SHUFFLE: efghij
COLOUR:  x = blue
COLOUR:  ' = yellow
FTILE:   ' = floor_limestone
: trove.setup_features(_G)
veto {{ return crawl.game_started()
        and (you.base_skill("Evocations") < 4
             and not crawl.one_chance_in(3)
             or you.mutation("inability to use devices") == 1) }}
MAP
   xxx
   xdx
 xxx+xxx
 xk'''kx
 xe'''fx
 xk'''kx
 xg'''hx
 xk'''kx
 xi'''jx
 xk'''kx
xxxx+xxxx
x.......x
x<..A..<x
xxxxxxxxx
ENDMAP

# This can generate weapons that are out of character for Trog, e.g. pain.
# Just say they were looted from unwilling arena participants.
NAME:   trove_trog_arena
TAGS:   no_item_gen no_monster_gen allow_dup no_species_fe
veto {{ return crawl.game_started()
          and (trove.weapon_skills() < trove.spell_skills()
               or trove.weapon_skills() < you.base_skill("Unarmed Combat"))
          and not crawl.one_chance_in(3) }}
ORIENT: encompass
ITEM:   acquire weapon w:5 / acquire:trog weapon w:5 / \
        any useful weapon good_item / any weapon w:2
ITEM:   acquire:trog weapon
KFEAT:  _ = altar_trog
KFEAT:  m = iron_grate
NSUBST: ; = 2:d / 4:X / *:'
NSUBST: $ = 13:d / *:'
KPROP:  X = bloody
SUBST:  X : '
FTILE:  +<dem_' = floor_dirt
COLOUR: +<dem_' = brown
: trove.setup_features(_G)
MAP
      xxxxxxxxxxx
     xx''''<''''xx
     x'''''''''''x
     x'''mmmmm'''x
xxxxxx''mm;;;mm''xxxxxx
x$$$$x''m;;;;;m''x$$$$x
x$$$$+''+;;;;;+''+$$$$x
x$$$$x''m;;;;;m''x$$$$x
xxxxxx''mm;;;mm''xxxxxx
     x'''mmmmm'''x
     x'''''''''''x
     xx'''''''''xx
      xxx'''''xxx
        x''_''x
        x''e''x
        xx'''xx
         xx+xx
         x...x
         x.A.x
         x...x
         xxxxx
ENDMAP

###################################
#
# minmay's troves
#
# Alchemist's storehouse, has 14-26 desirable potions
NAME:    trove_alchemists_storehouse
TAGS:    no_item_gen no_monster_gen allow_dup no_species_mu
WEIGHT:  5
ORIENT:  encompass
ITEM:    potion of curing / potion of heal wounds / \
         potion of curing q:2 / potion of heal wounds q:2
ITEM:    potion of experience q:1
ITEM:    potion of might / potion of resistance / \
         potion of magic / potion of haste / \
         potion of might q:2 / potion of resistance q:2 / \
         potion of magic q:2 / potion of haste q:2
ITEM:    potion of mutation
SHUFFLE: df
SHUFFLE: eg
: trove.setup_features(_G)
MAP
      xxx xxx xxx
      xdx xfx xfx
xxxxx xdx xfx xfx
x.A.xxx+xxx+xxx+xxxxxx
x...+.............+egx
x.<.xxx+xxx+xxx+xxxxxx
xxxxx xdx xfx xfx
      xdx xfx xfx
      xxx xxx xxx
ENDMAP

# 16 pieces of armour
NAME:   trove_armour_six_rooms
TAGS:   no_item_gen no_monster_gen allow_dup no_species_fe no_species_op
ORIENT: encompass
ITEM:   acquire armour / any useful armour good_item / any armour w:2
: trove.setup_features(_G)
MAP
xxxxxxxxxx
xdd+ddx.Ax
xddxdd+..x
x+xxxxxxxx
xddxdd+..x
xdd+ddx.<x
xxxxxxxxxx
ENDMAP

# 16 weapons
NAME:   trove_weapons_four_rooms
TAGS:   no_item_gen no_monster_gen allow_dup no_species_fe
veto {{ return crawl.game_started()
          and (trove.weapon_skills() < trove.spell_skills()
               or trove.weapon_skills() < you.base_skill("Unarmed Combat"))
          and not crawl.one_chance_in(3) }}
ORIENT: encompass
ITEM:   acquire weapon / any useful weapon good_item / any weapon w:2
NSUBST: " = 16:d / *:.
: trove.setup_features(_G)
MAP
xxxxxxxxxxxxxxx
xA............x
x.ccccc.ccccc.x
x.c"""c.c"""c.x
x.c"T"c.c"T"c.x
x.c"""c.c"""c.x
x.cc+cc.cc+cc.x
x.............x
x.cc+cc.cc+cc.x
x.c"""c.c"""c.x
x.c"T"c.c"T"c.x
x.c"""c.c"""c.x
x.ccccc.ccccc.x
x............<x
xxxxxxxxxxxxxxx
ENDMAP

# 16 pieces of jewellery
NAME:   trove_jewellery_lava
TAGS:   no_item_gen no_monster_gen allow_dup
ORIENT: encompass
ITEM:   acquire jewellery / any useful jewellery good_item / any jewellery w:2
: trove.setup_features(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xllllllllxxxmmmxxxllllllllx
xllllllllxA.ddd.Axllllllllx
xllllllllx...d...xllllllllx
xllllllllmd.....dmllllllllx
xllllllllmdd.<.ddmllllllllx
xllllllllmd.....dmllllllllx
xllllllllx...d...xllllllllx
xllllllllxA.ddd.Axllllllllx
xllllllllxxxmmmxxxllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xlllllllllllllllllllllllllx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# 16 scrolls and books
NAME:   trove_books_scrolls
TAGS:   no_item_gen no_monster_gen allow_dup no_species_dj
ORIENT: encompass
veto {{ return crawl.game_started()
          and trove.spell_skills() < trove.weapon_skills()
          and not crawl.one_chance_in(6) }}
ITEM:   acquire magical staff / acquire book / acquire:sif_muna book / any book
SUBST:  d = de
: trove.good_scroll(_G)
: trove.setup_features(_G)
MAP
     xxxxx
     xd.dx
     xx.xx
     xd.dx
    xxx+xxx
xxxxx.....xxxxx
xdxdx.....xdxdx
x...+.<.A.+...x
xdxdx.....xdxdx
xxxxx.....xxxxx
    xxx+xxx
     xd.dx
     xx.xx
     xd.dx
     xxxxx
ENDMAP

# 16 scrolls and wands
NAME:   trove_wands_scrolls
TAGS:   no_item_gen no_monster_gen allow_dup
ORIENT: encompass
ITEM:   acquire wand
SUBST:  e = eeed
: trove.good_scroll(_G)
: trove.setup_features(_G)
MAP
xxxxx
x...xxxx
x.A.eeexxxx
x...exe...xxxx
xxxxeee.x.eeexxxx
   xxxx...exe...x
      xxxxeee.<.x
         xxxx...x
            xxxxx
ENDMAP

# The loot distribution here is based on the loot from the Desolation, although
# slightly changed to use acquirement. Places 16 loots.
NAME:       nicolae_trove_salty
TAGS:       no_item_gen no_monster_gen allow_dup
ORIENT:     encompass
WEIGHT:     5
KITEM:      d = acquire weapon good_item / acquire armour good_item / \
                any jewellery randart w:5 / randbook w:5
KFEAT:      E = endless_salt
MARKER:     S = lua:fog_machine { cloud_type = "salt",  walk_dist=3, \
                pow_min=6, pow_max=20, delay=5, size=15, spread_rate=10, }
NSUBST:     d = 16=d / `..
SUBST:      ` = x., c = c:90 x, d = d:4 |:3
LFLOORCOL:  lightgrey
LROCKCOL:   brown
LFLOORTILE: floor_salt
LROCKTILE:  wall_desolation
TILE:       G = DNGN_CRUMBLED_COLUMN
: set_border_fill_type('endless_salt')
: set_feature_name("granite_statue", "ruined idol")
MAP
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
E......................................E
E.............................`x`x`.S..E
E.....................cccc...cccccc....E
E.................``.`c........x.......E
E...S.............`xx`..d.d.d.dxd.d.`..E
E..................x.....x.....xx...x..E
E....................xc.d.d.x.d.d.d.c..E
E.....................cx...`x......xc..E
E...............G.G.G.cc.xcx...`c.ccc`.E
E.....................x...c.....c.`xxx.E
E......<.A........S................`x`.E
E........................`c.....c`.....E
E...............G.G.G`ccc.c...`xxcxx...E
E....................`c......xx`...`...E
E.................`..```d.d.x.d.d.d.x..E
E................`x`..x`............c..E
E...S............xx`..c.d.dxd.d.d.d....E
E................``..xc..x.x...........E
E...................x..c..cccc....ccc..E
E...................xx.................E
E..............................S.......E
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
ENDMAP

# Generates 16 branded weapons. Half are "generic" brands, the other half are
# more god-related brands.
NAME:    nicolae_trove_branded_display_cases
veto  {{ return crawl.game_started()
           and (trove.weapon_skills() < trove.spell_skills()
             or trove.weapon_skills() < you.base_skill("Unarmed Combat"))
           and not crawl.one_chance_in(3) }}
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen allow_dup no_species_fe
KITEM:   a = any weapon randart ego:electrocution / \
             any useful weapon good_item ego:electrocution / \
             any weapon ego:electrocution w:2
KITEM:   p = any weapon randart ego:flaming / \
             any useful weapon good_item ego:flaming / \
             any weapon ego:flaming w:2
KITEM:   q = any weapon randart ego:freezing / \
             any useful weapon good_item ego:freezing / \
             any weapon ego:freezing w:2
KITEM:   r = any weapon randart ego:heavy / \
             any useful weapon good_item ego:heavy / \
             any weapon ego:heavy w:2
KITEM:   s = any weapon randart ego:protection / \
             any useful weapon good_item ego:protection / \
             any weapon ego:protection w:2
KITEM:   y = any weapon randart ego:spectral / \
             any useful weapon good_item ego:spectral / \
             any weapon ego:spectral w:2
KITEM:   z = any weapon randart ego:venom / \
             any useful weapon good_item ego:venom / \
             any weapon ego:venom w:2
# Brands that are god-related (i.e. either forbidden or chosen by a god)
KITEM:   D = any weapon randart ego:antimagic / \
             any useful weapon good_item ego:antimagic / \
             any weapon ego:antimagic w:2
KITEM:   E = any weapon randart ego:chaos / \
             any useful weapon good_item ego:chaos / \
             any weapon ego:chaos w:2
KITEM:   F = any weapon randart ego:distortion / \
             any useful weapon good_item ego:distortion / \
             any weapon ego:distortion w:2
KITEM:   H = any weapon randart ego:draining / \
             any useful weapon good_item ego:draining / \
             any weapon ego:draining w:2
KITEM:   J = any weapon randart ego:holy_wrath / \
             any useful weapon good_item ego:holy_wrath / \
             any weapon ego:holy_wrath w:2
KITEM:   K = any weapon randart ego:pain / \
             any useful weapon good_item ego:pain / \
             any weapon ego:pain w:2
KITEM:   L = any weapon randart ego:speed / \
             any useful weapon good_item ego:speed / \
             any weapon ego:speed w:2
KITEM:   M = any weapon randart ego:vampirism / \
             any useful weapon good_item ego:vampirism / \
             any weapon ego:vampirism w:2
KFEAT:   + = closed_clear_door
SHUFFLE: apDE, apqrsyz, DEFHJKLM
: trove.setup_features(_G)
MAP
xxxxxxxxxxxxxxxxxx
x................x
x.....mmmmmm.....x
x..G..mDDDDm..G..x
x.....m++++m.....x
x................x
x.mmm........mmm.x
x.mp+..G..<..+Em.x
x.mp+........+Em.x
x.mp+........+Em.x
x.mp+..A..G..+Em.x
x.mmm........mmm.x
x................x
x.....m++++m.....x
x..G..maaaam..G..x
x.....mmmmmm.....x
x................x
xxxxxxxxxxxxxxxxxx
ENDMAP

# Generates 10 bardings. Rather than use a ton of "no_species_XX" tags, which
# would need to be maintained for every future new species, this just vetos on
# player species, so only barding-wearing species will see it.
NAME:    nicolae_trove_exclusive_bardings
veto     {{ return crawl.game_started()
           and you.race() ~= "Naga"
           and you.race() ~= "Armataur"
           and you.race() ~= "Palentonga" }}
TAGS:    no_item_gen no_monster_gen allow_dup
ORIENT:  encompass
KITEM:   D = barding randart good_item / barding good_item / barding w:2
SHUFFLE: TG
: trove.setup_features(_G)
MAP
xxxxxxxxxxxxxxxxx
xxxxxx.....xxxxxx
xxxxxx..A..xxxxxx
xxxxxx.....xxxxxx
xxxxx...T...xxxxx
xxxx.........xxxx
xxD.....G.....Dxx
xD.............Dx
xD..T.G.T.G.T..Dx
xD.............Dx
xxD.....G.....Dxx
xxxx.........xxxx
xxxxx...T...xxxxx
xxxxxx.....xxxxxx
xxxxxx..<..xxxxxx
xxxxxx.....xxxxxx
xxxxxxxxxxxxxxxxx
ENDMAP

# 20 items of no particular item class.
NAME:   nicolae_trove_general_collection
TAGS:   no_item_gen no_monster_gen allow_dup
ORIENT: encompass
KITEM:  d = acquire any / any useful good_item / any w:2
MAP
xxxxxxxxxxxxxxxxxxxxxxx
x.G.G.xdxdxdxdxdx.G.G.x
x.....................x
x.....xdxdxdxdxdx.....x
x..A..xxxxxxxxxxx..<..x
x.....xdxdxdxdxdx.....x
x.....................x
x.G.G.xdxdxdxdxdx.G.G.x
xxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# Generates 18 items useful for an Octopode: hats, amulets, and of course rings.
NAME:   nicolae_trove_octotrove
TAGS:   no_item_gen no_monster_gen allow_dup no_pool_fixup
ORIENT: encompass
KITEM:  D = any useful amulet good_item / any randart amulet / any amulet w:2
KITEM:  E = useful hat good_item / hat randart / hat w:2
KITEM:  F = any useful ring good_item / any randart ring / any ring w:2
KITEM:  S = buckler good_item / kite shield good_item / \
            tower shield good_item / buckler randart / \
            kite shield randart / tower shield randart / buckler w:2 / \
            kite shield w:2 / tower shield w:2
KFEAT:  ~ = open_sea
: trove.setup_features(_G)
: set_border_fill_type('open_sea')
MAP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwww...ww.EEE.wwF..wwwwwwwww~
~wwwwwwwww.w.w.......www.wwwwwwwww~
~wwwwwwwwwFw...SDDDS.....wwwwwwwww~
~wwwwwwwwwwwww.......wwwwwwwwwwwww~
~wwwwwwwwww....A...<......wwwwwwww~
~wwwwwwww...ww.......wwww.wwwwwwww~
~wwwwwwww.wwww.w...w...wF.wwwwwwww~
~wwwwwwwwFwwww.w.w.www.wwwwwwwwwww~
~wwwwwwwwwwF.w.w.w.www..wwwwwwwwww~
~wwwwwwwwwww...w.w...ww.Fwwwwwwwww~
~wwwwwwwwwwwwwww.www.wwwwwwwwwwwww~
~wwwwwwwwwwwwF...wwF.wwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ENDMAP

# Generates 20 auxiliary armours, and a diagram of where they go.
NAME:   nicolae_trove_personal_accessories
TAGS:   no_rotate no_vmirror no_item_gen no_monster_gen allow_dup \
        no_species_fe no_species_op
ORIENT: encompass
KITEM:  P = helmet good_item w:40 / hat good_item w:40 / helmet / hat
KITEM:  Q = pair of gloves good_item w:40 / pair of gloves
KITEM:  R = pair of boots good_item w:40 / pair of boots
KITEM:  S = buckler good_item w:40 / kite shield good_item w:40 / \
            tower shield good_item w:40 / orb good_item w:40 / buckler / \
            kite shield / tower shield / orb
KITEM:  Z = cloak good_item w:160 / cloak w:40 / scarf w:50
: trove.setup_features(_G)
MAP
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxPPxxxxxxxxx
xxxxxxxxP..Pxxxxxxxx
xxxxxxxx....xxxxxxxx
xxxxxxxxx..xxxxxxxxx
xxxxxxxxx++xxxxxxxxx
xxxxxxxxZZZZxxxxxxxx
xQQ....+....+....SSx
xQQ....+....+....SSx
xxxxxxxx++++xxxxxxxx
xxxxxxxx....xxxxxxxx
xxxxxxxx.A<.xxxxxxxx
xxxxxxxx....xxxxxxxx
xxxxxxxxx++xxxxxxxxx
xxxxxxxxx..xxxxxxxxx
xxxxxxxxx..xxxxxxxxx
xxxxxxxxx..xxxxxxxxx
xxxxxxxxx..xxxxxxxxx
xxxxxxxx....xxxxxxxx
xxxxxxxxRRRRxxxxxxxx
xxxxxxxxxxxxxxxxxxxx
ENDMAP

# Who said hidden doors were removed, anyway?
NAME:    pf_trove_less_simple
WEIGHT:  5
ORIENT:  encompass
TAGS:    no_item_gen no_monster_gen allow_dup
# Loot: 16 items.
ITEM:   any useful good_item
ITEM:   acquire jewellery / any useful good_item
ITEM:   acquire weapon / acquire armour / any useful good_item
ITEM:   gold q:1
KITEM:  D = stone mimic
KITEM:  E = wand of flame mimic / potion of degeneration mimic / scroll of noise mimic
KITEM:  F = any weapon damaged ident:all mimic / any armour damaged ident:all mimic
KFEAT:  X = rock_wall mimic
: trove.setup_features(_G)
MAP
xxxxxxxxx
xDDDgX+.x
xFEEDxx.x
xEFEDxx.x
xDEFDxx.x
xx++xxxgx
xx..xxxXxxxx
xx..xxx+xx<x
xx..xxxdefdx
x....xxefedx
x.<A.xxfeedx
x....xxddddx
xxxxxxxxxxxx
ENDMAP
