summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/transform.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-04-20 12:26:33 +0100
committerChris Campbell <chriscampbell89@gmail.com>2014-04-20 12:31:24 +0100
commit0bb430c4f6b3bdd2197d93bc43e6dfd465788ef3 (patch)
tree2e2a2c9c1d1528316d2ffd71f224d804c5289b0d /crawl-ref/source/transform.cc
parentfa5bd047d98c0510830ecc7d49133d00c64f5334 (diff)
downloadcrawl-ref-0bb430c4f6b3bdd2197d93bc43e6dfd465788ef3.tar.gz
crawl-ref-0bb430c4f6b3bdd2197d93bc43e6dfd465788ef3.zip
Allow entering tree form while in poison/meph clouds, add messaging
Diffstat (limited to 'crawl-ref/source/transform.cc')
-rw-r--r--crawl-ref/source/transform.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc
index 6b1173a25d..15af5a26e2 100644
--- a/crawl-ref/source/transform.cc
+++ b/crawl-ref/source/transform.cc
@@ -689,9 +689,20 @@ static bool _transformation_is_safe(transformation_type which_trans,
{
if (which_trans == TRAN_TREE)
{
- const int cloud = env.cgrid(you.pos());
- if (cloud != EMPTY_CLOUD && is_damaging_cloud(env.cloud[cloud].type, false))
+ const cloud_type cloud = cloud_type_at(you.pos());
+ if (cloud != CLOUD_NONE
+ // Tree form is immune to these two.
+ && cloud != CLOUD_MEPHITIC
+ && cloud != CLOUD_POISON
+ && is_damaging_cloud(cloud, false))
+ {
+ if (!quiet)
+ {
+ mprf("You can't transform into a tree while standing in a cloud of %s.",
+ cloud_type_name(cloud).c_str());
+ }
return false;
+ }
}
#if TAG_MAJOR_VERSION == 34