diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-24 12:42:08 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-24 12:42:08 +0000 |
commit | c19b2fdd21ba70ded0b4f42a8c7d018108d2d70d (patch) | |
tree | 4b4c96386291048dbb254a73cf7a5d80c604b0e7 /crawl-ref/source/spells2.cc | |
parent | 873dd0bfae9f9f78b3e978edb574e4793af7b03f (diff) | |
download | crawl-ref-c19b2fdd21ba70ded0b4f42a8c7d018108d2d70d.tar.gz crawl-ref-c19b2fdd21ba70ded0b4f42a8c7d018108d2d70d.zip |
[1818799] Reduce message spam from Olgreb's toxic radiance.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2535 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r-- | crawl-ref/source/spells2.cc | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index a03676bdc2..b43476a608 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -834,6 +834,7 @@ void cast_toxic_radiance(void) poison_player(2); } + named_thing_collection affected_monsters; // determine which monsters are hit by the radiance: {dlb} for (int toxy = 0; toxy < MAX_MONSTERS; toxy++) { @@ -846,11 +847,14 @@ void cast_toxic_radiance(void) // this check should not be !monster->invisible(). if (!monster->has_ench(ENCH_INVIS)) { - poison_monster(monster, KC_YOU); + bool affected = + poison_monster(monster, KC_YOU, 1, false, false); - if (coinflip()) // 50-50 chance for a "double hit" {dlb} - poison_monster(monster, KC_YOU); + if (coinflip() && poison_monster(monster, KC_YOU, false, false)) + affected = true; + if (affected) + affected_monsters.add_thing(monster->name(DESC_PLAIN)); } else if (player_see_invis()) { @@ -860,7 +864,21 @@ void cast_toxic_radiance(void) } } } -} // end cast_toxic_radiance() + + if (!affected_monsters.empty()) + { + const std::string message = + make_stringf("%s %s poisoned.", + affected_monsters.describe(DESC_CAP_THE).c_str(), + affected_monsters.size() == 1? "is" : "are"); + if (static_cast<int>(message.length()) < get_number_of_cols() - 2) + mpr(message.c_str()); + else + // Exclamation mark to suggest that a lot of creatures were + // affected. + mpr("The monsters around you are poisoned!"); + } +} void cast_refrigeration(int pow) { |