From 117cfdbc3934adfed89079b242e47c350aa7808d Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 19 Nov 2009 06:29:42 -0600 Subject: And update what monsters can wield one more time, in a better way. Currently, there are no unclean weapons, and Fedhas gives no monsters as gifts that can wield weapons, but cover those cases anyway, just in case. --- crawl-ref/source/monster.cc | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index fccd00e155..7f5a262627 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -614,21 +614,39 @@ bool monsters::could_wield(const item_def &item, bool ignore_brand, return (false); // Holy monsters and monsters that are gifts of good gods won't - // use unholy or evil weapons. - if ((is_holy() || is_good_god(god)) - && (is_unholy_item(item) || is_evil_item(item))) + // use unholy weapons. + if ((is_holy() || is_good_god(god)) && is_unholy_item(item)) + return (false); + + // Holy monsters that aren't gifts of chaotic gods and monsters + // that are gifts of good gods or Fedhas won't use potentially + // evil weapons. + if (((is_holy() && !is_chaotic_god(god)) + || (is_good_god(god) || god == GOD_FEDHAS)) + && is_potentially_evil_item(item)) + { + return (false); + } + + // Holy monsters and monsters that are gifts of good gods or + // Fedhas won't use evil weapons. + if (((is_holy() || is_good_god(god)) || god == GOD_FEDHAS) + && is_evil_item(item)) { return (false); } // Holy monsters that aren't gifts of chaotic gods and monsters - // that are gifts of good gods won't use unclean or chaotic - // weapons. + // that are gifts of good gods won't use chaotic weapons. if (((is_holy() && !is_chaotic_god(god)) || is_good_god(god)) - && (is_unclean_item(item) || is_chaotic_item(item))) + && is_chaotic_item(item)) { return (false); } + + // Monsters that are gifts of Zin won't use unclean weapons. + if (god == GOD_ZIN && is_unclean_item(item)) + return (false); } return (true); -- cgit v1.2.3-54-g00ecf