From 670cdde1fae7896c45aeaed440dcfd2d19470f3e Mon Sep 17 00:00:00 2001 From: haranp Date: Sat, 11 Oct 2008 14:53:07 +0000 Subject: Describe monsters with halved MR. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7212 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/item_use.cc') 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); -- cgit v1.2.3-54-g00ecf