summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells4.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 12:51:04 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 12:51:04 +0000
commit56f8c2bfbc13fa45a7b0b7f3210e16e61227143f (patch)
tree21fc15eb6949022ec5c4032c04a6fe045690d6a2 /crawl-ref/source/spells4.cc
parentdb5b5c9c29fa2e7fd3fb668b01fa96b92cc8d84b (diff)
downloadcrawl-ref-56f8c2bfbc13fa45a7b0b7f3210e16e61227143f.tar.gz
crawl-ref-56f8c2bfbc13fa45a7b0b7f3210e16e61227143f.zip
Code cleanups again, fix Twist.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8379 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells4.cc')
-rw-r--r--crawl-ref/source/spells4.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 9c57589680..2fe715a0f1 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -2034,11 +2034,17 @@ bool cast_twist(int pow, const coord_def& where)
if (invalid_monster_index(mgrd(where)))
{
mpr("There is no monster there!");
- return (false);
+ // This counts as a real cast, in order not to leak invisible
+ // monster locations, and to allow victory-dancing.
+ return (true);
}
monsters& m = menv[mgrd(where)];
+ // Identify mimics, if necessary.
+ if (mons_is_mimic(m.type))
+ m.flags |= MF_KNOWN_MIMIC;
+
// Monster can magically save vs attack.
if (check_mons_resist_magic(&m, pow * 2))
{
@@ -2055,6 +2061,9 @@ bool cast_twist(int pow, const coord_def& where)
// Inflict the damage.
_player_hurt_monster(m, damage);
+ if (mons_is_mimic(m.type))
+ mimic_alert(&m);
+
return (true);
}