diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-16 22:34:03 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-16 22:34:03 +0000 |
commit | 9f612e8e98d87fa9a3dc73907802b0782a9901ff (patch) | |
tree | df73e524382a9653f5adcc88b35c42a4ce6d4e2c /crawl-ref/source | |
parent | fcd2f73d85997682a9c89c897348ae8e32432589 (diff) | |
download | crawl-ref-9f612e8e98d87fa9a3dc73907802b0782a9901ff.tar.gz crawl-ref-9f612e8e98d87fa9a3dc73907802b0782a9901ff.zip |
Properly handle zombified dual-wielding monsters.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7264 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 16 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/monplace.cc | 2 |
3 files changed, 13 insertions, 7 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 96ec1a46a9..46e1afc06b 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -1455,6 +1455,7 @@ bool mons_amphibious(const monsters *mon) { const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) : mon->type; + return (mons_class_amphibious(montype)); } @@ -1467,6 +1468,7 @@ bool mons_wall_shielded(const monsters *mon) { const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) : mon->type; + return (mons_class_wall_shielded(montype)); } @@ -2280,14 +2282,17 @@ bool mons_atts_aligned(mon_attitude_type fr1, mon_attitude_type fr2) return (fr1 == fr2); } -bool mons_wields_two_weapons(monster_type m) +bool mons_class_wields_two_weapons(int mc) { - return mons_class_flag(m, M_TWOWEAPON); + return (mons_class_flag(mc, M_TWOWEAPON)); } -bool mons_wields_two_weapons(const monsters *m) +bool mons_wields_two_weapons(const monsters *mon) { - return (mons_wields_two_weapons(static_cast<monster_type>(m->type))); + const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) + : mon->type; + + return (mons_class_wields_two_weapons(montype)); } bool mons_eats_corpses(const monsters *m) @@ -3265,7 +3270,8 @@ bool mons_can_pass(const monsters *mon, dungeon_feature_type grid) { const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon) : mon->type; - return mons_class_can_pass(montype, grid); + + return (mons_class_can_pass(montype, grid)); } bool monsters::can_pass_through_feat(dungeon_feature_type grid) const diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index a56be52e68..e4df5ddd19 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -537,8 +537,8 @@ bool mons_is_mimic( int mc ); bool mons_is_statue( int mc ); bool mons_is_demon( int mc ); +bool mons_class_wields_two_weapons(int mc); bool mons_wields_two_weapons(const monsters *m); -bool mons_wields_two_weapons(monster_type m); bool mons_self_destructs(const monsters *m); bool mons_is_summoned(const monsters *m); bool mons_is_shapeshifter(const monsters *m); diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index ccbc7c76cd..63b9a6f0be 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -908,7 +908,7 @@ static int _place_monster_aux( const mgen_data &mg, { give_item(id, mg.power); // Give these monsters a second weapon -- bwr - if (mons_wields_two_weapons(mg.cls)) + if (mons_class_wields_two_weapons(mg.cls)) give_item(id, mg.power); unwind_var<int> save_speedinc(menv[id].speed_increment); |