summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-damage.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-06-03 19:32:28 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-06-03 19:32:28 -0700
commit57d1d0782b1d0e25384020a206cfe6b8b1e0471c (patch)
tree092af48ef3d9971a86a7be73b55a29e1c3515d94 /crawl-ref/source/spl-damage.cc
parentaec7b7d1218888efe06fb2c18bb9cefc34ac673e (diff)
downloadcrawl-ref-57d1d0782b1d0e25384020a206cfe6b8b1e0471c.tar.gz
crawl-ref-57d1d0782b1d0e25384020a206cfe6b8b1e0471c.zip
Make wisp form immune to shatter
Diffstat (limited to 'crawl-ref/source/spl-damage.cc')
-rw-r--r--crawl-ref/source/spl-damage.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/spl-damage.cc b/crawl-ref/source/spl-damage.cc
index e275367ce4..83d8f8c6cb 100644
--- a/crawl-ref/source/spl-damage.cc
+++ b/crawl-ref/source/spl-damage.cc
@@ -1239,10 +1239,16 @@ static int _shatter_walls(coord_def where, int pow, actor *agent)
return 0;
}
+/**
+ * Is this a valid target for shatter?
+ *
+ * @param act The actor being considered
+ * @return Whether the actor will take damage from shatter.
+ */
static bool _shatterable(const actor *act)
{
if (act->is_player())
- return true; // no player ghostlies... at least user-controllable ones
+ return !you.is_insubstantial();
return _shatter_mon_dice(act->as_monster());
}
@@ -1287,7 +1293,9 @@ spret_type cast_shatter(int pow, bool fail)
static int _shatter_player_dice()
{
- if (you.petrified())
+ if (you.is_insubstantial())
+ return 0;
+ else if (you.petrified())
return 12; // reduced later
else if (you.petrifying())
return 6; // reduced later