summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-behv.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-06 13:37:03 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-06 13:37:52 -0600
commitf858cfc60235a5cfb86dd2a2c510dde5e130a4bf (patch)
treed961eaf5b7122e52a9250e3381d93b1e9c80c88b /crawl-ref/source/mon-behv.cc
parent79d8c3044d2bb75d7f1e8ebad5cf6e3692fb7605 (diff)
downloadcrawl-ref-f858cfc60235a5cfb86dd2a2c510dde5e130a4bf.tar.gz
crawl-ref-f858cfc60235a5cfb86dd2a2c510dde5e130a4bf.zip
Move checks for the berserk state into actor::berserk().
Diffstat (limited to 'crawl-ref/source/mon-behv.cc')
-rw-r--r--crawl-ref/source/mon-behv.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc
index 0d67baf782..62b3a68a82 100644
--- a/crawl-ref/source/mon-behv.cc
+++ b/crawl-ref/source/mon-behv.cc
@@ -1192,14 +1192,14 @@ void handle_behaviour(monsters *mon)
if (isFriendly
&& you.pet_target != MHITNOT
&& (mon->foe == MHITNOT || mon->foe == MHITYOU)
- && !mon->has_ench(ENCH_BERSERK)
- && mon->mons_species() != MONS_GIANT_SPORE )
+ && !mon->berserk()
+ && mon->mons_species() != MONS_GIANT_SPORE)
{
mon->foe = you.pet_target;
}
// Instead, berserkers attack nearest monsters.
- if ((mon->has_ench(ENCH_BERSERK) || mon->mons_species() == MONS_GIANT_SPORE)
+ if ((mon->berserk() || mon->mons_species() == MONS_GIANT_SPORE)
&& (mon->foe == MHITNOT || isFriendly && mon->foe == MHITYOU))
{
// Intelligent monsters prefer to attack the player,
@@ -1238,7 +1238,7 @@ void handle_behaviour(monsters *mon)
// target the player, if they're healthy.
if (!isFriendly && !isNeutral
&& mon->foe != MHITYOU && mon->foe != MHITNOT
- && proxPlayer && !(mon->has_ench(ENCH_BERSERK)) && isHealthy
+ && proxPlayer && !mon->berserk() && isHealthy
&& !one_chance_in(3))
{
mon->foe = MHITYOU;
@@ -1802,7 +1802,7 @@ void behaviour_event(monsters *mon, mon_event_type event, int src,
case ME_SCARE:
// Stationary monsters can't flee, and berserking monsters
// are too enraged.
- if (mons_is_stationary(mon) || mon->has_ench(ENCH_BERSERK))
+ if (mons_is_stationary(mon) || mon->berserk())
{
mon->del_ench(ENCH_FEAR, true, true);
break;