diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-06 13:37:03 -0600 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-11-06 13:37:52 -0600 |
commit | f858cfc60235a5cfb86dd2a2c510dde5e130a4bf (patch) | |
tree | d961eaf5b7122e52a9250e3381d93b1e9c80c88b /crawl-ref/source/mon-act.cc | |
parent | 79d8c3044d2bb75d7f1e8ebad5cf6e3692fb7605 (diff) | |
download | crawl-ref-f858cfc60235a5cfb86dd2a2c510dde5e130a4bf.tar.gz crawl-ref-f858cfc60235a5cfb86dd2a2c510dde5e130a4bf.zip |
Move checks for the berserk state into actor::berserk().
Diffstat (limited to 'crawl-ref/source/mon-act.cc')
-rw-r--r-- | crawl-ref/source/mon-act.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index ca998d22a3..03b8c1eed9 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -352,7 +352,7 @@ static void _handle_movement(monsters *monster) // since they're only being forced out rather than actually // scared. if (monster->holiness() == MH_NONLIVING - || monster->has_ench(ENCH_BERSERK) + || monster->berserk() || x_chance_in_y(2, 5)) { mons_stop_fleeing_from_sanctuary(monster); @@ -538,7 +538,7 @@ static void _handle_movement(monsters *monster) && mons_intel(monster) >= I_ANIMAL && coinflip() && !mons_is_confused(monster) && !monster->caught() - && !monster->has_ench(ENCH_BERSERK)) + && !monster->berserk()) { // If the monster is moving parallel to the x or y axis, check // whether @@ -1909,7 +1909,7 @@ static void _handle_monster_move(monsters *monster) if (!monster->asleep() && !mons_is_wandering(monster) // Berserking monsters are limited to running up and // hitting their foes. - && !monster->has_ench(ENCH_BERSERK) + && !monster->berserk() // Slime creatures can split while wandering or resting. || monster->type == MONS_SLIME_CREATURE) { @@ -3122,7 +3122,7 @@ static bool _monster_move(monsters *monster) if (monster_can_submerge(monster, grd(monster->pos())) && !can_see && !mons_is_confused(monster) && !monster->caught() - && !monster->has_ench(ENCH_BERSERK)) + && !monster->berserk()) { monster->add_ench(ENCH_SUBMERGED); monster->behaviour = BEH_LURK; @@ -3131,7 +3131,7 @@ static bool _monster_move(monsters *monster) } // Berserking monsters make a lot of racket. - if (monster->has_ench(ENCH_BERSERK)) + if (monster->berserk()) { int noise_level = get_shout_noise_level(mons_shouts(monster->type)); if (noise_level > 0) |