summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/clua.cc1
-rw-r--r--crawl-ref/source/dat/bazaar.des2
-rw-r--r--crawl-ref/source/direct.cc4
-rw-r--r--crawl-ref/source/dungeon.cc24
4 files changed, 21 insertions, 10 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index d0535fd03b..d16c2bf31d 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -584,6 +584,7 @@ void CLua::init_lua()
luaopen_base(_state);
luaopen_string(_state);
luaopen_table(_state);
+ luaopen_math(_state);
// Open Crawl bindings
luaopen_kills(_state);
diff --git a/crawl-ref/source/dat/bazaar.des b/crawl-ref/source/dat/bazaar.des
index fe9c957c8a..618509f125 100644
--- a/crawl-ref/source/dat/bazaar.des
+++ b/crawl-ref/source/dat/bazaar.des
@@ -10,7 +10,7 @@
lua {{
function check_expire_marker(e)
if not crawl.one_chance_in(3) then
- e.marker("O = timer: 1000")
+ e.marker("O = timer: 1000-1500")
end
end
}}
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index eaee6f37ea..21ffebe163 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -1334,9 +1334,9 @@ std::string raw_feature_description(dungeon_feature_type grid,
return ("labyrinth entrance");
case DNGN_ENTER_BAZAAR:
if (temporary)
- return ("gently fading gateway to a fabulous bazaar");
+ return ("gently fading gateway to a bazaar");
else
- return ("gateway to a fabulous bazaar");
+ return ("gateway to a bazaar");
case DNGN_EXIT_BAZAAR:
return ("exit from the bazaar");
case DNGN_ENTER_DIS:
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index b1e8ca5301..7919634957 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -301,7 +301,7 @@ static inline bool dgn_grid_is_passable(dungeon_feature_type grid)
static inline bool dgn_square_is_passable(const coord_def &c)
{
- return ((dgn_map_mask(c) & MMT_OPAQUE) && dgn_grid_is_passable(grd(c)));
+ return (!(dgn_map_mask(c) & MMT_OPAQUE) && dgn_grid_is_passable(grd(c)));
}
static inline void dgn_point_record_stub(const coord_def &) { }
@@ -489,6 +489,7 @@ static void reset_level()
minivault_chance = 3;
use_random_maps = true;
dgn_check_connectivity = false;
+ dgn_zones = 0;
// blank level with DNGN_ROCK_WALL
make_box(0, 0, GXM - 1, GYM - 1, DNGN_ROCK_WALL, DNGN_ROCK_WALL);
@@ -1699,10 +1700,6 @@ static void builder_extras( int level_number, int level_type )
place_specific_stair(DNGN_ENTER_LABYRINTH, "lab_entry",
level_number, true);
- if (one_chance_in(20))
- place_specific_stair(DNGN_ENTER_BAZAAR, "bzr_entry",
- level_number, true);
-
if (level_number > 6 && one_chance_in(10))
{
many_pools( level_number < 11 || coinflip() ?
@@ -4396,6 +4393,8 @@ static void place_shops(int level_number, int nshops)
unsigned char shop_place_x = 0;
unsigned char shop_place_y = 0;
+ bool allow_bazaars = false;
+
temp_rand = random2(125);
if (!nshops)
@@ -4410,6 +4409,7 @@ static void place_shops(int level_number, int nshops)
if (nshops == 0 || level_number < 3)
return;
#endif
+ allow_bazaars = true;
}
for (int i = 0; i < nshops; i++)
@@ -4423,12 +4423,22 @@ static void place_shops(int level_number, int nshops)
timeout++;
- if (timeout > 20000)
+ if (timeout > 10000)
return;
}
while (grd[shop_place_x][shop_place_y] != DNGN_FLOOR);
- place_spec_shop(level_number, shop_place_x, shop_place_y, SHOP_RANDOM);
+ if (allow_bazaars && level_number > 9 && level_number < 27
+ && one_chance_in(30 - level_number))
+ {
+ place_specific_stair(DNGN_ENTER_BAZAAR, "bzr_entry",
+ level_number, true);
+ }
+ else
+ {
+ place_spec_shop(level_number,
+ shop_place_x, shop_place_y, SHOP_RANDOM);
+ }
}
} // end place_shops()