From 3ab3303612aa604874cc44addfcbf49257f8676b Mon Sep 17 00:00:00 2001 From: ennewalker Date: Thu, 17 Jan 2008 13:40:34 +0000 Subject: 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 --- crawl-ref/source/misc.cc | 11 ++++++++++- crawl-ref/source/misc.h | 2 ++ crawl-ref/source/spells4.cc | 3 ++- 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++; } } -- cgit v1.2.3-54-g00ecf