From aadcdbed9483b1efb141d9c8e49c375cbe4b831b Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 25 Apr 2008 19:33:07 +0000 Subject: Refix confusion resistance checks to include plants and zombies. For the latter I added a check vs. undead holiness, but that may be (probably is) too general. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4634 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mon-util.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/mon-util.cc') diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 4a1184fbc4..a9516af329 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -399,7 +399,10 @@ mon_holy_type mons_class_holiness(int mc) bool mons_class_is_confusable(int mc) { - return (smc->resist_magic < MAG_IMMUNE); + return (smc->resist_magic < MAG_IMMUNE + && mons_holiness(mon) != MH_PLANT + && mons_holiness(mon) != MH_NONLIVING + && mons_holiness(mon) != MH_UNDEAD); } bool mons_class_is_slowable(int mc) @@ -3398,7 +3401,6 @@ static bool _item_race_matches_monster(const item_def &item, monsters *mons) && mons_genus(mons->type) == MONS_ORC); } -// FIXME: Need monster body-size handling. bool monsters::wants_armour(const item_def &item) const { // Returns whether this armour is the monster's size. @@ -3463,8 +3465,7 @@ bool monsters::pickup_armour(item_def &item, int near, bool force) if (!mslot_item(mslot) && newAC > 0) return pickup(item, mslot, near); - // XXX: Very simplistic armour evaluation (AC comparison) for the moment. - // This should take resistances into account. + // XXX: Very simplistic armour evaluation (AC comparison). if (const item_def *existing_armour = slot_item(eq)) { if (!force) @@ -3475,7 +3476,9 @@ bool monsters::pickup_armour(item_def &item, int near, bool force) if (oldAC == newAC) { - // compare item value (uses resistances and such) + // Use shopping value as a crude estimate of resistances etc. + // XXX: This is not quite logical as many properties don't + // apply to monsters (e.g. levitation, blink, berserk). int oldval = item_value(*existing_armour); int newval = item_value(item); -- cgit v1.2.3-54-g00ecf