summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-03 06:54:53 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-03 06:54:53 +0000
commit38e77f4ea4395ed90f12e880224e5bd378113602 (patch)
tree87a0ca74f0fc77d59a32fd1317f739cf9ddb1530 /crawl-ref/source/dungeon.cc
parentcca6195c042a64fed711dba3ea0d94bc78b410df (diff)
downloadcrawl-ref-38e77f4ea4395ed90f12e880224e5bd378113602.tar.gz
crawl-ref-38e77f4ea4395ed90f12e880224e5bd378113602.zip
Items can now fall through shaft traps (trap doors). The code is rather
simplistic, and it's not currently possible to make a "baited" shaft; also, there is no threshold weight, so even a single dart will open up (and thus reveal) a shaft trap. Breaks savefile compatibility. Monsters which fall through a shaft now show up 100% of the time on the player's next visit to the shaft's destination level. Also, the monster is placed close to the spot where the player would end up if s/he went through the same shaft. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2988 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 8b0df8335c..f90c49cb35 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -7343,11 +7343,11 @@ inline static bool dgn_square_travel_ok(const coord_def &c)
}
// Fill travel_point_distance out from all stone stairs on the level.
-static coord_def dgn_find_closest_to_stone_stairs()
+static coord_def dgn_find_closest_to_stone_stairs(coord_def base_pos)
{
memset(travel_point_distance, 0, sizeof(travel_distance_grid_t));
init_travel_terrain_check(false);
- nearest_point np(you.pos());
+ nearest_point np(base_pos);
for (int y = 0; y < GYM; ++y)
for (int x = 0; x < GXM; ++x)
if (!travel_point_distance[x][y] && grid_is_stone_stair(grd[x][y]))
@@ -7377,7 +7377,7 @@ static coord_def dgn_find_labyrinth_entry_point()
}
coord_def dgn_find_nearby_stair(dungeon_feature_type stair_to_find,
- bool find_closest)
+ coord_def base_pos, bool find_closest)
{
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
@@ -7390,7 +7390,7 @@ coord_def dgn_find_nearby_stair(dungeon_feature_type stair_to_find,
if (stair_to_find == DNGN_ROCK_STAIRS_UP
|| stair_to_find == DNGN_ROCK_STAIRS_DOWN)
{
- const coord_def pos(dgn_find_closest_to_stone_stairs());
+ const coord_def pos(dgn_find_closest_to_stone_stairs(base_pos));
if (in_bounds(pos))
return (pos);
}
@@ -7423,8 +7423,8 @@ coord_def dgn_find_nearby_stair(dungeon_feature_type stair_to_find,
}
// scan around the player's position first
- int basex = you.x_pos;
- int basey = you.y_pos;
+ int basex = base_pos.x;
+ int basey = base_pos.y;
// check for illegal starting point
if ( !in_bounds(basex, basey) )