summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/delay.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-11-30 14:56:53 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2006-11-30 14:56:53 +0000
commitabed7b1bd147651f199a46ee774fbb452c846fd5 (patch)
treef7261ecefcff94bfc74e4579feeafc2d22208dbc /crawl-ref/source/delay.cc
parent8ed3bfab0f28d4257b3a262ea62f6c8d8d1cbadd (diff)
downloadcrawl-ref-abed7b1bd147651f199a46ee774fbb452c846fd5.tar.gz
crawl-ref-abed7b1bd147651f199a46ee774fbb452c846fd5.zip
Implemented 1591922: monsters coming into view while traveling
trigger a message explaining why travel stopped (on MSGCH_WARN.) Only the base description of the monster is printed, no equipment or such. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@533 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r--crawl-ref/source/delay.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index d939d6890d..e473eb685f 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -29,6 +29,7 @@
#include "message.h"
#include "misc.h"
#include "monstuff.h"
+#include "mon-util.h"
#include "mstuff2.h"
#include "ouch.h"
#include "output.h"
@@ -883,6 +884,12 @@ void interrupt_activity( activity_interrupt_type ai,
if (should_stop_activity(item, ai, at))
{
+ if ( ai == AI_SEE_MONSTER && is_run_delay(item.type) )
+ {
+ const monsters* mon = static_cast<const monsters*>(at.data);
+ mprf(MSGCH_WARN, "%s comes into view.",
+ ptr_monam(mon, DESC_CAP_A));
+ }
stop_delay();
return;
}
@@ -902,6 +909,12 @@ void interrupt_activity( activity_interrupt_type ai,
{
if (is_run_delay( you.delay_queue[j].type ))
{
+ if ( ai == AI_SEE_MONSTER )
+ {
+ const monsters* mon = static_cast<const monsters*>(at.data);
+ mprf(MSGCH_WARN, "%s comes into view.",
+ ptr_monam(mon, DESC_CAP_A));
+ }
stop_delay();
return;
}