summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-10-31 15:08:00 -0500
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-10-31 15:09:10 -0500
commita418d15295dfc484bdeef463ef6678424981b224 (patch)
tree0e21c1fa45e4acf5a321582a10510b38d49ebc93 /crawl-ref/source/fight.cc
parentc96b1349887c237d78ab6f3cbaa3967c1fe31bbe (diff)
downloadcrawl-ref-a418d15295dfc484bdeef463ef6678424981b224.tar.gz
crawl-ref-a418d15295dfc484bdeef463ef6678424981b224.zip
Merge mons_holiness() into monster::holiness(), and add an is_unholy()
convenience function.
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc13
1 files changed, 2 insertions, 11 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index ee0d6cb880..058faf0cd2 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -2147,14 +2147,6 @@ int melee_attack::fire_res_apply_cerebov_downgrade(int res)
return (res);
}
-bool melee_attack::defender_is_unholy()
-{
- if (defender->atype() == ACT_PLAYER)
- return (player_is_unholy());
- else
- return (mons_is_unholy(defender_as_monster()));
-}
-
void melee_attack::drain_defender()
{
if (defender->atype() == ACT_MONSTER && one_chance_in(3))
@@ -2319,8 +2311,7 @@ void melee_attack::chaos_affects_defender()
{
const bool mon = defender->atype() == ACT_MONSTER;
const bool immune = mon && mons_immune_magic(defender_as_monster());
- const bool is_natural = mon && mons_holiness(defender_as_monster())
- == MH_NATURAL;
+ const bool is_natural = mon && defender->holiness() == MH_NATURAL;
const bool is_shifter = mon && mons_is_shapeshifter(defender_as_monster());
const bool can_clone = mon && !mons_is_holy(defender_as_monster())
&& mons_clonable(defender_as_monster(), true);
@@ -3074,7 +3065,7 @@ bool melee_attack::apply_damage_brand()
break;
case SPWPN_HOLY_WRATH:
- if (defender_is_unholy())
+ if (defender->is_unholy())
special_damage = 1 + (random2(damage_done * 15) / 10);
if (special_damage && defender_visible)