From abed7b1bd147651f199a46ee774fbb452c846fd5 Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 30 Nov 2006 14:56:53 +0000 Subject: 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 --- crawl-ref/source/delay.cc | 13 +++++++++++++ crawl-ref/source/mon-util.cc | 2 +- crawl-ref/source/mon-util.h | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source') 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(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(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& 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} -- cgit v1.2.3-54-g00ecf