# Glass vaults
#
# Single instances of serial_glass vaults can be placed normally, so
# we only roll numbers between 2 and 12 (non-flat distribution).
# Sometimes we add a few rarer glass vaults to the level.
#
# The maps for this serial vault are in mini_features.des and can
# also be used individually.

NAME:   serial_glass
TAGS:   allow_dup extra luniq_serial decor nolayout_encompass
DEPTH:  D, Depths, Elf, Crypt, Dis
CHANCE: 1%
{{
  local c = 2 + crawl.random2(3) * crawl.random2(3) * crawl.random2(4)
  local d = crawl.random2(2) * crawl.random2(2) * crawl.random2(5)
  local tile = "dngn_transparent_wall"
  if not you.in_branch("D") and crawl.one_chance_in(4) then
    tile = tile .. util.random_from({"_blue", "_white", "_darkgray"})
  end
  dgn.persist.serial_glass_tile = tile
  hook("post_place", function()
    dgn.place_maps{tag="serial_glass", count=c}
    if not you.in_branch("Dis") then
      dgn.place_maps{tag="serial_glass_rare", count=d}
    end
  end)
}}
