###############################################################################
# bazaar.des - Bazaar entry vaults and bazaar layouts.
#
# Bazaars should in general not contain dangers. Players expect that bazaars
# are peaceful. Challenges can come up, but those bazaars are weighted to be
# especially rare. Apart from this, plain and small maps are weighted to be
# generic (i.e. common), with the weirder or larger ones providing surprises.
###############################################################################


###############################################################################
# Bazaar entries

# Utility functions

lua {{

function bazaar_portal()
  local desc_long =
"Aside from the vendors who've set up their stores at various places in the " ..
"dungeon, there are others trying to make a living by traveling from place " ..
"to place. Bazaars feature a number of different shops and often have " ..
"better stock than the sedentary ones, sometimes even at a bargain. " ..
"Once you hear the clinking of coins, be sure to hurry up and find the " ..
"impromptu marketplace before the caravan moves on! " ..
"\n\n"..
"Also be warned that their nomadic lifestyle has taught these sellers to " ..
"appropriate any items an adventurer might leave behind, and then leave " ..
"quickly, probably to sell them elsewhere."

  local messager =
    timed_msg {
      initmsg = { "You hear coins being counted.",
                  "An interdimensional caravan has stopped on this level "
                  .. "and set up a bazaar. Hurry and find its entrance before "
                  .. "they move on!" },
      finalmsg = "You hear the last, dying notes of the bell.",
      verb = 'tolling',
      noisemaker = 'bell'
    }
  local blow = 200 + 30*(40 - you.absdepth()) + crawl.random2(200)
  local bhigh = blow + crawl.random2(blow) + 100
  if not crawl.one_chance_in(6) then
    local pdesc = 'flickering gateway to a bazaar'
    return timed_marker {
                  low=blow, high=bhigh, msg=messager,
                  disappear='The gate to the bazaar disappears!',
                  desc = pdesc, desc_long = desc_long, dst = 'bazaar',
                  floor = 'stone_arch'
              }
  else
    return one_way_stair { desc = 'gateway to a bazaar', desc_long = desc_long,
                           dst = 'bazaar', floor = 'stone_arch' }
  end
end

function bazaar_message(e)
  crawl.mpr("You enter an inter-dimensional bazaar!")
end

function bazaar_milestone(e)
  crawl.mark_milestone("br.enter", "entered a Bazaar.", true)
end

function random_bazaar_colour()
  local colours = {"blue", "red", "lightblue", "magenta", "green"}
  local ret = colours[crawl.random2(#colours) + 1]

  return ret
end

function fixup_bazaar()
  dgn.fixup_stairs("stone_arch", "exit_portal_vault")

  if (dgn.get_floor_colour() == "black") then
    dgn.change_floor_colour(random_bazaar_colour())
  end

  if (dgn.get_rock_colour() == "black") then
    dgn.change_rock_colour("yellow")
  end

  local default = {rock="wall_vault", floor="floor_vault", halo="halo_vault"}
  local tileset = {
    blue = {rock="wall_brick_gray", floor="floor_grass", halo="halo_grass"},
    red = {rock="wall_pebble_red", floor="floor_vault", halo="halo_vault"},
    lightblue = {rock="wall_hive", floor="floor_grass", halo="halo_grass2"},
    magenta = {rock="wall_stone_gray", floor="floor_dirt", halo="halo_dirt"},
    green = {rock="wall_stone_gray", floor="floor_grass", halo="halo_grass"},
  }

  local tile = tileset[dgn.get_floor_colour()]
  if (tile == nil) then
    tile = default
  end

  dgn.change_floor_tile(tile.floor)
  dgn.change_rock_tile(tile.rock)

  dgn.floor_halo("enter_shop", "yellow", tile.halo)
end

dgn.set_lt_callback("bazaar", "fixup_bazaar")
}}

default-depth: 10-27

###############################################################################
# Dummy entry

NAME:   bzr_entry_dummy
TAGS:   bzr_entry transparent trowel_portal allow_dup
MARKER: O = lua:bazaar_portal()
MAP
O
ENDMAP

###############################################################################
# A simple water entry.
NAME:    bzr_entry_001
TAGS:    bzr_entry no_pool_fixup allow_dup
SHUFFLE: wwl
MARKER:  O = lua:bazaar_portal()
MAP
 www
w.w.w
wwOww
w.w.w
 www
ENDMAP

###############################################################################
# Some coins to shop with.
NAME:   bzr_entry_002
TAGS:   bzr_entry allow_dup
SUBST:  $=$.
MARKER: O = lua:bazaar_portal()
MAP
xx.xx
x$$$x
.$O$.
x$$$x
xx.xx
ENDMAP

###############################################################################
# Many customers
NAME:    bzr_entry_003
TAGS:    bzr_entry allow_dup
MONS:    human, orc, goblin, kobold
SUBST:   . = .:150 1
SHUFFLE: 1234
MARKER:  O = lua:bazaar_portal()
MAP
 .....
.......
...O...
.......
 .....
ENDMAP

###############################################################################
# Safe
NAME:   bzr_entry_004
TAGS:   bzr_entry allow_dup
MARKER: O = lua:bazaar_portal()
MAP
 xxxxx
xx...xx
+..O..x
xx...xx
 xxxxx
ENDMAP

###############################################################################
# Safe 2
NAME:    bzr_entry_005
TAGS:    bzr_entry allow_dup
SHUFFLE: wwlW
MARKER:  O = lua:bazaar_portal()
MAP
 wwwww
wwwwwww
ww<O>ww
wwwwwww
 wwwww
ENDMAP

###############################################################################
# Portal along the road
NAME:    bzr_entry_006
TAGS:    bzr_entry allow_dup
ORIENT:  float
SHUFFLE: XU, TUV
SUBST:   X=.
MARKER:  O = lua:bazaar_portal()
MAP
   xxx
  xxOxx
xxx.X.xxx
.U.....U.
xxxxxxxxx
ENDMAP

#########################################
# Portal by the lakeside (jpeg)
NAME:    bzr_entry_007
TAGS:    bzr_entry allow_dup no_rotate
MONS:    plant
SHUFFLE: XY
SUBST:   a = W .
SUBST:   X : T 1
SUBST:   Y = .
MARKER:  O = lua:bazaar_portal()
MAP
     waWa.
   wwwWa.X.Y.
  wwwWO..Y.X.
wwwwwwaaaX.Y.
   wwwwwWa.
ENDMAP

#########################################
# Bazaar entry with statue (Lemuel)
NAME:   statue_bzr
TAGS:   bzr_entry
SUBST:  G = G111
MONS:   orange crystal statue / silver statue / ice statue
MARKER: O = lua:bazaar_portal()
MAP
 @
cGc
cOc
ccc
ENDMAP

#########################################
# Freezing bazaar (Lemuel)
NAME:   freezing_bzr
TAGS:   bzr_entry
MARKER: W = lua:fog_machine { cloud_type = "freezing vapour", \
             pow_min = 1, pow_max = 5, delay_min = 20, delay_max = 30, \
             size = 1, walk_dist = 3, spread_rate= 20 }
MARKER: O = lua:bazaar_portal()
MAP
  W
 www
WwOwW
 www
  W
ENDMAP

#########################################
# Bazaar in the mist (Lemuel)
NAME:   bzr_in_the_mist
TAGS:   bzr_entry
MARKER: O = lua:fog_machine { cloud_type= "thin mist", \
            pow_min = 6, pow_max = 12, delay_min = 15, delay_max = 35, \
            size = 2, walk_dist = 2, spread_rate= 35 }
MARKER: O = lua:bazaar_portal()
MAP
O
ENDMAP

#########################################
# Firewalk (Lemuel)
NAME:    bzr_firewalk
TAGS:    bzr_entry uniq_firewalk no_item_gen
SUBST:   $ : $ .
MARKER:  * = lua:fog_machine { cloud_type = "flame", \
             pow_min = 2, pow_max = 4, delay_min = 5, delay_max = 10, \
             size = 1, walk_dist = 0, spread_rate= 0 }
SUBST:   * = .
MARKER:  O = lua:bazaar_portal()
MAP
c.@.$.@.c
c.*...*.c
c...$...c
c.......c
c.*.$.*.c
c.......c
c...$...c
c.*...*.c
c...O...c
ccccccccc
ENDMAP

###############################################################################
# Bazaar layouts.
#
# "encompass" levels are recommended, and can be as small or large as you like.
# No monsters are pre-placed in bazaars, and monsters do not spawn in bazaars,
# but you can place monsters in your maps if you know what you're doing.
#
# Every encompass bazaar level must have at least one downstair, which will be
# replaced with an exit from the bazaar. It's a good idea to also provide an
# upstair, which will be converted into a stone arch (and on which the player
# will be placed when entering the bazaar). If there's no upstair, the player
# will arrive on a random square.
#
# You can force a particular colour for the rock walls or floor using
# LROCKCOL and LFLOORCOL directives.
#
# Maps are sorted by WEIGHTs: common (20), rare (5), very rare (1)

default-depth:

##########################################################################
# Common maps (weight 20)
##########################################################################

##########################################
# bazaar lakeside with goldfish (jpeg)
# 5 shops
NAME:    bazaar_lake
TAGS:    bazaar no_rotate
ORIENT:  encompass
WEIGHT:  20
MONS:    giant goldfish
SUBST:   a = W.
SHUFFLE: ABCDEF
SUBST:   A = Y
SHUFFLE: XY
SUBST:   X = <, Y = >
# high quality shops, pity they don't stay :p
KFEAT:   B = general shop
KFEAT:   C = wand shop / jewellery shop
KFEAT:   D = antique weapon shop
KFEAT:   E = antique armour shop
KFEAT:   F = scroll shop / distillery shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
# special cases for blue floor
: local colour = random_bazaar_colour()
: lfloorcol(colour)
: if colour == "blue" then
SUBST:   w = W
: end
#
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx.....X.....xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx.................xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxx.......................xxxxxxxxxxxxxx
xxxxxxxxxxx......T......F......T......xxxxxxxxxxxx
xxxxxxxxxx.............................xxxxxxxxxxx
xxxxxxxxx...............................xxxxxxxxxx
xxxxxxxx..............aaaaa..............xxxxxxxxx
xxxxxxxx.....E.......awwwwwaa......A.....xxxxxxxxx
xxxxxxx............aawwwwwwwww............xxxxxxxx
xxxxxxx...........awwwwwWwwwwa............xxxxxxxx
xxxxxxx..........awwwww1WWwwwa............xxxxxxxx
xxxxxxxY.T........awwwwwwWWwwwa........T.Yxxxxxxxx
xxxxxxx............awwwwwwwwaX............xxxxxxxx
xxxxxxx.............aawwwwwwwwa...........xxxxxxxx
xxxxxxx...............aaaaaaaa............xxxxxxxx
xxxxxxxx.....D.....................B.....xxxxxxxxx
xxxxxxxx.................................xxxxxxxxx
xxxxxxxxx...............................xxxxxxxxxx
xxxxxxxxxx.............................xxxxxxxxxxx
xxxxxxxxxxx......T......C......T......xxxxxxxxxxxx
xxxxxxxxxxxxx.......................xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx.................xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxx.....X.....xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

########################################
# bazaars in a row
# ~4 shops
NAME:    bazaar_short_row
TAGS:    bazaar no_rotate
ORIENT:  encompass
WEIGHT:  20
SHUFFLE: Aa/Bb/Cc/Dd/Ee/Ff
SHUFFLE: Aa/Zz, Bb/Yy, Cc/Rr, Dd/Ss
# two guaranteed shops, expected four shops
KFEAT:   A = any shop / antique weapon shop
KFEAT:   B = any shop / antique armour shop
KFEAT:   C = any shop / wand shop
KFEAT:   D = any shop / jewellery shop
KFEAT:   E = any shop / weapon shop / armour shop
KFEAT:   F = any shop / book shop / scroll shop
SUBST:   b=a, c=a, d=a, e=a, f=a, a=T
SUBST:   y=z, r=z, s=z, z=V, Y=Z, R=Z, S=Z
KFEAT:   Z = stone_arch
SHUFFLE: lw
# special cases for blue/red floor
: local colour = random_bazaar_colour()
: lfloorcol(colour)
: if colour == "red" then
SUBST: l = w
: else
: if colour == "blue" then
SUBST: w = l
: end
: end
#
SUBST:   w:wWx, l:lx
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxAxxxxxxxxxxxCxxxxxxxxxxxExxxxxxxxxxxxxxxx
xxx.....xxxxxxx...xxxxxxxxx...xxxxxxxxx...xxxxxxx.....xxx
xx..www..xxxxxx.a.xxxxxxxxx.c.xxxxxxxxx.e.xxxxxx..lll..xx
x<.wwwww..+...........+...........+...........+..lllll.>x
xx..www..xxxxxx.b.xxxxxxxxx.d.xxxxxxxxx.f.xxxxxx..lll..xx
xxx.....xxxxxxx...xxxxxxxxx...xxxxxxxxx...xxxxxxx.....xxx
xxxxxxxxxxxxxxxxBxxxxxxxxxxxDxxxxxxxxxxxFxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

########################################
# bazaars in a row v2
# ~4.5 shops
NAME:    bazaar_long_row
TAGS:    bazaar no_rotate
ORIENT:  encompass
WEIGHT:  20
SHUFFLE: Aa/Bb/Cc/Dd/Ee/Ff/Gg/Hh
SHUFFLE: Aa/Zz, Bb/Yy, Cc/Rr, Dd/Ss, Ee/Jj, Ff/Kk, Gg/Mm
# one guaranteed shop, expected 4.5 shops
SUBST:   B=A, C=A, D=A, E=A, F=A, G=A, H=A
SUBST:   b=a, c=a, d=a, e=a, f=a, g=a, h=a
SUBST:   Y=Z, R=Z, S=Z, J=Z, K=Z, M=Z
SUBST:   y=z, r=z, s=z, j=z, k=z, m=z
KFEAT:   A = any shop
KFEAT:   Z = stone_arch
SUBST:   a=T, z=V
SHUFFLE: lw
# special cases for blue/red floor
: local colour = random_bazaar_colour()
: lfloorcol(colour)
: if colour == "red" then
SUBST: l = w
: else
: if colour == "blue" then
SUBST: w = l
: end
: end
#
SUBST:   w:wWx, l:lx
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxAxxxxxxxxxxxCxxxxxxxxxxxExxxxxxxxxxxGxxxxxxxxxxxxxxxx
xxx.....xxxxxxx...xxxxxxxxx...xxxxxxxxx...xxxxxxxxx...xxxxxxx.....xxx
xx..www..xxxxxx.a.xxxxxxxxx.c.xxxxxxxxx.e.xxxxxxxxx.g.xxxxxx..lll..xx
x<.wwwww..+...........+...........+...........+...........+..lllll.>x
xx..www..xxxxxx.b.xxxxxxxxx.d.xxxxxxxxx.f.xxxxxxxxx.h.xxxxxx..lll..xx
xx......xxxxxxx...xxxxxxxxx...xxxxxxxxx...xxxxxxxxx...xxxxxxx.....xxx
xxxxxxxxxxxxxxxxBxxxxxxxxxxxDxxxxxxxxxxxFxxxxxxxxxxxHxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_circle_common
WEIGHT:  20
TAGS:    bazaar no_rotate
ORIENT:  encompass
KFEAT:   A = any shop / antique armour shop
KFEAT:   B = any shop / antique weapon shop
KFEAT:   C = any shop / jewellery shop
KFEAT:   D = any shop / book shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx..D..xxxxxxxxxxxxxxx
xxxxxxxxxx....+.....+....xxxxxxxxxx
xxxxxxx....xxxxx...xxxxx....xxxxxxx
xxxxxx..xxxxxxxxxxxxxxxxxxx..xxxxxx
xxxxx..xxxxxxxxxx>xxxxxxxxxx..xxxxx
xxxxx+xxxxxxxxxx...xxxxxxxxxx+xxxxx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xx.....xxxxxx.........xxxxxx.....xx
xx..A..xxxxxT....<....Txxxxx..B..xx
xx.....xxxxxx.........xxxxxx.....xx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xxxxx+xxxxxxxxxx...xxxxxxxxxx+xxxxx
xxxxx..xxxxxxxxxx+xxxxxxxxxx..xxxxx
xxxxxx..xxxxxxxxx+xxxxxxxxx..xxxxxx
xxxxxxx....xxxxx...xxxxx....xxxxxxx
xxxxxxxxxx....+.....+....xxxxxxxxxx
xxxxxxxxxxxxxxx..C..xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# 2 good shops or 3 shops
NAME:    jpeg_bazaar_cross
TAGS:    bazaar no_rotate
WEIGHT:  20
ORIENT:  encompass
SHUFFLE: ABCD
: if crawl.coinflip() then
SUBST:   A = <, B = >
KFEAT:   C = jewellery shop / wand shop
KFEAT:   D = antique armour shop / book shop
: else
SUBST:   T = <, A = >
KFEAT:   B = antique weapon shop
KFEAT:   C = antique armour shop
KFEAT:   D = general shop / distillery shop
:end
: if crawl.coinflip() then
SUBST:   ' = .
SUBST:   G : G.
: else
SUBST:   ' = x
SUBST:   G = .
:end
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxx...xxxxxxxxxxxxxx
xxxxxxxxxxxx.......xxxxxxxxxxxx
xxxxxxxxxxx....A....xxxxxxxxxxx
xxxxxxxxxxxx.......xxxxxxxxxxxx
xxxxxxxxxxxxxx...xxxxxxxxxxxxxx
xxxxxxxxxxxxxx...xxxxxxxxxxxxxx
xxxx...xxxxxxx...xxxxxxx...xxxx
xx......xxxx''.G.''xxxx......xx
x....B.......G.T.G.......D....x
xx......xxxx''.G.''xxxx......xx
xxxx...xxxxxxx...xxxxxxx...xxxx
xxxxxxxxxxxxxx...xxxxxxxxxxxxxx
xxxxxxxxxxxxxx...xxxxxxxxxxxxxx
xxxxxxxxxxxx.......xxxxxxxxxxxx
xxxxxxxxxxx....C....xxxxxxxxxxx
xxxxxxxxxxxx.......xxxxxxxxxxxx
xxxxxxxxxxxxxx...xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:      minmay_bazaar_generic_island
TAGS:      bazaar no_rotate
ORIENT:    encompass
WEIGHT:    20
SUBST:     w : wl
SHUFFLE:   Aa/Bb/Cc/Dd, Cc/Ee, Dd/Ff
COLOUR:    EeFf = yellow
SUBST:     ab = !, AB = ., cd = !, CD = ., EeFf = $
KFEAT:     ! = any shop
KFEAT:     ? = any shop / T
LFLOORCOL: blue
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxx
xxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxxx
xxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxx
xxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxx
xxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxx
xxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxx
xxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxx
xxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxx
xxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxx
xxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxx
xxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxx
xxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxx
xxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxx
xwwwwwwwwwwwwwwwwwwnnnnnnnnnwwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwnn.......nnwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwnn....!....nnwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwnn...........nnwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwnn..AAA...BBB..nnwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwn...AaA...BbB...nwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwn...AAA...BBB...nwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwn.............<.nwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwn.>.............nwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwn...CCC...DDD...nwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwn...CcC...DdD...nwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwnn..CCC...DDD..nnwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwnn...........nnwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwnn....!....nnwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwnn.......nnwwwwwwwwwwwwwwwwwx
xwwwwwwwwwwwwwwwwwwnnnnnnnnnwwwwwwwwwwwwwwwwwwx
xxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxx
xxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxx
xxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxx
xxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxx
xxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxx
xxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxx
xxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxx
xxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxx
xxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxx
xxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxx
xxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxx
xxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxxx
xxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxwwwwwwwwwwwwwwwwwxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    minmay_bazaar_row
TAGS:    bazaar no_rotate
ORIENT:  encompass
WEIGHT:  20
SHUFFLE: T? / AB
SUBST:   A = !, B = T
KFEAT:   ! = any shop
KFEAT:   ? = any shop / T
SUBST:   T : Tc
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
       xxxxx
       x...x
       x.<.x
    xxxx...xxxx
  xxx.........xxx
 xx......c......xx
 x...............x
xx..c.........c..xx
x.................x
x.T.?.!.?.?.!.?.T.x
x.................x
xx..c.........c..xx
 x...............x
 xx......c......xx
  xxx.........xxx
    xxxx...xxxx
       x.>.x
       x...x
       xxxxx
ENDMAP

NAME:   minmay_bazaar_cross
TAGS:   bazaar no_rotate
ORIENT: encompass
WEIGHT: 20
KFEAT:  ! = any shop
SUBST:  T = TU
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
        xxxxx
        x...x
        x.!.x
        x...x
xxxxxxxxx...xxxxxxxxx
x...x...........x...x
x.>.+.!...T...!.+.<.x
x...x...........x...x
xxxxxxxxx...xxxxxxxxx
        x...x
        x.!.x
        x...x
        xxxxx
ENDMAP

##########################################################################
# Rare maps (weights 5-10)
##########################################################################

# 4 random shops
NAME:   bazaar_general_marketplace
TAGS:   bazaar no_rotate
WEIGHT: 5
ORIENT: encompass
KFEAT:  A = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxx
xxxxxxx>xxxxxxx
xxxxxx...xxxxxx
xxxxx.....xxxxx
xxxx...A...xxxx
xxx.........xxx
xx...........xx
x<..A.....A..>x
xx...........xx
xxx.........xxx
xxxx...A...xxxx
xxxxx.....xxxxx
xxxxxx...xxxxxx
xxxxxxx>xxxxxxx
xxxxxxxxxxxxxxx
ENDMAP

# 3 weapon/armour shops, potentially antique
NAME:    bazaar_outfitter
TAGS:    bazaar
ORIENT:  encompass
WEIGHT:  5
KFEAT:   A = any shop
SHUFFLE: ABC, de
KFEAT:   A = weapon shop / armour shop
KFEAT:   B = antique weapon shop / weapon shop
KFEAT:   C = antique armour shop / armour shop
ITEM:    any weapon / w:2 good_item any weapon
ITEM:    any armour / w:2 good_item any armour
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxx
xxxx>xxxx
xx.....xx
x.......x
x.AdBeC.x
x.......x
xx.....xx
xxxx<xxxx
xxxxxxxxx
ENDMAP

# 4 random shops
NAME:    jpeg_bazaar_oval
TAGS:    bazaar no_rotate
WEIGHT:  5
ORIENT:  encompass
SUBST:   A = TVBG
KFEAT:   B = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxx
xxxB.....Bxxx
xx.........xx
x<....A....>x
xx.........xx
xxxB.....Bxxx
xxxxxxxxxxxxx
ENDMAP

# 2 shops, some items.
NAME:    bazaar_mystics
TAGS:    bazaar
WEIGHT:  5
ORIENT:  encompass
SUBST:   w : wlx
SHUFFLE: AB, def
KFEAT:   A = scroll shop / book shop / book shop
KFEAT:   B = jewellery shop
ITEM:    any jewellery / good_item any jewellery
ITEM:    any book / good_item any book, any staff
SUBST:   d=.d, e=.e, f=.f
# special cases for blue/red floor
: local colour = random_bazaar_colour()
: lfloorcol(colour)
: if colour == "red" then
SUBST: l = w
: else
: if colour == "blue" then
SUBST: w = l
: end
: end
#
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxwwwwwxxxxxx
xxxxxxxxxxwwww...wwwxxxx
xwwwwwwwwww....A...wwxxx
xw<......d+....e....+f>x
xwwwwwwwwww....B...wwxxx
xxxxxxxxxxwwww...wwwxxxx
xxxxxxxxxxxxxwwwwwxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# 2 wand shops, 2 jewellery shops
NAME:    dpeg_bazaar_wands
TAGS:    bazaar no_rotate
WEIGHT:  5
ORIENT:  encompass
KFEAT:   A = wand shop
KFEAT:   B = distillery shop
ITEM:    any wand, ring of levitation
SHUFFLE: leAB/wdBA
# special cases for blue/red floor
: local colour = random_bazaar_colour()
: lfloorcol(colour)
: if colour == "red" then
SUBST: l = w
: else
: if colour == "blue" then
SUBST: w = l
: end
: end
#
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx......>......xxxxxxxxxx
xxxx.........................xxxx
xx.....l.................l.....xx
xx......l...............l.......x
xl....A.ll.............ll.A....lx
xl......l...............l......lx
xll...........................llx
xllll.......................llllx
xlllllll.................lllllllx
xllllllllllll.......llllllllllllx
xlllllllllllllllllllllllllllllllx
x...lllllllllllllllllllllllll...x
x........lllllllllllllll........x
x............lllllll............x
x..............lll..............x
xxxxx.......................xxxxx
x...x.......................x...x
x.B.+.......................+.B.x
x...x..........<e>..........x...x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# 5 shops, total weight of jpeg's rare circle vaults is 5
NAME:    jpeg_bazaar_circle_rare_1
WEIGHT:  1
TAGS:    bazaar no_rotate
ORIENT:  encompass
SHUFFLE: ABCD, EFGH
SUBST:   H=>, A=T, B=T
KFEAT:   CDEFG = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
x.....xxxxxxxxxx...xxxxxxxxxx.....x
x..E..+.......+.....+.......+..H..x
x.....xxxxxxxxx..D..xxxxxxxxx.....x
xx...xxxxx....+.....+....xxxxx...xx
xxx+xxx....xxxxx...xxxxx....xxx+xxx
xxx.xx..xxxxxxxxx+xxxxxxxxx..xx.xxx
xxx.x..xxxxxxxxxx+xxxxxxxxxx..x.xxx
xxx+x+xxxxxxxxxx...xxxxxxxxxx+x+xxx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xx.....xxxxxx.........xxxxxx.....xx
xx..A..xxxxxT....<....Txxxxx..B..xx
xx.....xxxxxx.........xxxxxx.....xx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xxx+x+xxxxxxxxxx...xxxxxxxxxx+x+xxx
xxx.x..xxxxxxxxxx+xxxxxxxxxx..x.xxx
xxx.xx..xxxxxxxxx+xxxxxxxxx..xx.xxx
xxx+xxx....xxxxx...xxxxx....xxx+xxx
xx...xxxxx....+.....+....xxxxx...xx
x.....xxxxxxxxx..C..xxxxxxxxx.....x
x..G..+.......+.....+.......+..F..x
x.....xxxxxxxxxx...xxxxxxxxxx.....x
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_circle_rare_2
WEIGHT:  1
TAGS:    bazaar no_rotate
ORIENT:  encompass
SHUFFLE: EFGH
SUBST:   H=>, D=T, C=T
KFEAT:   ABEFG = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
x.....xxxxxxxxxx...xxxxxxxxxx.....x
x..H..xxxxxxxxx.....xxxxxxxxx..E..x
x.....xxxxxxxxx..D..xxxxxxxxx.....x
xx...xxxxx....+.....+....xxxxx...xx
xxx+xxx....xxxxx...xxxxx....xxx+xxx
xxx.xx..xxxxxxxxx+xxxxxxxxx..xx.xxx
xxx.x..xxxxxxxxxx+xxxxxxxxxx..x.xxx
xxx+x+xxxxxxxxxx...xxxxxxxxxx+x+xxx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xx.....xxxxxx.........xxxxxx.....xx
xx..A..xxxxxT....<....Txxxxx..B..xx
xx.....xxxxxx.........xxxxxx.....xx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xxx+x+xxxxxxxxxx...xxxxxxxxxx+x+xxx
xxx.x..xxxxxxxxxx+xxxxxxxxxx..x.xxx
xxx.xx..xxxxxxxxx+xxxxxxxxx..xx.xxx
xxx+xxx....xxxxx...xxxxx....xxx+xxx
xx...xxxxx....+.....+....xxxxx...xx
x.....xxxxxxxxx..C..xxxxxxxxx.....x
x..G..xxxxxxxxx.....xxxxxxxxx..F..x
x.....xxxxxxxxxx...xxxxxxxxxx.....x
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_circle_rare_3
WEIGHT:  1
TAGS:    bazaar no_rotate
ORIENT:  encompass
SHUFFLE: EFGH
SUBST:   A=>, D=T, C=T
KFEAT:   BHEFG = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
x.....xxxxxxxxxx...xxxxxxxxxx.....x
x..H..+.......+.....+.......+..E..x
x.....xxxxxxxxx..D..xxxxxxxxx.....x
xx...xxxxxxxxxx.....xxxxxxxxxx...xx
xxx+xxxxxxxxxxxx...xxxxxxxxxxxx+xxx
xxx.xxxxxxxxxxxxx+xxxxxxxxxxxxx.xxx
xxx.xxxxxxxxxxxxx+xxxxxxxxxxxxx.xxx
xxx+xxxxxxxxxxxx...xxxxxxxxxxxx+xxx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xx.....xxxxxx.........xxxxxx.....xx
xx..A..xxxxxT....<....Txxxxx..B..xx
xx.....xxxxxx.........xxxxxx.....xx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xxx+xxxxxxxxxxxx...xxxxxxxxxxxx+xxx
xxx.xxxxxxxxxxxxx+xxxxxxxxxxxxx.xxx
xxx.xxxxxxxxxxxxx+xxxxxxxxxxxxx.xxx
xxx+xxxxxxxxxxxx...xxxxxxxxxxxx+xxx
xx...xxxxxxxxxx.....xxxxxxxxxx...xx
x.....xxxxxxxxx..C..xxxxxxxxx.....x
x..G..+.......+.....+.......+..F..x
x.....xxxxxxxxxx...xxxxxxxxxx.....x
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_circle_rare_4
WEIGHT:  1
TAGS:    bazaar no_rotate
ORIENT:  encompass
SHUFFLE: ABCDEF
KFEAT:   ABCDE = any shop
SUBST:   F = T
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
x.....xxxxxxxxxx...xxxxxxxxxx.....x
x..C..+.......+.....xxxxxxxxx..T..x
x.....xxxxxxxxx..D..xxxxxxxxx.....x
xx...xxxxxxxxxx.....xxxxxxxxxx...xx
xxx+xxxxxx.xxxxx...xxxxxxxxxxxx+xxx
xxx.xxxxxxxxxxxxx+xxxxxxxxxxxxx.xxx
xxx.xxxxxxxxxxxxx+xxxxxxxxxxxxx.xxx
xxx+xxxxxxxxxxxx...xxxxxxxxxxxx+xxx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xx.....xxxxxx.........xxxxxx.....xx
xx..A..xxxxxT....<....Txxxxx..>..xx
xx.....xxxxxx.........xxxxxx.....xx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xxx+xxxxxxxxxxxx...xxxxxxxxxxxx+xxx
xxx.xxxxxxxxxxxxxTxxxxxxxxxxxxx.xxx
xxx.xxxxxxxxxxxxxxxxxxxxxxxxxxx.xxx
xxx+xxxxxx.xxxxx...xxxxxxxxxxxx+xxx
xx...xxxxxxxxxx.....xxxxxxxxxx...xx
x.....xxxxxxxxx..E..xxxxxxxxx.....x
x..T..+.......+.....+.......+..B..x
x.....xxxxxxxxxx...xxxxxxxxxx.....x
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_circle_rare_5
WEIGHT:  1
TAGS:    bazaar no_rotate
ORIENT:  encompass
KFEAT:   CDEFG = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
x.....xxxxxxxxxx...xxxxxxxxxx.....x
x..>..+.......+.....+.......+..E..x
x.....xxxxxxxxx..D..xxxxxxxxx.....x
xx...xxxxx....+.....+....xxxxx...xx
xxxxxxx....xxxxx...xxxxx....xxxxxxx
xxxxxx..xxxxxxxxxxxxxxxxxxx..xxxxxx
xxxxx..xxxxxxxxxxTxxxxxxxxxx..xxxxx
xxxxx+xxxxxxxxxx...xxxxxxxxxx+xxxxx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xx.....xxxxxx.........xxxxxx.....xx
xx..T..+....+....<....+....+..T..xx
xx.....xxxxxx.........xxxxxx.....xx
xxx...xxxxxxxx.......xxxxxxxx...xxx
xxx+x+xxxxxxxxxx...xxxxxxxxxx+x+xxx
xxx.x..xxxxxxxxxxTxxxxxxxxxx..x.xxx
xxx.xx..xxxxxxxxxxxxxxxxxxx..xx.xxx
xxx+xxx....xxxxx...xxxxx....xxx+xxx
xx...xxxxx....+.....+....xxxxx...xx
x.....xxxxxxxxx..C..xxxxxxxxx.....x
x..G..xxxxxxxxx.....xxxxxxxxx..F..x
x.....xxxxxxxxxx...xxxxxxxxxx.....x
xx...xxxxxxxxxxxxxxxxxxxxxxxxx...xx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# 4 shops
NAME:    jpeg_bazaar_honeycomb
TAGS:    bazaar no_rotate
ORIENT:  encompass
MONS:    plant
SHUFFLE: ABCDEF
SUBST:   A = >, B = >
SUBST:   . = .:1000 $
SUBST:   K = T:20 1 .:5
KFEAT:   C = any shop / distillery shop
KFEAT:   D = any shop / wand shop / food shop
KFEAT:   E = any shop / weapon shop / armour shop
KFEAT:   F = any shop / book shop / scroll shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxK.....Kxxxxxxxxxxxxxx
xxxxxxxxxxxxx.........xxxxxxxxxxxxx
xxxxxxxxxxxx.....B.....xxxxxxxxxxxx
xxxxxx....Kxx.........xxK....xxxxxx
xxxx........xx.......xx........xxxx
xxxK....A....xxxx+xxxx....C....Kxxx
xxxx........xxK.....Kxx........xxxx
xxxxx.....Kxx.........xxK....xxxxxx
xxxxxxx....+.....<.....+....xxxxxxx
xxxxx.....Kxx.........xxK....xxxxxx
xxxx........xxK.....Kxx........xxxx
xxxK....F....xxxx+xxxx....D....Kxxx
xxxx........xx.......xx........xxxx
xxxxxx....Kxx.........xxK....xxxxxx
xxxxxxxxxxxx.....E.....xxxxxxxxxxxx
xxxxxxxxxxxxx.........xxxxxxxxxxxxx
xxxxxxxxxxxxxxK.....Kxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# 4 shops
NAME:    jpeg_bazaar_ribbon
TAGS:    bazaar no_rotate
ORIENT:  encompass
SHUFFLE: zZ
SUBST:   z = ., Z = w
SHUFFLE: wl, ABCD
# special cases for blue/red floor
: local colour = random_bazaar_colour()
: lfloorcol(colour)
: if colour == "red" then
SUBST: l = w
: else
: if colour == "blue" then
SUBST: w = l
: end
: end
#
SHUFFLE: AX
SUBST:   X = <, A = >
SUBST:   B : T G
KFEAT:   C = any shop
KFEAT:   D = weapon shop / book shop / jewellery shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x.xxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx.x
x....xxxxxxxxxxxxxx...xxxxxxxxxxxxxx....x
x..A..xxxxxxxxxxx.......xxxxxxxxxxx..A..x
x......xxxxxxxxx....B....xxxxxxxxx......x
xx......xxxxxx.............xxxxxx......xx
xxx......xxxx.....wwZww.....xxxx......xxx
xxxx.............ww...ww.............xxxx
xxxxx......D.....w..X..z.....D......xxxxx
xxxx.............ww...ww.............xxxx
xxx......xxxx.....wwwww.....xxxx......xxx
xx......xxxxxx.............xxxxxx......xx
x......xxxxxxxxx....B....xxxxxxxxx......x
x..C..xxxxxxxxxxx.......xxxxxxxxxxx..C..x
x....xxxxxxxxxxxxxx...xxxxxxxxxxxxxx....x
x.xxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx.x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# 5 shops, total weight of jpeg's nineroom vaults is 5
NAME:    jpeg_bazaar_ninerooms_1
TAGS:    bazaar no_rotate
WEIGHT:  1
ORIENT:  encompass
SUBST:   k : . x
NSUBST:  A = 2=T:30 V / *:C
NSUBST:  B = 1:< / >
KFEAT:   C = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx....A....xxxxxxxxx.........x
x....A....+.........................+....A....x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx.........xxxxxxxxx.........x
x....A............+....B....xxxxxxxxx....A....x
x.........xxxxxxxxx.........xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x....B....+.........................+....A....x
x.........xxxxxxxxx....A....xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_ninerooms_2
TAGS:    bazaar no_rotate
WEIGHT:  1
ORIENT:  encompass
SUBST:   k : . x
NSUBST:  A = 2=T:30 V / *:C
NSUBST:  B = 1:< / >
KFEAT:   C = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x....B....xxxxxxxxx.........xxxxxxxxx....A....x
x.........xxxxxxxxx....A............+.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxx+xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx+xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxx.xxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx.........xxxxxxxxx.........x
x....A....xxxxxxxxx....B....xxxxxxxxx....A....x
x.........xxxxxxxxx.........xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........+............A............+.........x
x....A....xxxxxxxxx.........xxxxxxxxx....A....x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_ninerooms_3
TAGS:    bazaar no_rotate
WEIGHT:  1
ORIENT:  encompass
SUBST:   z = .:50 +
SUBST:   k : . x
NSUBST:  A = 1:< / 1=<TC / 2=T:30 V / *:C
NSUBST:  B = 1:> / 1=C>
KFEAT:   C = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx.........xxxxxxxxx.........x
x....A....z.......z....A....xxxxxxxxx....B....x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxzxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxxzxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx.........xxxxxxxxx.........x
x....A....z.......z....A....z.......z....A....x
x.........xxxxxxxxx.........xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxxxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxxxxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x....B....z.......z....A....z.......z....A....x
x.........xxxxxxxxx.........xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_ninerooms_4
TAGS:    bazaar no_rotate
WEIGHT:  1
ORIENT:  encompass
SUBST:   z = .:50 +
SUBST:   k : . x
NSUBST:  A = 1:< / 1=<TC / 2=T:30 V / *:C
NSUBST:  B = 1:> / 1=C>
KFEAT:   C = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx.........xxxxxxxxx.........x
x....A....z.......z....A....xxxxxxxxx....B....x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxzxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxxzxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx.........xxxxxxxxx.........x
x....A....z.......z....A....z.......z....A....x
x.........xxxxxxxxx.........xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxzxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxxzxxxxxxxxxxxxxxxxxzxxxxxxxxxxxxxxxxxzxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x....B....xxxxxxxxx....A....z.......z....A....x
x.........xxxxxxxxx.........xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_ninerooms_5
TAGS:    bazaar no_rotate
WEIGHT:  1
ORIENT:  encompass
SUBST:   k : . x
NSUBST:  A = 1:< / 1:> / 1:T C / 3=T:30 V / *:C
SUBST:   B = > C:20
KFEAT:   C = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x....A....xxxxxxxxx.........xxxxxxxxx....A....x
x......................A............+.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxx+xxxxxxxxxxxxxxxxx=xxxxxxxxxxxxxxxxx+xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxx=xxxxxxxxxxxxxxxxx.xxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........xxxxxxxxx.........xxxxxxxxx.........x
x....A....=.......=....B....xxxxxxxxx....A....x
x.........xxxxxxxxx.........xxxxxxxxx.........x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx
xxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxx
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
x.........+............A............+.........x
x....A....xxxxxxxxx.........xxxxxxxxx....A....x
xk.......kxxxxxxxxxk.......kxxxxxxxxxk.......kx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   minmay_bazaar_generic_box
TAGS:   bazaar no_rotate
WEIGHT: 5
ORIENT: encompass
KFEAT:  ! = any shop
KFEAT:  ? = any shop / T
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxx
x.......x
x.?.!.?.x
x.......x
x.<...>.x
x.......x
x.?.!.?.x
x.......x
xxxxxxxxx
ENDMAP

# This one's vertical edges look odd because
# it almost exceeds the maximum level size.
# Can't find a way to fix this without
# ruining the look of the vault.
NAME:      minmay_bazaar_generic_d
TAGS:      bazaar no_rotate
WEIGHT:    5
ORIENT:    encompass
LFLOORCOL: darkgrey
: if crawl.coinflip() then
SUBST:     "=l , '=. , A=l , B=!
: else
SUBST:     "=. , '=l , A=! , B=l
: end
KFEAT:     ! = jewellery shop / jewellery shop / wand shop / scroll shop / book shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
: set_border_fill_type("lava")
MAP
lllllllllllllllllllllllllllllllllllll
ll...lllllllllllllllll'''llllllllllll
l.....lllllllllllllll'''''lllllllllll
l..<...lllllllllllll'''B''lllllllllll
l.......lllllllllll'''''''lllllllllll
ll.......lllllllll'''''''llllllllllll
lll.......lllllll'''''''lllllllllllll
llll.......lllll'''''''llllllllllllll
lllll.......lll'''''''lllllllllllllll
llllll.......''''''''llllllllllllllll
lllllll.......''''''lllllllllllllllll
llllllll.......''''lllllllllllll"""ll
lllllllll.......''lllllllllllll"""""l
lllllllll".......'llllllllllll"""A""l
lllllllll"".......lllllllllll"""""""l
llllllll"""".......lllllllll"""""""ll
lllllll"""""".......lllllll"""""""lll
llllll"""""""".......lllll"""""""llll
lllll"""""""lll.......lll"""""""lllll
llll"""""""lllll.......""""""""llllll
lll"""""""lllllll.......""""""lllllll
ll"""""""lllllllll.......""""llllllll
l"""""""lllllllllll.......""lllllllll
l""A"""llllllllllll'......."lllllllll
l"""""lllllllllllll''.......lllllllll
ll"""lllllllllllll''''.......llllllll
lllllllllllllllll''''''.......lllllll
llllllllllllllll''''''''.......llllll
lllllllllllllll'''''''lll.......lllll
llllllllllllll'''''''lllll.......llll
lllllllllllll...''''lllllll.......lll
llllllllllll.....''lllllllll.......ll
lllllllllll.......lllllllllll.......l
lllllllllll...!...lllllllllll.......l
lllllllllll.......lllllllllll.......l
llllllllllll.....""lllllllll.......ll
lllllllllllll...""""lllllll.......lll
llllllllllllll"""""""lllll.......llll
lllllllllllllll"""""""lll.......lllll
llllllllllllllll"""""""".......llllll
lllllllllllllllll"""""".......lllllll
ll'''lllllllllllll"""".......llllllll
l'''''lllllllllllll"".......lllllllll
l''B'''llllllllllll".......'lllllllll
l'''''''lllllllllll.......''lllllllll
ll'''''''lllllllll.......''''llllllll
lll'''''''lllllll.......''''''lllllll
llll'''''''lllll.......''''''''llllll
lllll'''''''lll.......lll'''''''lllll
llllll''''''''.......lllll'''''''llll
lllllll''''''.......lllllll'''''''lll
llllllll''''.......lllllllll'''''''ll
lllllllll''.......lllllllllll'''''''l
lllllllll'......."llllllllllll'''B''l
lllllllll.......""lllllllllllll'''''l
llllllll.......""""lllllllllllll'''ll
lllllll.......""""""lllllllllllllllll
llllll.......""""""""llllllllllllllll
lllll.......lll"""""""lllllllllllllll
llll.......lllll"""""""llllllllllllll
lll.......lllllll"""""""lllllllllllll
ll.......lllllllll"""""""llllllllllll
l.......lllllllllll"""""""lllllllllll
l..>...lllllllllllll"""A""lllllllllll
l.....lllllllllllllll"""""lllllllllll
ll...lllllllllllllllll"""llllllllllll
lllllllllllllllllllllllllllllllllllll
ENDMAP

NAME:      minmay_bazaar_trees
TAGS:      bazaar no_rotate
WEIGHT:    5
ORIENT:    encompass
MONS:      bush
KFEAT:     ! = any shop
KFEAT:     ? = any shop / .
LFLOORCOL: green
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
ttttttttttttttt
ttttttttttttttt
tttttt.>.tttttt
tttt.......tttt
ttt.........ttt
ttt..11.11..ttt
tt...1!.!1...tt
tt.?.1...1.?.tt
tt...1!.!1...tt
ttt..11111..ttt
ttt.........ttt
tttt.......tttt
tttttt.<.tttttt
ttttttttttttttt
ttttttttttttttt
ENDMAP

NAME:   minmay_bazaar_armour_weapon
TAGS:   bazaar no_rotate
WEIGHT: 5
ORIENT: encompass
KFEAT:  A = antique weapon shop
KFEAT:  B = antique armour shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
      xxxxx
     xx...xx
     x.....x
     x..<..x
     x.....x
     xx...xx
      x...x
 xxxxxx...xxxxxx
xx...xx...xx...xx
x.....x...x.....x
x..A..+...+..A..x
x.....x...x.....x
xx...xx...xx...xx
 xxxxx.....xxxxx
     x.....x
 xxxxx.....xxxxx
xx...xx...xx...xx
x.....x...x.....x
x..B..+...+..B..x
x.....x...x.....x
xx...xx...xx...xx
 xxxxxx...xxxxxx
      x...x
     xx...xx
     x.....x
     x..>..x
     x.....x
     xx...xx
      xxxxx
ENDMAP

NAME:   minmay_bazaar_snake
TAGS:   bazaar no_rotate
WEIGHT: 5
ORIENT: encompass
KFEAT:  ! = food shop
KFEAT:  ? = any shop / T
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
 xxxxx         xxxxx         xxxxx
xx...xxxxxxxxxxx...xxxxxxxxxxx...xx
x.................................x
x..<.............?.............!..x
x.................................x
xx...xxxxxxxxxxx...xxxxxxxxxxx...xx
 xxxxx         xxxxx         x...x
                             x...x
                             x...x
                             x...x
                             x...x
                             x...x
                             x...x
                             x...x
 xxxxx         xxxxx         x...x
xx...xxxxxxxxxxx...xxxxxxxxxxx...xx
x.................................x
x..?.............!.............?..x
x.................................x
xx...xxxxxxxxxxx...xxxxxxxxxxx...xx
 x...x         xxxxx         xxxxx
 x...x
 x...x
 x...x
 x...x
 x...x
 x...x
 x...x
 x...x         xxxxx         xxxxx
xx...xxxxxxxxxxx...xxxxxxxxxxx...xx
x.................................x
x..!.............?.............>..x
x.................................x
xx...xxxxxxxxxxx...xxxxxxxxxxx...xx
 xxxxx         xxxxx         xxxxx
ENDMAP

NAME:      minmay_bazaar_plants
TAGS:      bazaar no_rotate
WEIGHT:    5
ORIENT:    encompass
MONS:      plant / bush w:5
KFEAT:     ! = any shop
LFLOORCOL: green
SUBST:     " = ....111t
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
""""""""""""""""""""""""""""""""">
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
"""""""""mmmmm""""""mmmmm"""""""""
"""""""""m...mm""""mm...m"""""""""
"""""""""m.!..mm""mm..!.m"""""""""
"""""""""m.....mmmm.....m"""""""""
"""""""""mm............mm"""""""""
""""""""""mm..........mm""""""""""
"""""""""""mm....cc..mm"""""""""""
""""""""""""m..cc>c..m""""""""""""
""""""""""""m..c<c...m""""""""""""
"""""""""""mm..ccc...mm"""""""""""
""""""""""mm..........mm""""""""""
"""""""""mm............mm"""""""""
"""""""""m.....mmmm.....m"""""""""
"""""""""m.!..mm""mm..!.m"""""""""
"""""""""m...mm""""mm...m"""""""""
"""""""""mmmmm""""""mmmmm"""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""
ENDMAP

##########################################################################
# Very rare maps, including dangerous maps (weight 1)
##########################################################################

# 4.4 shops
NAME:    jpeg_bazaar_triangles
TAGS:    bazaar no_rotate
ORIENT:  encompass
WEIGHT:  1
SHUFFLE: ACD
SUBST:   A = <
KFEAT:   B = any shop / antique armour shop / jewellery shop
SUBST:   C = >
SUBST:   D = T
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxAxxxC............+...xxxxxxxxx
xxxxxxxx...xxx...........xxx...xxxxxxxx
xxxxxxx.....xxx....B....xxx.....xxxxxxx
xxxxxx.......xxx.......xxx.......xxxxxx
xxxxx....B....xxx.....xxx....B....xxxxx
xxxx...........xxx...xxx...........xxxx
xxxA............+...xxxD...........Dxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_hexagon
TAGS:    bazaar no_rotate
ORIENT:  encompass
WEIGHT:  1
SHUFFLE: AC, BD
KFEAT:   A = armour shop / weapon shop / wand shop
KFEAT:   B = general shop / food shop
KFEAT:   C = scroll shop / book shop / distillery shop
SUBST:   D = >
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx.................===.xxxxxxxxx
xxxxxxxx.............A...xxx...xxxxxxxx
xxxxxxx.................xxx.....xxxxxxx
xxxxxx........<........xxx.......xxxxxx
xxxxx.................xxx....B....xxxxx
xxxx...A.............xxx...........xxxx
xxx.................xxx.............xxx
xxx+xxxxxxxxxxxxxxx+xxxxxxxxxxxxxxx+xxx
xxx+xxxxxxxxxxxxxxxx+xxxxxxxxxxxxxx+xxx
xxx.............===.................xxx
xxxx...........xxx.............C...xxxx
xxxxx....D....xxx.................xxxxx
xxxxxx.......xxx........>........xxxxxx
xxxxxxx.....xxx.................xxxxxxx
xxxxxxxx...xxx...C.............xxxxxxxx
xxxxxxxxx.xxx.................xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:    jpeg_bazaar_triangle_bulge
TAGS:    bazaar no_rotate
ORIENT:  encompass
WEIGHT:  1
SHUFFLE: ABC
SUBST:   A = <, B = >
KFEAT:   C = any shop
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxCxxxxxxxxxxxxxx
xxxxxxxxxxxx.....xxxxxxxxxxxx
xxxxxxxxxx.........xxxxxxxxxx
xxxxxxxx....B...B....xxxxxxxx
xxxxxx.................xxxxxx
xxxx....C.....B.....C....xxxx
xxA.......................Axx
xxxxxxxxxxxxx...xxxxxxxxxxxxx
xxxxxxxxxxxxx...xxxxxxxxxxxxx
xxxxxxxxxxxx.....xxxxxxxxxxxx
xxxxxxxxxxx...C...xxxxxxxxxxx
xxxxxxxxxxxx.....xxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# ~3.75 shops
NAME:     due_bazaar_butterfly
TAGS:     bazaar no_rotate
ORIENT:   encompass
WEIGHT:   1
SHUFFLE:  AEST
NSUBST:   A = 1:A / 1:B / 1:C / 1:D
SUBST:    E=>, S=T, T:TUV, D=ABC.
KFEAT:    A = armour shop / weapon shop / wand shop
KFEAT:    B = general shop / food shop
KFEAT:    C = scroll shop / book shop / distillery shop
SHUFFLE:  '"
SUBST:    '=+, "==
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xE..xxxxxxx...xx.......xx...xxxxxxx..Ex
xxx...xxxxx.T.''...A...''.T.xxxxx...xxx
xxxxx.+...+...xx.......xx...+...+.xxxxx
xxxxxxx...xxxxxxxxx+xxxxxxxxx...xxxxxxx
xxxxxxxxx.".xxxxxxx.xxxxxxx.".xxxxxxxxx
xxxxxxxxxxx....xxxx.xxxxx...xxxxxxxxxxx
x...xx.S.xxxxx.."xx+xx"...xxx.S.xx...xx
x...xx...xxxxxxxx.....xxxxxxx...xx...xx
x...xxx+xxxxxxxxx.....xxxxxxxx+xxx...xx
x.A.+...........+..<..+..........+.A.xx
x...xxx+xxxxxxxxx.....xxxxxxxx+xxx...xx
x...xx...xxxxxxxx.....xxxxxxx...xx...xx
x...xx.S.xxxx..."xx+xx"...xxx.S.xx...xx
xxxxxxxxxxx...xxxxx.xxxxx...xxxxxxxxxxx
xxxxxxxxx...xxxxxxx.xxxxxxx...xxxxxxxxx
xxxxxxx.".xxxxxxxxx+xxxxxxxxx.".xxxxxxx
xxxxx...xxx...xx.......xx...xxx...xxxxx
xxx.+.....+.T.''...A...''.T.+.....+.xxx
xE..xxxxxxx...xx.......xx...xxxxxxx..Ex
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

# You will either need to get through a rock wall (but there is a wand shop),
# or you will have to teleport into the room, possibly randomly. In that case,
# inner area=13*11=143, outer area=104 or 148, making chances for teleporation
# to land inside either 57% or 49%.
NAME:    minmay_bazaar_challenge
TAGS:    bazaar no_rotate
WEIGHT:  1
ORIENT:  encompass
: if crawl.coinflip() then
SUBST:   B=., N=., n=T, t=., '=., "=.
KFEAT:   ? = wand shop
: else
SUBST:   b=., m=., B=b, N=n, T=., t=T, ?=!, '=x, ":x.
:end
KFEAT:   ! = any shop
SUBST:   T = V T U:1
SHUFFLE: XY
SUBST:   X = T
NSUBST:  Y = 1:< / *:>
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxx'''...'''xxxxxxxx
xxxxxxx''''.X.''''xxxxxxx
xxxxxx'''''...'''''xxxxxx
xxxxx"""""".Y.""""""xxxxx
xxxx.................xxxx
xxx".BBBBBBNnNBBBBBB."xxx
xx'".B.............B."'xx
x''".B..bbbmmmbbb..B."''x
x''".B..b.......b..B."''x
x''".B..b.!...!.b..B."''x
x....N..m.......m..N....x
x..!.NTtm...>...mtTN.?..x
x....N..m.......m..N....x
x''".B..b.!...!.b..B."''x
x''".B..b.......b..B."''x
x''".B..bbbmmmbbb..B."''x
xx'".B.............B."'xx
xxx".BBBBBBNnNBBBBBB."xxx
xxxx.................xxxx
xxxxx"""""".Y.""""""xxxxx
xxxxxx'''''...'''''xxxxxx
xxxxxxx''''.X.''''xxxxxxx
xxxxxxxx'''...'''xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   minmay_bazaar_oklob
TAGS:   bazaar no_rotate
WEIGHT: 1
ORIENT: encompass
KFEAT:  ! = any shop
SUBST:  . = 2 .:200
SUBST:  ' = .
SUBST:  3 = 2.
MONS:   oklob plant, plant
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxx.!.....!.xxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxx'''xxx.........xxx'''xxx
xxx'<''+...........+''>'xxx
xxx'''xxx.........xxx'''xxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxx...222...xxxxxxxxx
xxxxxxxxx....1....xxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxx'''xxx.........xxx'''xxx
xxx'!''+3.........3+''!'xxx
xxx'''xxx.........xxx'''xxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxx.!..>..!.xxxxxxxxx
xxxxxxxxx.........xxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

NAME:   minmay_bazaar_mutagenic_fog
TAGS:   bazaar no_rotate
ORIENT: encompass
WEIGHT: 1
KFEAT:  ! = general shop
MARKER: d = lua:fog_machine { cloud_type = "mutagenic fog", \
             pow_min = 1, pow_max = 3, delay_min = 5, delay_max = 10, \
             size = 16, walk_dist = 0, spread_rate= 0 }
ITEM:   nothing
NSUBST: < = 1:< / *:.
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxxxxxx     xxxxxxxxx
x.......x     x.......x
x.>...!.x     x.!...>.x
x.......x     x.......x
x...<...x     x...<...x
x.......x     x.......x
x.!.....xxx xxx.....!.x
x.......x.xxx.x.......x
xxxxxxxx.x.x.x.xxxxxxxx
      x.xx...xx.x
      xx.......xx
       xx..*..xx
      xx.......xx
      x.xx...xx.x
xxxxxxxx.x.x.x.xxxxxxxx
x.......x.xxx.x.......x
x.!.....xxx xxx.....!.x
x.......x     x.......x
x...<...x     x...<...x
x.......x     x.......x
x.>...!.x     x.!...>.x
x.......x     x.......x
xxxxxxxxx     xxxxxxxxx
ENDMAP

# Perhaps we should announce the number of shops when entering the vault?
NAME:   minmay_bazaar_jumpy
TAGS:   bazaar no_rotate
ORIENT: encompass
WEIGHT: 1
KFEAT:  ! = distillery shop / scroll shop / general shop
KFEAT:  ~ = teleport trap
epilogue{{
bazaar_message(_G)
bazaar_milestone(_G)
}}
MAP
xxxxx
x...xxx
x.!..~x      xxx
x...xxx      x~x
xxxxx       xx.xx
      xxxxx x...x
    xxx...x x.!.x
    x~..!.x x...x
    xxx...x xxxxx xxxxx
      xxxxx       x...x
                  x.>.x
  xxxxx           x...x
  x...x   xxxxx   xx.xx
  x.<.x   x...xxx  x~x
  x...x   x.!..~x  xxx
  xx.xx   x...xxx
   x~x    xxxxx
   xxx
ENDMAP
