diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-28 16:56:12 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-12-28 16:56:12 +0000 |
commit | 895860a717e48c8978fe63882ed9d616e7affa5a (patch) | |
tree | f8036d689a2c24cedca986ad478a6a65d4f335f1 /crawl-ref/source/beam.cc | |
parent | ed2381c38a0963ff4b1ca1e9e5dbfd521193b7e3 (diff) | |
download | crawl-ref-895860a717e48c8978fe63882ed9d616e7affa5a.tar.gz crawl-ref-895860a717e48c8978fe63882ed9d616e7affa5a.zip |
[1854279] Fixed scroll of fear not iding when resisted.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3134 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 251578e4e2..86a40920ee 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1888,12 +1888,21 @@ static bool monster_resists_mass_enchantment(monsters *monster, } // Enchants all monsters in player's sight. -bool mass_enchantment( enchant_type wh_enchant, int pow, int origin ) +// If m_succumbed is non-NULL, will be set to the number of monsters that +// were enchanted. If m_attempted is non-NULL, will be set to the number of +// monsters that we tried to enchant. +bool mass_enchantment( enchant_type wh_enchant, int pow, int origin, + int *m_succumbed, int *m_attempted ) { int i; // loop variable {dlb} bool msg_generated = false; monsters *monster; + if (m_succumbed) + *m_succumbed = 0; + if (m_attempted) + *m_attempted = 0; + viewwindow(0, false); if (pow > 200) @@ -1911,11 +1920,17 @@ bool mass_enchantment( enchant_type wh_enchant, int pow, int origin ) if (monster->has_ench(wh_enchant)) continue; + if (m_attempted) + ++*m_attempted; + if (monster_resists_mass_enchantment(monster, wh_enchant, pow)) continue; if (monster->add_ench(mon_enchant(wh_enchant, 0, kc))) { + if (m_succumbed) + ++*m_succumbed; + if (player_monster_visible( monster )) { // turn message on |