summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-10 18:25:20 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-10 18:26:31 -0800
commit53c9ff1a2e5697add5f6597a0725613fa9102e4b (patch)
tree36a18696e53e6f6cbddc53de950443d5d60e88d2 /crawl-ref/source/beam.cc
parent25c10a292966c693fbf6c9893eb8219d3a1e16e2 (diff)
downloadcrawl-ref-53c9ff1a2e5697add5f6597a0725613fa9102e4b.tar.gz
crawl-ref-53c9ff1a2e5697add5f6597a0725613fa9102e4b.zip
beam.cc: seeing clouds polymorphed
Seeing a cloud changed by a polymorph beam will give a message (with a different message for one you're standing in), and will also make the effect of the beam obvious.
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc23
1 files changed, 22 insertions, 1 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 2942a600d8..8a10cc4531 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3174,7 +3174,28 @@ void bolt::affect_place_clouds()
cloud_type& ctype = env.cloud[cloudidx].type;
// Polymorph randomly changes clouds in its path
if (flavour == BEAM_POLYMORPH)
- ctype = static_cast<cloud_type>(1 + random2(8));
+ {
+ cloud_type new_type = static_cast<cloud_type>(1 + random2(8));
+
+ if (new_type == ctype)
+ return;
+
+ if (p == you.pos())
+ {
+ mprf("The %s you are in turns into %s!",
+ cloud_name(ctype).c_str(), cloud_name(new_type).c_str());
+ obvious_effect = true;
+ }
+ else if (you.see_cell(p))
+ {
+ mprf("A cloud of %s turns into %s.",
+ cloud_name(ctype).c_str(), cloud_name(new_type).c_str());
+ obvious_effect = true;
+ }
+
+ ctype = new_type;
+ return;
+ }
// fire cancelling cold & vice versa
if ((ctype == CLOUD_COLD