diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-30 14:56:53 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-11-30 14:56:53 +0000 |
commit | abed7b1bd147651f199a46ee774fbb452c846fd5 (patch) | |
tree | f7261ecefcff94bfc74e4579feeafc2d22208dbc /crawl-ref/source | |
parent | 8ed3bfab0f28d4257b3a262ea62f6c8d8d1cbadd (diff) | |
download | crawl-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')
-rw-r--r-- | crawl-ref/source/delay.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.h | 2 |
3 files changed, 15 insertions, 2 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; } diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index d51d133e38..f7f1cb0bb4 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1317,7 +1317,7 @@ void define_monster(int index) /* ------------------------- monam/moname ------------------------- */ -const char *ptr_monam( struct monsters *mon, char desc ) +const char *ptr_monam( const monsters *mon, char desc ) { // We give an item type description for mimics now, note that // since gold mimics only have one description (to match the diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index 358e07e1ed..2042b49c4a 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -133,7 +133,7 @@ void init_monsters( FixedVector<unsigned short, 1000>& colour ); const char *monam(int mons_num, int mons, bool vis, char desc, int mons_wpn = NON_ITEM); // these front for monam -const char *ptr_monam( struct monsters *mon, char desc ); +const char *ptr_monam( const monsters *mon, char desc ); // last updated 12may2000 {dlb} |