summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/clua.cc5
-rw-r--r--crawl-ref/source/dat/bazaar.des94
-rw-r--r--crawl-ref/source/dat/temple.des2
-rw-r--r--crawl-ref/source/direct.cc3
-rw-r--r--crawl-ref/source/dungeon.cc28
-rw-r--r--crawl-ref/source/dungeon.h1
-rw-r--r--crawl-ref/source/enum.h2
-rw-r--r--crawl-ref/source/travel.cc4
-rw-r--r--crawl-ref/source/view.cc6
9 files changed, 112 insertions, 33 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index c1a43d91ef..94856ee021 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -12,6 +12,7 @@
#include "cio.h"
#include "delay.h"
#include "dgnevent.h"
+#include "dungeon.h"
#include "files.h"
#include "food.h"
#include "invent.h"
@@ -737,6 +738,9 @@ LUAWRAP(you_stop_activity, interrupt_activity(AI_FORCE_INTERRUPT))
LUARET1(you_turns, number, you.num_turns)
LUARET1(you_see_grid, boolean,
see_grid(luaL_checkint(ls, 1), luaL_checkint(ls, 2)))
+// increase by 1 because check happens on old level
+LUARET1(bzr_floor_colour, string,
+ colour_to_str(bazaar_floor_colour(you.your_level + 2)))
void lua_push_floor_items(lua_State *ls);
static int you_floor_items(lua_State *ls)
@@ -816,6 +820,7 @@ static const struct luaL_reg you_lib[] =
{ "absdepth", you_absdepth },
{ "see_grid", you_see_grid },
+ { "bazaar_floor", bzr_floor_colour },
{ NULL, NULL },
};
diff --git a/crawl-ref/source/dat/bazaar.des b/crawl-ref/source/dat/bazaar.des
index a619ec2f7a..b21e519a60 100644
--- a/crawl-ref/source/dat/bazaar.des
+++ b/crawl-ref/source/dat/bazaar.des
@@ -240,12 +240,22 @@ ENDMAP
NAME: bazaar_mystics
TAGS: bazaar
ORIENT: encompass
-SHUFFLE: AB, def, wlb
+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
+: if you.bazaar_floor() == "red" then
+SUBST: l = w
+: else
+: if you.bazaar_floor() == "blue" then
+SUBST: w = l
+: end
+: end
+#
: bazaar_message(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxxxx
@@ -268,6 +278,15 @@ KFEAT: B = distillery shop
#ITEM: any wand, cursed ring of levitation
ITEM: any wand, ring of levitation
SHUFFLE: leAB/wdBA
+# special cases for blue/red floor
+: if you.bazaar_floor() == "red" then
+SUBST: l = w
+: else
+: if you.bazaar_floor() == "blue" then
+SUBST: w = l
+: end
+: end
+#
: bazaar_message(_G)
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -312,6 +331,15 @@ KFEAT: Y = stone_arch
KFEAT: R = stone_arch
KFEAT: S = stone_arch
SHUFFLE: lw
+# special cases for blue/red floor
+: if you.bazaar_floor() == "red" then
+SUBST: l : wWx
+: else
+: if you.bazaar_floor() == "blue" then
+SUBST: w : Wx
+: end
+: end
+#
SUBST: w:wWx, l:lx
: bazaar_message(_G)
MAP
@@ -626,6 +654,11 @@ KFEAT: D = antique weapon shop
KFEAT: E = antique armour shop
KFEAT: F = scroll shop / distillery shop
: bazaar_message(_G)
+# special case for floor
+: if you.bazaar_floor() == "blue" then
+SUBST: w = W
+: end
+#
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
@@ -633,31 +666,31 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-xxxxxxxxxxxxxxxxxxcccccccccccccxxxxxxxxxxxxxxxxxxx
-xxxxxxxxxxxxxxxcccc.....X.....ccccxxxxxxxxxxxxxxxx
-xxxxxxxxxxxxcccc.................ccccxxxxxxxxxxxxx
-xxxxxxxxxxccc.......................cccxxxxxxxxxxx
-xxxxxxxxxcc......T......F......T......ccxxxxxxxxxx
-xxxxxxxxcc.............................ccxxxxxxxxx
-xxxxxxxcc...............................ccxxxxxxxx
-xxxxxxxc..............aaaaa..............cxxxxxxxx
-xxxxxxcc.....E.......awwwwwaa......A.....ccxxxxxxx
-xxxxxxc............aawwwwwwwww............cxxxxxxx
-xxxxxxc...........awwwwwWwwwwa............cxxxxxxx
-xxxxxxc..........awwwww1WWwwwa............cxxxxxxx
-xxxxxxcY.T........awwwwwwWWwww.........T.Ycxxxxxxx
-xxxxxxc............awwwwwwwwaX............cxxxxxxx
-xxxxxxc.............aawwwwwwwwa...........cxxxxxxx
-xxxxxxc...............aaaaaaaa............cxxxxxxx
-xxxxxxcc.....D.....................B.....ccxxxxxxx
-xxxxxxcc.................................cxxxxxxxx
-xxxxxxxcc...............................ccxxxxxxxx
-xxxxxxxxcc.............................ccxxxxxxxxx
-xxxxxxxxxcc......T......C......T......ccxxxxxxxxxx
-xxxxxxxxxxccc.......................cccxxxxxxxxxxx
-xxxxxxxxxxxxcccc.................ccccxxxxxxxxxxxxx
-xxxxxxxxxxxxxxxcccc.....X.....ccccxxxxxxxxxxxxxxxx
-xxxxxxxxxxxxxxxxxxcccccccccccccxxxxxxxxxxxxxxxxxxx
+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
@@ -744,6 +777,15 @@ ORIENT: encompass
SHUFFLE: zZ
SUBST: z = ., Z = w
SHUFFLE: wl, ABCD
+# special cases for blue/red floor
+: if you.bazaar_floor() == "red" then
+SUBST: l = w
+: else
+: if you.bazaar_floor() == "blue" then
+SUBST: w = l
+: end
+: end
+#
SHUFFLE: AX
SUBST: X = <, A = >
SUBST: B : T G
diff --git a/crawl-ref/source/dat/temple.des b/crawl-ref/source/dat/temple.des
index 6a97ba5b85..7bc49db7a0 100644
--- a/crawl-ref/source/dat/temple.des
+++ b/crawl-ref/source/dat/temple.des
@@ -471,7 +471,7 @@ KFEAT: L = altar_kikubaaqudgha
KFEAT: M = altar_yredelemnul
KFEAT: N = altar_xom
KFEAT: O = altar_nemelex_xobeh
-SUBST: X : GUT
+KFEAT: X : G / U / T
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxx.......xxxxxxxxxxxxxxxxxxxx
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index 88da50188a..ac30c963af 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1225,6 +1225,7 @@ void describe_floor()
switch (grid)
{
case DNGN_FLOOR:
+ case DNGN_FLOOR_SPECIAL:
return;
case DNGN_ENTER_SHOP:
@@ -1371,6 +1372,7 @@ std::string raw_feature_description(dungeon_feature_type grid,
return ("Some shallow water");
case DNGN_UNDISCOVERED_TRAP:
case DNGN_FLOOR:
+ case DNGN_FLOOR_SPECIAL:
return ("Floor");
case DNGN_OPEN_DOOR:
return ("open door");
@@ -1883,6 +1885,7 @@ static void describe_cell(int mx, int my)
msg_channel_type channel = MSGCH_EXAMINE;
if (grd[mx][my] == DNGN_FLOOR
+ || grd[mx][my] == DNGN_FLOOR_SPECIAL
|| grd[mx][my] == DNGN_SHALLOW_WATER
|| grd[mx][my] == DNGN_DEEP_WATER)
{
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 2884492f3e..d52c6cdb24 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -816,6 +816,16 @@ static char fix_black_colour(char incol)
return incol;
}
+int bazaar_floor_colour(int curr_level)
+{
+ const char floorcolours_bzr[] =
+ { BLUE, RED, LIGHTBLUE, MAGENTA, GREEN };
+
+ // set colour according to current level
+ // randomization would reset between save/reload and after showing map
+ return (floorcolours_bzr[curr_level % 5]);
+}
+
void dgn_set_colours_from_monsters()
{
env.floor_colour = fix_black_colour(mcolour[env.mons_alloc[9]]);
@@ -840,12 +850,7 @@ void dgn_set_floor_colours()
env.rock_colour = YELLOW;
// bazaar floor is colourful
- const char floorcolours_bzr[] =
- { BLUE, RED, LIGHTGREEN, LIGHTBLUE, MAGENTA, GREEN };
-
- // set colour according to current level
- // randomization would reset between save/reload and after showing map
- env.floor_colour = floorcolours_bzr[player_branch_depth() % 6];
+ env.floor_colour = bazaar_floor_colour(you.your_level + 1);
}
else
{
@@ -1444,6 +1449,17 @@ static void fixup_bazaar_stairs()
DNGN_STONE_ARCH));
}
}
+
+ // colour floor squares around shops
+ if (feat == DNGN_ENTER_SHOP)
+ {
+ for (int i=-1; i<=1; i++)
+ for (int j=-1; j<=1; j++)
+ {
+ if (grd[x+i][y+j] == DNGN_FLOOR)
+ grd[x+i][y+j] = DNGN_FLOOR_SPECIAL;
+ }
+ }
}
}
}
diff --git a/crawl-ref/source/dungeon.h b/crawl-ref/source/dungeon.h
index 576e891965..f99b560c01 100644
--- a/crawl-ref/source/dungeon.h
+++ b/crawl-ref/source/dungeon.h
@@ -273,6 +273,7 @@ bool flood_find<fgrd, bound_check>::path_flood(
bool builder(int level_number, int level_type);
+int bazaar_floor_colour(int curr_level);
// Set floor/wall colour based on the mons_alloc array. Used for
// Abyss and Pan.
void dgn_set_colours_from_monsters();
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 0307aab695..d77dbcbbaa 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1034,6 +1034,8 @@ enum dungeon_feature_type
DNGN_WATER_STUCK,
DNGN_FLOOR, // 67
+ DNGN_FLOOR_SPECIAL, // currently only used for colouring bazaars
+ DNGN_FLOOR_RESERVED,
DNGN_EXIT_HELL, // 68
DNGN_ENTER_HELL, // 69
DNGN_OPEN_DOOR, // 70
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index a5f16a51d3..67e9d656b4 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -520,6 +520,7 @@ void initialise_travel()
{
// Need a better way to do this. :-(
traversable_terrain[DNGN_FLOOR] =
+ traversable_terrain[DNGN_FLOOR_SPECIAL] =
traversable_terrain[DNGN_ENTER_HELL] =
traversable_terrain[DNGN_OPEN_DOOR] =
traversable_terrain[DNGN_UNDISCOVERED_TRAP] =
@@ -3558,6 +3559,9 @@ static char base_grid_type( char grid )
if (grid == DNGN_UNDISCOVERED_TRAP)
return (DNGN_FLOOR);
+ if (grid == DNGN_FLOOR_SPECIAL)
+ return (DNGN_FLOOR);
+
// Or secret doors (which currently always look like rock walls):
if (grid == DNGN_SECRET_DOOR)
return (DNGN_ROCK_WALL);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index ad6f9641e3..e29439e195 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -3493,6 +3493,12 @@ void init_feature_table( void )
Feature[i].magic_symbol = Options.char_table[ DCHAR_FLOOR_MAGIC ];
break;
+ case DNGN_FLOOR_SPECIAL:
+ Feature[i].symbol = Options.char_table[ DCHAR_FLOOR ];
+ Feature[i].colour = YELLOW;
+ Feature[i].magic_symbol = Options.char_table[ DCHAR_FLOOR_MAGIC ];
+ break;
+
case DNGN_EXIT_HELL:
Feature[i].symbol = Options.char_table[ DCHAR_ARCH ];
Feature[i].colour = LIGHTRED;