##############################################################################
# -2- Twisted maps.
##############################################################################
#
# The maps in this section are harder to read... which means that you can
# learn more from them. There's a bunch of reasons why maps become rather
# complicated: several layers of SUBST/SHUFFLE operations, serious use of
# lua, use of SUBVAULTs or just plain obfusciation. Some maps simply have
# extremely long headers, so we put them here.
##############################################################################

: crawl_require('dlua/vault.lua')

##############################################################################
# 37 x 22 -- this one is huge and twisted, but it's also old...
NAME:   dpeg_arrival_water_fire
TAGS:   arrival no_monster_gen no_pool_fixup no_rotate
ORIENT: float
: local rnd = crawl.random2(12)
: if rnd == 0 then
NSUBST: A=*:., a=1:./*:l, b=1:./*:l
: elseif rnd == 1 then
NSUBST: B=*:., c=1:./*:l, d=1:./*:l, e=1:./*:l, f=1:./*:l, g=1:./*:l
: elseif rnd == 2 then
NSUBST: C=*:., h=1:./*:l, i=1:./*:l, j=1:./*:l, k=1:./*:l
: elseif rnd == 3 then
NSUBST: D=*:., m=1:./*:w, n=1:./*:w, o=1:./*:w, p=1:./*:w
: elseif rnd == 4 then
NSUBST: E=*:., q=1:./*:w, r=1:./*:w, s=1:./*:w
: elseif rnd == 5 then
NSUBST: F=*:., t=1:./*:w, u=1:./*:w, v=1:./*:w
: else
SUBST:  X=+, Y:YYY+
NSUBST: Y=1:+/*:x
: end
SUBST:  XY=x, ABCabcdefghijk=l, DEFmnopqrstuv=w
KPROP:  1G = no_tele_into
MONS:   bush w:1 / plant w:6 / fungus w:9 / nothing w:45
MONS:   fungus / nothing w:20
SUBST:  "=2', '=2..., 2:222.WW
: if crawl.coinflip() then
SUBST:  Z=x, z=+, V=x
: elseif crawl.coinflip() then
SUBST:  Z=x, V=+
NSUBST: z = 1:+ / *:x
: else
SUBST:  Zz=., V=x
: end
MARKER: { = lua:props_marker { arrival_stairs=1 }
veto {{
  local replica = dgn.find_marker_positions_by_prop( "arrival_stairs", 1 )
  if replica == nil then return false end
  if replica[1] == nil then return false end
  crawl.mpr("(".. replica[1].x .. "," .. replica[1].y .. ")")
  return not dgn.has_exit_from(replica[1])
}}
MAP
            xxxxxx@xxxxxx
       xxxxxx'''''''''''xxxxxx
   xxxxx.......'"""""'.......xxxxx
 xxx..........lll222www..........xxx
xx......lllkkklll222wwwppwwww......xx
x....gllglllCllll222wwwwDwwwwwww....x
x.lllffBxlljjjlxxXXXxxwwoowwxwwssww.x
xlAlxlBlxlllCxxx11111xxxwDwwxwwExwvvx
xllAxeeexllCxx111111111xxnnwxwEwxwFwx
xlbbxlBlxliix11111111111xwDwxrrrxwuux
xlAlxlddxlClx11111G11111xmmwxwEwxwwFx
xaalxlccxhhhx11111111111xwDwxqqqxwttx
x...x...x...xx111111111xx...x...x...x
x...V...V...xxYx11111xYxx...V...V...x
xZzZx...x...xx.xxxYxxx.xx...x...xZzZx
x..ZxZ..x...V...V...V...V...x..ZxZ..x
x....ZzZx...x...x.}.x...x...xZzZ....x
xx......xZzZxZzZx...xZzZxZzZx......xx
 xxx...........ZxZzZxZ...........xxx
   xxxxx.....................xxxxx
       xxxxxx.....{.....xxxxxx
            xxxxxxxxxxxxx
ENDMAP

#########################################
# Representatives of all player genuses, locked up.
NAME:    kb_arrival_jail
TAGS:    arrival no_monster_gen no_trap_gen
ORIENT:  west
KMONS:   A = human ; nothing
KMONS:   B = elf ; nothing
KMONS:   C = dwarf ; nothing
KMONS:   D = kobold ; nothing
KMONS:   E = mummy
KMONS:   F = naga ; nothing
KMONS:   G = troll
KMONS:   H = draconian ; nothing
KMONS:   I = demigod ; nothing
KMONS:   J = spriggan ; nothing
KMONS:   K = minotaur ; nothing
KMONS:   L = demonspawn ; nothing
KMONS:   M = revenant
KMONS:   N = tengu ; nothing
KMONS:   O = merfolk ; nothing
KMONS:   P = poltergeist
KMONS:   Q = felid
KMONS:   R = octopode ; nothing
KMONS:   S = gargoyle ; nothing
KMONS:   T = formicid ; nothing
KMONS:   U = vine stalker ; nothing
KMONS:   V = barachi ; nothing
KMONS:   W = gnoll ; nothing
KMONS:   X = djinni ; nothing
KMONS:   Y = centaur ; nothing
KMONS:   Z = oni ; nothing
KMONS:   1 = goblin ; nothing
SUBST:   - = ABCDEFGHIJKLMNOPQRSTUVWXYZ1
SHUFFLE: ABCDEFGHIJKLMNOPQRSTUVWXYZ1
KPROP:   ABCDEFGHIJKLMNOPQRSTUVWXYZ1? = no_tele_into
KMASK:   ABCDEFGHIJKLMNOPQRSTUVWXYZ1? = no_item_gen
MAP
   ccccccccccccccccccccccccccccc
ccccAcCcEcGcIcKcMcOcQcScUcWcYc1c
c..cncncncncncncncncncncncncncnc
c{.+...........................+@
c..cncncncncncncncncncncncncncnc
ccccBcDcFcHcJcLcNcPcRcTcVcXcZc?c
   ccccccccccccccccccccccccccccc
ENDMAP

#########################################
# A horror show for the beginning adventurer
NAME:    shiori_arrival_whats_in_store_for_you
TAGS:    arrival no_monster_gen no_pool_fixup no_trap_gen
ORIENT:  west
KPROP:   M = no_tele_into
NSUBST:  M = 2:E / * = M E:2
KFEAT:   E = permanent teleport trap
KFEAT:   MNOQR = shallow_water
SHUFFLE: M/N/O/P/Q/R
SUBST:   P = MNO
KMASK:   EMNOQR = no_item_gen
# Player monsters:
KMONS: M = human / elf / dwarf ; nothing / kobold ; nothing / mummy / \
           naga ; nothing / troll / draconian / demigod ; nothing / \
           spriggan ; nothing / minotaur ; nothing / demonspawn ; nothing / \
           revenant / tengu ; nothing / merfolk ; nothing / poltergeist / \
           felid / octopode ; nothing / djinni ; nothing / \
           gargoyle ; nothing / formicid ; nothing / vine stalker ; nothing / \
           barachi ; nothing / gnoll ; nothing / centaur ; nothing / \
           oni ; nothing / goblin ; nothing
# Player monsters, zombie versions (undead, vine stalkers, gargoyles and djinni
# don't leave corpses):
KMONS: N = human zombie / elf zombie / dwarf zombie / kobold zombie / \
           naga zombie / troll zombie / draconian zombie / demigod zombie / \
           spriggan zombie / minotaur zombie / demonspawn zombie / \
           tengu zombie / merfolk zombie / felid zombie / octopode zombie / \
           formicid zombie / barachi zombie / gnoll zombie / centaur zombie / \
           oni zombie / goblin zombie
# Player monsters, skeletonish versions (octopodes and formicids drop out
# because they have no bones):
: local d = "draugr ; mundane long sword | mundane mace"
: kmons("N = human " .. d .. " / elf " .. d .. " / dwarf " .. d .. " / " ..
:           "kobold " .. d .. " / naga " .. d .. " / troll " .. d .. " / " ..
:           "draconian " .. d .. " / demigod " .. d .. " / spriggan " .. d .. " / " ..
:           "minotaur " .. d .. " / demonspawn " .. d .. " / tengu " .. d .. " / " ..
:           "merfolk " .. d .. " / felid " .. d .. " / barachi " .. d .. " / " ..
:           "gnoll " .. d .. " / centaur " .. d .. " / oni " .. d .. " / " ..
:           "goblin " .. d .. " / revenant")
# And now for something completely different (if any of these turn out to be
# able to escape or project spells out of their cells, they should be removed):
KMONS: Q = storm dragon / shadow dragon / iron dragon / \
           golden dragon w:1 / quicksilver dragon w:1 / \
           tentacled monstrosity / base draconian w:6 ; nothing
# Let's show off those many tiles for these weird things.
KMONS: R = large abomination / small abomination w:1
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxcccccccxxxxxcccccccccxx
xxxxxxccMcMcMcccccccMcMcMcMcxx
xxxxxcccncncncMcMcMcncncncncccc@c
xxxxxcc......cncncnc.......nMcc+cc
xxxxxc{..............cncnc.cnc...ccc
xxxxxcc..........cncncMcMn.....>.nMc
xxxxxcccncncncncncMcMcccccncnc...ccc
xxxxxxccMcMcMcMcMcccccxxxcMcMcc+cc
xxxxxxxcccccccccccxxxxxxxcccccc@c
      xxxxxxxxxxxxx     xxxxxx
ENDMAP

#####################################
# I am the great and powerful Oz! Pay no attention to the man behind
# the curtain! ...if you stick close to the wall, you are always able
# to avoid the flame clouds.
NAME:   shiori_arrival_oz
TAGS:   arrival
ORIENT: float
MONS:   kobold / goblin / hobgoblin / nothing
MARKER: # = lua:fog_machine { \
            pow_max = 5, delay_min = 100, delay_max = 150, \
            size = 4, start_clouds = 1, \
            excl_rad = 1, \
            cloud_type = "flame" }
KFEAT:  # = l
FTILE:  ' = floor_rough_red
COLOUR: ' = red
SUBST:  ' = .
MAP
bbbbbbbbbbb
b....{....b
b.........b
b.........b
b..b...b..b
b.........b
b.........b
b..b'''b..b
b..'''''..b
@..'#'#'..@
b..b'G'b..b
b.........b
bbbb+b+bbbb
 +1+.b.+1+
 bbb.b.bbb
   b@b@b
ENDMAP

############################################################################
NAME:    dpeg_arrival_concentric_ovals
TAGS:    arrival no_monster_gen no_rotate
ORIENT:  float
SUBST:   ' : Wlncxxxv, " : Wlncxxxv
MAP
.........................
.......xxxxx+xxxxx.......
....xxxxxxxx.xxxxxxxx....
...xxxxxx.......xxxxxx...
..xxxxx...........xxxxx..
..xxxx....'''''....xxxx..
..xxx...'''''''''...xxx..
.xxxx..''.......''..xxxx.
.xxx...'..""+""..'...xxx.
.xxx..''.""..."".''..xxx.
.xxx..''."".{."".''..xxx.
.xxx..''.""..."".''..xxx.
.xxx...'.."""""..'...xxx.
.xxxx..''.......''..xxxx.
..xxx...''''.''''...xxx..
..xxxx....''+''....xxxx..
..xxxxx...........xxxxx..
...xxxxxx.......xxxxxx...
....xxxxxxxxxxxxxxxxx....
.......xxxxxxxxxxx.......
.........................
ENDMAP

##############################################################################
NAME:    dpeg_arrival_solitude
TAGS:    arrival no_monster_gen transparent
ORIENT:  float
SHUFFLE: C{! / B(' / V["
SUBST:   ([ = x
# TODO: there are ways for " and ' to get to @, which seems odd. (It'll cause
# issues if this map isn't transparent, at least.)
SUBST:   C=., !=@
SHUFFLE: B' / xx, V" / xx
SUBST:   B=., '=+, V=., "=+
NSUBST:  . = 1:d / *:.
ITEM:    stone
MAP
xxxxxxxxxxxxxxxxxxx....@
xxxxxxxCCCCCCCxxxxx.....
xxxxxCCxxxxxxxCCxxx.....
xxxxCxxxVVVVxxxxCxx.....
xxxCxxVVxxxxVVxxxCx.....
xxCxxVxxxBBxxxVxxCxxxxx'
!xCxVxxxBxx(xxxVxxCxxxBx
xCxxVxxBxxxxbxxVxxCxxxBx
xCxxVxBxx{cvxxVxxxCxxxBx
xCxVxxBxCxxx[VxxxCxxxBxx
xCxVxxBxxCCxxxxCCxxxBxxx
xCxVxxxBxxxCCCCxxxBBxxxx
xCxxVxxxBBxxxxxxBBxx'xxx
!xxxxVxxxxBBBBBBxxx.....
xxxxxxVVVxxxxxxxxV".....
xxxxxxxxxVVVVVVVVxx.....
xxxxxxxx"xxxxxxxxxx....@
ENDMAP

##############################################################################
NAME:    dpeg_arrival_connections
TAGS:    arrival no_tele_into
ORIENT:  float
SHUFFLE: {1F/[2G/(3H/]4I, Aa/Bb/Cc/Dd/Ee
SUBST:   ([ = .
SUBST:   A=+, a=...>, BCDEbcde=x, GHI=.
SUBST:   1=@, F=>, 2:2., 3:33., 4:444., 234:x
MAP
22222222xxxxx333
2[......BeeeD..3
2.G.....EbbdE..3
xAxxECxDxxdbB.(3
xxAxxecxddxaAH.3
x..FEcddxDAxxCxx
x.{.DdcbB.I....4
x...Bbbcx..]...4
x...CccxC......4
x111xxxxx4444444
ENDMAP

###################################################
# A simple little maze-like thing
NAME:    shiori_arrival_maze
ORIENT:  float
TAGS:    arrival no_monster_gen
NSUBST:  A= 2= + / 2= +x / *= x
NSUBST:  B= 2= + / 2= +x / *= x
NSUBST:  C= 2= + / *= +x
SUBST:   @ = @+
MAP
xxx@xxx@xxx@xxx
@.....B0B.....@
xCx.xAxxxAx.xCx
@.x.A.....A.x.@
x.x.x.....x.x.x
x.xBx..>..xBx.x
x.x.x..{..x.x.x
@.x.A.....A.x.@
xCx.xAxxxAx.xCx
@.....B0B.....@
xxx@xxx@xxx@xxx
ENDMAP

##############################################################################
# 41 x 20 -- this one is huge and twisted, but hopefully worth it.
# From cave/forest to hall.
NAME:     erik_arrival_cave_to_civilisation
TAGS:     arrival no_rotate
WEIGHT:   20
ORIENT:   float
SHUFFLE:  {[(
SUBST:    ?=C., !=CCC., C:ccxxt, ([ = .
SUBVAULT: _ : cave_to_hall_subvault / cave_to_temple_subvault w:5
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xCCCCCCCCCCCCCCCCCCCCCCCCCxxxxxxxxxxxxxxx
xC[!..C...CC.??...C?....................x
xC..CC..CC.?C...C.?..C....C.............x
xC!C..C..C.C..?..C..?C.?.C____________..x
xC..CC!C.CC..C?.CC.......?____________..x
xC.CC...C.C..C..??..C..?C.____________..x
xC!.C.CCC.?C.?.C..CC...C..____________..x
xCC..CCC.C.C..C...?..C....____________..x
xC{CCC..CC.CC......CC.....____________..@
xC.C...C.CC.C..?C.........____________..x
xC!.CCCCCC.C...C..C?.CC...____________..x
xCCCC.C...C..C...C...?....____________..x
xC!!.!.CCC.C?....?.C...?..____________..x
xC..C!.C.C...C?...CC?...CC____________..x
xCC..CC.?C.CC....C....C...C._________...x
xC(.C..C.CC...C?.....??.................x
xCCCCCCCCCCCCCCCCCCCCCCCCCCxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    erik_arrival_cave_to_hall
TAGS:    cave_to_hall_subvault no_rotate
SHUFFLE: TTGGVY
NSUBST:  a = + / c
KMASK:   T = no_monster_gen
MAP
...T....ccc.
.......ccccc
.......ccccc
.caac...ccc.
cn00nc......
a>cc%a...T..
cnc%nc......
.caac...ccc.
.......ccccc
.......ccccc
...T....ccc.
  .........
ENDMAP

NAME:    erik_arrival_cave_to_temple
# Intentionally higher chances for the non-Temple gods.
TAGS:    cave_to_temple_subvault no_rotate no_trap_gen
KPROP:   'tCD> = no_tele_into
NSUBST:  ' = 12=1 / 4=2 / 3 / '
KMASK:   'CDUT> = no_item_gen
KMASK:   'CDUT> = no_monster_gen
: local rnd = crawl.random2(9)
: if rnd == 0 then
KFEAT:   C = altar_beogh
SUBST:   DG = I
KMONS:   1 = orc / nothing
KMONS:   2 = orc wizard / orc priest / orc / nothing
KMONS:   3 = orc warrior
: elseif rnd == 1 then
KFEAT:   C = altar_lugonu
KFEAT:   D = enter_abyss
KMONS:   1 = shadow imp / crimson imp / white imp w:5 / drude w:5
SUBST:   t : U'''', 23 = 0
: elseif rnd == 2 then
KFEAT:   C = altar_jiyva
SUBST:   D = .
KMONS:   1 = jelly / endoplasm
SUBST:   t : U'''', 23 = 0
: else
SUBST:   D = V
KMONS:   1 : gnoll / orc / 0 w:20
KMONS:   2 : ogre / 0 w:70
KMONS:   3 : troll / 0 w:70
SUBST:   t = T
: end
MAP
...T....ccc.
............
...xxxxxxxx.
..xxxxt't>x.
.xxxxx''''x.
.G.x$x'C''x.
....0=''''x.
....0=''''x.
.G.x$x'D''x.
.xxxxx''''x.
..xxxxt't>x.
  .xxxxxxxx
ENDMAP

###########################################################
# Basic island, with variations
NAME:   enne_arrival_octagon_isle
ORIENT: float
TAGS:   arrival no_monster_gen
FTILE:  '{ = floor_sand
SUBST:  ' = .
{{
    octa_room({
        oblique = crawl.random_range(3,7),
        replace = '.',
        outside = 'W',
        inside  = '.'
    })
    if crawl.coinflip() then
        smear_map({iterations=20, smear='x', onto='.W', boxy=true})
    end
}}
SUBST: W:xw
MAP
 xxxxxxxxxxxxx
x.............x
x.............x
x.............x
x.............x
......www......
.....w'''w.....
@....w'{'w....@
.....w'''w.....
......www......
x.............x
x.............x
x.............x
x.............x
 xxxxxxxxxxxxx
ENDMAP

#######################################################################
# Four elements.
# Pretty hazardous, but the Earth side is always safe to leave through.
# Players can safely watch at the clouds.
# This vault is great. I've seen players marvel at it. If need be, we
# may delegate it to another branch, where less caution measures are
# demanded. But I'd like to keep it on D:1 (dp).
NAME:    shiori_arrival_elements
TAGS:    arrival no_monster_gen no_pool_fixup no_tele_into
ORIENT:  float
KFEAT:   DIO = .
KFEAT:   H = w
KFEAT:   K = l
# Poison and Earth get random extra glass not blocking off the edges.
# Ice and Fire randomly set all liquid, next to none, or mix up both.
SUBST:   X : c., E = E n:1, R = R n:1
SUBST:   w : IJWw, J = IWww, K = w
SUBST:   l : MNNl, N = Lll, O = l
MARKER:  D = lua:fog_machine { \
             pow_min = 20, pow_max = 30, delay_min = 50, delay_max = 150, \
             size_min = 4, size_max = 8, spread_rate = 10, start_clouds = 8, \
             walk_dist = 1, cloud_type = "noxious fumes" }
MARKER:  H = lua:fog_machine{\
             pow_min = 20, pow_max = 30, delay_min = 50, delay_max = 150, \
             size_min = 4, size_max = 8, spread_rate = 10, start_clouds = 8, \
             walk_dist = 1, cloud_type = "freezing vapour"}
MARKER:  L = lua:fog_machine {\
             pow_min = 20, pow_max = 30, delay_min = 50, delay_max = 150, \
             size_min = 4, size_max = 8, spread_rate = 10, start_clouds = 8, \
             walk_dist = 1, cloud_type = "flame"}
MARKER:  P = lua:fog_machine{\
             pow_max = 20, delay_min = 50, delay_max = 300, \
             size_min = 4, size_max = 8, start_clouds = 4, \
             walk_dist = 1, cloud_type = "black smoke"}
KMASK:   DEFIMW = no_item_gen
FTILE:   DEF = floor_slime
FTILE:   I = floor_rough_blue
FTILE:   M = floor_rough_red
FTILE:   PQ = floor_mud
COLOUR:  DEF = lightgreen
COLOUR:  H = blue
COLOUR:  M = red
COLOUR:  OPQ = brown
MAP
          ...
       cccnnnccc
      ccFFEEEFFcc
      cFEEEDEEEFc
      cFFEEEEEFFc
      ccFFFEFFFcc
  cccccccnnnnnccccccc
 ccIIccccc...cccccMMcc
 cIwIIccccc+cccccMMlMc
 cIwwInccX...XccnMllMc
.nwwwInKc.....cOnMllln.
.nwHwwn.+..{..+.nllLln.
.nwwwInKc.....cOnMllln.
 cIwwInccX...XccnMllMc
 cIwIIccccc+cccccMMlMc
 ccIIcccccG.GcccccMMcc
  cccccccnn+nnccccccc
      ccRRRQRRRcc
      cRRQQQQQRRc
      cRQQQPQQQRc
      ccRRQQQRRcc
       ccc+++ccc
ENDMAP

##############################################################################
# Three arrival vaults containing the same river.
NAME:    lemuel_arrival_river_bridge
TAGS:    arrival no_monster_gen
ORIENT:  float
SHUFFLE: {}, XXT
COLOUR:  ' : brown / white
FTILE:   ' = floor_dirt
SUBST:   '=., X=x, T:tttT, T=t x:1
: if not is_validating() and crawl.coinflip() then
TAGS:    no_pool_fixup
: end
WEIGHT:  3
MAP
xxxxxxxxxxxxxxxxxxx
xXXXXXXXXXXXXXXXXXx
xXXXX{.......}XXXXx
xXXXX.........XXXXx
xwXXX.........XXXXx
xwwXX.........XXXXx
xwwwX.........XXXXx
xXwwX.........XXXXx
xXwwww........XXXXx
xXXwwwwww'w...XXXXx
xXXXwwwww'wwwwXXXXx
xXXXXwwww'wwwwwwXXx
xXXXX...w'wwwwwwwXx
xXXXX........wwwwXx
xXXXX.........Xwwwx
xXXXX.........XXwwx
xXXXX.........XXXwx
xxxxx.........xxxxx
xxxxx....@....xxxxx
ENDMAP

NAME:    lemuel_arrival_river_ford
TAGS:    arrival no_monster_gen
ORIENT:  float
WEIGHT:  6
SHUFFLE: {}, XYZ
SUBST:   X=W, Y=w, Z=w
: if crawl.random2(3) > 0 then
SUBST:   T=x, "=., '=.
: else
SUBST:   "=T.., '=T...., T:Tttt, T=t x:1
: end
MAP
xxxxxxxxxxxxxxxxxxx
xTTTTTTTTTTTTTTTTTx
xTTTT{"""""""}TTTTx
xTTTT"."..."."TTTTx
xwTTT"'.''..."TTTTx
xwwTT".'""".'"TTTTx
xwwwT.''"""'."TTTTx
xTwwX".'.''.'"TTTTx
xTwwXw..'..''"TTTTx
xTTXwwwwwww.."TTTTx
xTTTXwwwwYYwwZTTTTx
xTTTTXwwYwwwwwZwTTx
xTTTT'..wwwwwZwwwTx
xTTTT''..''..wwwwTx
xTTTT''.''.'''Twwwx
xTTTT'.'.''.''TTwwx
xTTTT.........TTTwx
xxxxx.........xxxxx
xxxxx....@....xxxxx
ENDMAP

NAME:    lemuel_arrival_river_passageway
TAGS:    arrival no_monster_gen
ORIENT:  float
SHUFFLE: {}, ABC
SUBST:   A:+, B:x, C:x
WEIGHT:  1
MAP
xxxxxxxxxxxxxxxxxxx
xxxWA{.......}xxxxx
xxwWx.........xxxxx
xwwWB.........xxxxx
xwwWx.........xxxxx
xwwWC.........xxxxx
xxWwx.........xxxxx
xxWwwwww......xxxxx
xWxwwwwwwwwww.xxxxx
xWxxwwwwwwwwwwxxxxx
xxWxxwwwwwwwwwwwxxx
xxWxx.wwwwwwwwwwwxx
xxwWx......wwwwwwxx
xwxw+.........xwwwx
xwxxx.........xxwwx
xxxxx.........xxxwx
xxxxx.........xxxxx
xxxxx.........xxxxx
ENDMAP

##############################################################################
NAME:    dpeg_arrival_caged_fury
TAGS:    arrival no_rotate
ORIENT:  float
MONS:    clockroach w:2 / ribbon worm / jelly, endoplasm, jackal / rat
MONS:    endoplasm / dart slug w:12 / jackal w:5 / rat w:5
NSUBST:  1 = 1:1 / 1:1' / *:'
SUBST:   2 = 2''', 3 = 33', 4 = 4'
FTILE:   1234ABCDEabcdem' = floor_dirt
SHUFFLE: abcde / fghij
SUBST:   f = A, g = B, h = C, i = D, j = E
SUBST:   abcde = mx, ABCDE : mx
SHUFFLE: xc, 123
KPROP:   1234' = no_tele_into
MAP
.................
.xxxxxxxxxxxxxxx.
.x4441321331444x.
.x4312132211324x.
.x4123213123134x.
.xABCDEm=medcbax.
.x.............x.
.+T....xxx....T+.
.x......{......x.
.x..T...]...T..x.
.xxx+xxxxxxx+xxx.
.................
ENDMAP

##############################################################################
NAME:    dpeg_arrival_pits
TAGS:    arrival no_monster_gen no_rotate no_pool_fixup
WEIGHT:  20
ORIENT:  float
: if crawl.one_chance_in(4) then
SUBST:   Yy=w, Zz=l, Xx"'=b
NSUBST:  U = 1:} / *:{
: elseif crawl.one_chance_in(3) then
SUBST:   U=., Yy=w, Zz=l
SHUFFLE: x_/'"
SUBST:   x=+, '=b, ":".b
NSUBST:  X = 1:} / *:{
: elseif crawl.one_chance_in(2) then
SUBST:   U=., Zz=l, Xx"'=b
NSUBST:  Y = 1:} / *:{, y = 1:. / *:w
: else
SUBST:   U=., Yy=w, Xx"'=b
NSUBST:  Z = 1:} / *:{, z = 1:. / *:l
: end
SHUFFLE: bxxx
MAP
 .......    .......
..wwww...  ...llll..
.wywwyw......lzllzl.
.wwYYww..UU..llZZll.
.wywwyw......lzllzl.
..wwww..b'bb..llll..
 ......bx"bxb......
      .'"XX"'.
      .bx"bxb.
      ..b'bb..
       ......
ENDMAP

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

NAME:   nicolae_arrival_kraken_aquarium_a
TAGS:   arrival no_monster_gen no_pool_fixup no_trap_gen generate_awake
ORIENT: float
WEIGHT: 1
KMONS:  K = kraken att:neutral
KFEAT:  K = w
NSUBST: ' = 12:! / *:'
KMONS:  ! = human / elf / dwarf ; nothing / kobold ; nothing / mummy / \
            naga ; nothing / troll / draconian / demigod ; nothing / \
            spriggan ; nothing / minotaur ; nothing / demonspawn ; nothing / \
            revenant / tengu ; nothing / merfolk ; nothing / poltergeist / \
            felid / octopode ; nothing / djinni ; nothing / \
            gargoyle ; nothing / formicid ; nothing / vine stalker ; nothing / \
            barachi ; nothing / gnoll ; nothing / centaur ; nothing / \
            oni ; nothing / goblin ; nothing
KPROP:  Kw'! = no_tele_into
KMASK:  '! = no_item_gen
KFEAT:  ' = .
MAP
  .......
 .........
..nnnnnnn..
..n'''''n..
..n'www'n..
..n'wKw'n.{
..n'www'n..
..n'''''n..
..nnnnnnn..
 .........
  .......
ENDMAP

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

NAME:   nicolae_arrival_kraken_aquarium_b
TAGS:   arrival no_monster_gen no_pool_fixup no_trap_gen
ORIENT: float
WEIGHT: 1
KMONS:  K = kraken att:neutral
KFEAT:  K = w
NSUBST: ' = 15:! / *:'
KMONS:  ! = human / elf / dwarf ; nothing / kobold ; nothing / mummy / \
            naga ; nothing / troll / draconian / demigod ; nothing / \
            spriggan ; nothing / minotaur ; nothing / demonspawn ; nothing / \
            revenant / tengu ; nothing / merfolk ; nothing / poltergeist / \
            felid / octopode ; nothing / djinni ; nothing / \
            gargoyle ; nothing / formicid ; nothing / vine stalker ; nothing / \
            barachi ; nothing / gnoll ; nothing / centaur ; nothing / \
            oni ; nothing / goblin ; nothing
KPROP:  Kw'! = no_tele_into
KMASK:  '! = no_item_gen
KFEAT:  ' = .
MAP
.........
.nnnnnnn.
.n'''''n.xxxxx
.n'www'n.x...x
.n'www'n+x...x
.n'wKw'n+..{.x
.n'www'n+x...x
.n'www'n.x...x
.n'''''n.xxxxx
.nnnnnnn.
.........
ENDMAP

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

NAME:    nagdon_arrival_double_spiral
TAGS:    arrival no_monster_gen no_trap_gen no_pool_fixup
ORIENT:  float
MONS:    plant, toadstool
: if crawl.coinflip() then
SUBST:   G : G:20 H:20 T:5 V:5 1:5 2:5 t:5 A:1 B:1 C:1
SUBST:   c : c:40 x:35 v:15 b:10
: elseif crawl.coinflip() then
SUBST:   . = W
SUBST:   ' = W.
SUBST:   G : 2:15 G:10 H:5 1:5 A:1 B:1 C:1
SUBST:   c : t:60 x:30 c:10
: else
:   if crawl.one_chance_in(4) then
SUBST:   . = W
SUBST:   ' = WW.
:   elseif crawl.one_chance_in(6) then
SUBST:   c = W
:   end
SUBST:   c : t:45
SUBST:   G : G:40 H:30 2:10 1:5 A:3 B:2
: end
KFEAT:   A = abandoned_shop
KFEAT:   B = stone_arch
NSUBST:  C = AB / c
SUBST:   H : G:60 T:5
SUBST:   '" = .
MAP
        ccc
     ccccGcccc
    cc.......cc
   cc.ccccccc.cc
  cc.cc.....cc.cc
  c.cc.cccc..cc.c
  c.c.cc...cc.c.c
 cc.c.c.cc.Gc.c.cc
 cG.c.c.cG.cc.c.Gc
 cc.c.c.cc....c.cc
  c.c.cc..cccGc.c
  c'cc.cc...ccc.c
  cc'cc.cccc...cc
   cc'cc...ccGcc
    cc'ccc.{ccc
     cc@"ccccc
        @@@
ENDMAP

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

NAME:    nagdon_arrival_zigzag_paths
TAGS:    arrival no_trap_gen no_monster_gen
ORIENT:  float
MONS:    plant, toadstool
: item(vault_species_skeletons(_G, "early"))
: if crawl.one_chance_in(3) then
  SUBST:   GHIJ = x
  SUBST:   " = .
  SUBST:   & = @
:   if crawl.coinflip() then
    SUBST:   ' = .
    SUBST:   + = +:40 .:30 1:5 2:5
:     if not crawl.one_chance_in(3) then
      SHUFFLE: [({
:     end
:   else
    SUBST:   '(+ = x
:   end
: else
  SUBST:   "['(& = x
  SUBST:   + = H
:   if crawl.coinflip() then
    SUBST:   GIJ = G
    SUBST:   G : x.
    SUBST:   H : xGc
:   else
:     if crawl.coinflip() then
      SUBST:   H = x
      SHUFFLE: GHI
      SUBST:   G = I
      SUBST:   H = x
      SUBST:   I : G:3 1:5 2
      SUBST:   J : x d e A V >:5 2:5 1:1
      SUBST:   e = dx
:     else
:       if crawl.coinflip() then
        SUBST:   H : .:20 + 1:1
        SUBST:   J = H
        SUBST:   GI =  x
:       end
        SUBST:   GIJ : x b:1
        SUBST:   H : G T V:5 1:5 2:1 A:1
:     end
:   end
: end
SUBST:   x : x c:1
: if crawl.one_chance_in(3) then
  SUBST:   G = t
: elseif crawl.one_chance_in(10) then
  SUBST:   x = t
  SUBST:   1 : 2 T
: end
KFEAT:   A = abandoned_shop / stone_arch / shaft trap / teleport trap
NSUBST:  A = A / x
SUBST:   X = x
SUBST:   ([ = .
MAP
    XXXXXXXXXXXXXXXXXXXXXXXXXXXX
 XXXXxxxxxxxxxxxxxxxxxxxx"xxxxxx
 Xxxxxxxxxxxxx"xxxxxxxxx"x"xxxxxxx&
 Xxxxxx"xxxxx"x"xxxxxxx"Jxx"xxxxx"x
XXxx[x"x"xxx"Jxx"xxxxx"GHIxx"xxx"xx
XXxxx"Jxx"x"GHIxx"xxx"xx.xxxx"x"xxx
XxxxxGHIxx"xx.xxxx"x"xx.x.xxxx"xxx&
Xxxxxx.xxxxx.x.xxxx"xx.xxx.xxxx"x"x
Xxx{x.x.xxx.xxx.xxxxx.xxxxx.xxxx"xx
Xxxx.xxx.x.xxxxx.xxx.xxxxxxx.xxxxx@
XxxGHIxxx.xx'xxxx.x.xxxxXxxxx.xxx.@
XxxxJxx'GHI'x'xxxx.xxxxXXXxxxx.x.xx
Xxxxxx(x'J'xxx'xxG+IxxXX XXxxxx.x.x
XXxxxxxxx'xxxxx'x'JxxXX   XXxxGHIx@
 XXXxxxxxxxxxxxx'xxxxXX    XxxxJxxx
   XXXXxxxxXXXxxxxxxXX     Xxxxxxxx
      XXXXXX XXXXXXXXX     XXxxxxx
ENDMAP

NAME: nicolae_arrival_memento_mori
TAGS: arrival no_monster_gen no_trap_gen uniq_your_own_corpse
ORIENT: float
SUBST: n = nN
KPROP: u = no_tele_into
KPROP: Nu = bloody
SUBST: N = n, u = uU
KMASK: uU = no_item_gen
: local race = you.race()
: local mons = you.monster()
: local skeltype = "skeleton"
: local yourname = string.gsub(you.name(), " ", "_")
: -- The corpseless. Before the game starts, you.monster() is "program bug".
: if (not crawl.game_started())
:     or race == "Mummy"
:     or race == "Gargoyle" or race == "Vine Stalker"
:     or race == "Poltergeist" or race == "Revenant"
:     or race == "Djinni" or race == "Yak" then
:   mons = "human"
: end
: if you.race() == "Formicid" or you.race() == "Octopode" then
:   skeltype = "corpse"
: end
:
: dgn.delayed_decay(_G, 'u', mons .. " name:" .. yourname .. " corpse")
: dgn.delayed_decay(_G, 'U', mons .. " name:" .. yourname .. " " .. skeltype )
MAP
xxxxxxxxxxx
x.........x
x...nnn...x
x.{.nun...+
x...nnn...x
x.........x
xxxxxxxxxxx
ENDMAP
