summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-17 13:40:34 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-17 13:40:34 +0000
commit3ab3303612aa604874cc44addfcbf49257f8676b (patch)
tree901c606bb43de4f8e3310a78f43a65c068d3274c /crawl-ref/source
parent69d952a9818adf4f0d2b598b88e76f202994edbf (diff)
downloadcrawl-ref-3ab3303612aa604874cc44addfcbf49257f8676b.tar.gz
crawl-ref-3ab3303612aa604874cc44addfcbf49257f8676b.zip
Secret doors that have a transparent appearance are discovered opened, to prevent a LOS change when noticed.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3293 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/misc.cc11
-rw-r--r--crawl-ref/source/misc.h2
-rw-r--r--crawl-ref/source/spells4.cc3
3 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index e710a5ac3a..61d11eb2e4 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -285,7 +285,7 @@ void search_around( bool only_adjacent )
if (grd[srx][sry] == DNGN_SECRET_DOOR &&
random2(17) <= effective)
{
- grd[srx][sry] = DNGN_CLOSED_DOOR;
+ reveal_secret_door(srx, sry);
mpr("You found a secret door!");
exercise(SK_TRAPS_DOORS, ((coinflip()) ? 2 : 1));
}
@@ -1982,3 +1982,12 @@ int speed_to_duration(int speed)
return div_rand_round(100, speed);
}
+
+void reveal_secret_door(int x, int y)
+{
+ ASSERT(grd[x][y] == DNGN_SECRET_DOOR);
+
+ dungeon_feature_type door = grid_secret_door_appearance(x, y);
+ grd[x][y] = grid_is_opaque(door) ?
+ DNGN_CLOSED_DOOR : DNGN_OPEN_DOOR;
+}
diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h
index 092ab2eb61..bf590a5a71 100644
--- a/crawl-ref/source/misc.h
+++ b/crawl-ref/source/misc.h
@@ -124,4 +124,6 @@ bool scramble(void);
bool interrupt_cmd_repeat( activity_interrupt_type ai,
const activity_interrupt_data &at );
+void reveal_secret_door(int x, int y);
+
#endif
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index e31a81a837..02ffc88846 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -37,6 +37,7 @@
#include "invent.h"
#include "makeitem.h"
#include "message.h"
+#include "misc.h"
#include "monplace.h"
#include "monstuff.h"
#include "mon-util.h"
@@ -445,7 +446,7 @@ void cast_detect_secret_doors(int pow)
if (grd[x][y] == DNGN_SECRET_DOOR && random2(pow) > random2(15))
{
- grd[x][y] = DNGN_CLOSED_DOOR;
+ reveal_secret_door(x, y);
found++;
}
}