summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/delay.cc33
-rw-r--r--crawl-ref/source/mon-util.cc31
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;
}