diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-16 23:11:59 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-16 23:11:59 +0000 |
commit | f0a8d0474fd94fc6d623023db3ef403a17cd23cc (patch) | |
tree | 1727e1f8a4a27af9180221871fb564ac28a52b8b /crawl-ref/source/effects.cc | |
parent | ce1424a5886f907755c36e5e649f20bb412cd810 (diff) | |
download | crawl-ref-f0a8d0474fd94fc6d623023db3ef403a17cd23cc.tar.gz crawl-ref-f0a8d0474fd94fc6d623023db3ef403a17cd23cc.zip |
Use more wrappers, and add more cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5893 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r-- | crawl-ref/source/effects.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 9190e4bf3f..d06129f7cd 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -2691,16 +2691,16 @@ static void _catchup_monster_moves(monsters *mon, int turns) return; // Don't move non-land or stationary monsters around. - if (mons_habitat( mon ) != HT_LAND - || mons_is_zombified( mon ) + if (mons_habitat(mon) != HT_LAND + || mons_is_zombified(mon) && mons_habitat_by_type(mon->base_monster) != HT_LAND - || mons_is_stationary( mon )) + || mons_is_stationary(mon)) { return; } // Let sleeping monsters lie. - if (mon->behaviour == BEH_SLEEP || mons_is_paralysed(mon)) + if (mons_is_sleeping(mon) || mons_is_paralysed(mon)) return; const int range = (turns * mon->speed) / 10; @@ -2725,9 +2725,9 @@ static void _catchup_monster_moves(monsters *mon, int turns) return; if (long_time - && (mon->behaviour == BEH_FLEE - || mon->behaviour == BEH_CORNERED - || testbits( mon->flags, MF_BATTY ) + && (mons_is_fleeing(mon) + || mons_is_cornered(mon) + || mons_is_batty(mon) || ranged_attack || coinflip())) { @@ -2793,7 +2793,7 @@ static void _catchup_monster_moves(monsters *mon, int turns) coord_def inc(mon->target_pos() - pos); inc = coord_def(sgn(inc.x), sgn(inc.y)); - if (mon->behaviour == BEH_FLEE) + if (mons_is_fleeing(mon)) inc *= -1; if (pos.x + inc.x < 0 || pos.x + inc.x >= GXM) |