summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-14 05:20:15 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-14 05:20:15 +0000
commita80ff6341075008c60dfd2efc6a43dd65ba90903 (patch)
tree2aaf2d11a535130d1d638192b7c23547463cbe71 /crawl-ref/source/monstuff.cc
parentb50185bac38de855ff1423242390d338ee35045f (diff)
downloadcrawl-ref-a80ff6341075008c60dfd2efc6a43dd65ba90903.tar.gz
crawl-ref-a80ff6341075008c60dfd2efc6a43dd65ba90903.zip
Give a message and interrupt activity if a visible door is opened or
eaten by an unseen monster (either invisible or out of line of sight). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2457 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc29
1 files changed, 28 insertions, 1 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 15efbd4177..a6eda2d160 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -4777,10 +4777,26 @@ static bool is_trap_safe(const monsters *monster, const trap_struct &trap)
static void mons_open_door(monsters* monster, const coord_def &pos)
{
- if (grd(pos) == DNGN_SECRET_DOOR && !see_grid(pos))
+ bool was_secret = (grd(pos) == DNGN_SECRET_DOOR);
+
+ if (was_secret && !see_grid(pos))
set_terrain_changed(pos);
grd(pos) = DNGN_OPEN_DOOR;
+ if (see_grid(pos))
+ {
+ viewwindow(true, false);
+
+ if (was_secret)
+ mpr("The rock wall was actually a secret door!");
+
+ if (!you.can_see(monster))
+ {
+ mpr("Something unseen opens the door.");
+ interrupt_activity(AI_FORCE_INTERRUPT);
+ }
+ }
+
monsterentry *entry = get_monster_data(monster->type);
monster->speed_increment -= entry->energy_usage.move;
}
@@ -5090,6 +5106,17 @@ static bool monster_move(monsters *monster)
grd[monster->x + mmov_x][monster->y + mmov_y] = DNGN_FLOOR;
jelly_grows(monster);
+
+ if (see_grid(monster->x + mmov_x, monster->y + mmov_y))
+ {
+ viewwindow(true, false);
+
+ if (!you.can_see(monster))
+ {
+ mpr("The door mysteriously vanishes.");
+ interrupt_activity( AI_FORCE_INTERRUPT );
+ }
+ }
} // done door-eating jellies