diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-13 05:58:53 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-13 05:58:53 +0000 |
commit | 60bb14c1852e8c3e25a23c4feb7bd9c5a277e36b (patch) | |
tree | 5e0a94205db9721aef62f5d45453524995774aff | |
parent | a3ba5a8ee29de19bb37c6718f56f5f184d58be6a (diff) | |
download | crawl-ref-60bb14c1852e8c3e25a23c4feb7bd9c5a277e36b.tar.gz crawl-ref-60bb14c1852e8c3e25a23c4feb7bd9c5a277e36b.zip |
Fix giving an interruption message when a monster ignored with the
runrest_ignore_monster option gets too close. Also give a more
informative interruption message when an air elemental quits being
"submerged" in the air, and give a new message when it first
"submerges" itself into the air.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2451 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/delay.cc | 33 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 31 |
2 files changed, 52 insertions, 12 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 55cfa4931e..bfbfd9d747 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1071,7 +1071,7 @@ inline static void monster_warning(activity_interrupt_type ai, if (!mon->visible()) return; #ifndef DEBUG_DIAGNOSTICS - if (at.context == "newly seen") + if (at.context == "already seen") { // Only say "comes into view" if the monster wasn't in view // during the previous turn. @@ -1099,18 +1099,29 @@ inline static void monster_warning(activity_interrupt_type ai, break; } } - else + } + else + { + const std::string mweap = + get_monster_desc(mon, false, DESC_NONE); + std::string text = mon->name(DESC_CAP_A); + + if (at.context == "thin air") { - const std::string mweap = - get_monster_desc(mon, false, DESC_NONE); - std::string text = mon->name(DESC_CAP_A) + " comes into view."; - if (!mweap.empty()) - text += " " + mon->pronoun(PRONOUN_CAP) - + " is" + mweap + "."; - print_formatted_paragraph(text, - get_number_of_cols(), - MSGCH_WARN); + if (mon->type == MONS_AIR_ELEMENTAL) + text += " forms itself from the air."; + else + text += " appears from thin air."; } + else + text += " comes into view."; + + if (!mweap.empty()) + text += " " + mon->pronoun(PRONOUN_CAP) + + " is" + mweap + "."; + print_formatted_paragraph(text, + get_number_of_cols(), + MSGCH_WARN); } if (Options.tutorial_left) diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 6d28f94c0b..418e97357b 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3879,7 +3879,7 @@ bool monsters::add_ench(const mon_enchant &ench) return (true); } -void monsters::add_enchantment_effect(const mon_enchant &ench, bool) +void monsters::add_enchantment_effect(const mon_enchant &ench, bool quiet) { // check for slow/haste switch (ench.ench) @@ -3903,6 +3903,12 @@ void monsters::add_enchantment_effect(const mon_enchant &ench, bool) speed /= 2; break; + case ENCH_SUBMERGED: + if (type == MONS_AIR_ELEMENTAL && mons_near(this) && !quiet) + mprf("%s merges itself into the air.", + name(DESC_CAP_A, true).c_str() ); + break; + default: break; } @@ -4042,6 +4048,29 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet) monster_die( this, quiet? KILL_DISMISSED : KILL_RESET, 0 ); break; + case ENCH_SUBMERGED: + if (type == MONS_AIR_ELEMENTAL) + { + if (mons_near(this)) + { + if (!mons_is_safe( static_cast<const monsters*>(this))) + { + activity_interrupt_data aid(this); + aid.context = "thin air"; + interrupt_activity( AI_SEE_MONSTER, aid ); + } + else if (!quiet) + mprf("%s forms itself from the air!", + name(DESC_CAP_A, true).c_str() ); + + seen_monster( this ); + + // Monster was viewed this turn + flags |= MF_WAS_IN_VIEW; + } + } + break; + default: break; } |