summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-11 14:53:07 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-11 14:53:07 +0000
commit670cdde1fae7896c45aeaed440dcfd2d19470f3e (patch)
tree31f343462f675ec731990f3ff2f4db73f3b106b0 /crawl-ref/source/item_use.cc
parentebc2cb26f221bbce6a2cf5cbd3ce250af75e914f (diff)
downloadcrawl-ref-670cdde1fae7896c45aeaed440dcfd2d19470f3e.tar.gz
crawl-ref-670cdde1fae7896c45aeaed440dcfd2d19470f3e.zip
Describe monsters with halved MR.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7212 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index a63819553e..7ed6249e18 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4276,6 +4276,7 @@ static void _antimagic_scroll()
// First cast antimagic on yourself.
antimagic();
+ // List of magical enchantments which will be dispelled.
const enchant_type lost_enchantments[] = {
ENCH_SLOW,
ENCH_HASTE,
@@ -4291,18 +4292,20 @@ static void _antimagic_scroll()
mon_enchant lowered_mr(ENCH_LOWERED_MR, 1, KC_YOU, 40);
- // All nearby creatures lose all magical enchantments, and halve
- // their MR halved (if they're not magic-immune.)
+ // Go over all creatures in LOS.
for (radius_iterator ri(you.pos(), LOS_RADIUS); ri; ++ri)
{
const unsigned short targ_monst = env.mgrid(*ri);
if (targ_monst != NON_MONSTER)
{
+ // Dispel all magical enchantments.
monsters& mon = menv[targ_monst];
for (unsigned int i = 0; i < ARRAYSZ(lost_enchantments); ++i)
mon.del_ench(lost_enchantments[i], true, true);
- mon.add_ench(lowered_mr);
+ // If relevant, monsters have their MR halved.
+ if (!mons_immune_magic(&mon))
+ mon.add_ench(lowered_mr);
// Annoying but not enough to turn friendlies against you.
behaviour_event(&mon, ME_ANNOY, MHITYOU);