From 0299c91350a8631d8042eeb8ca8ba088a45ce32b Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sat, 31 Oct 2009 10:40:13 -0500 Subject: Properly mark artefacts that make you angry or let you go berserk as hasty items for Cheibriados' purposes. --- crawl-ref/source/goditem.cc | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'crawl-ref/source/goditem.cc') diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc index 30b80f3e87..54f3170e5c 100644 --- a/crawl-ref/source/goditem.cc +++ b/crawl-ref/source/goditem.cc @@ -187,41 +187,46 @@ bool is_chaotic_item(const item_def& item) bool is_hasty_item(const item_def& item) { + bool retval = false; + switch (item.base_type) { case OBJ_WEAPONS: { const int item_brand = get_weapon_brand(item); - if (item_brand == SPWPN_SPEED) - return (true); - if (item.sub_type == WPN_QUICK_BLADE) - return (true); + retval = (item_brand == SPWPN_SPEED + || item.sub_type == WPN_QUICK_BLADE); } break; case OBJ_ARMOUR: { const int item_brand = get_armour_ego_type(item); - if (item_brand == SPARM_RUNNING) - return (true); + retval = (item_brand == SPARM_RUNNING); } break; case OBJ_WANDS: - if (item.sub_type == WAND_HASTING) - return (true); + retval = (item.sub_type == WAND_HASTING); break; case OBJ_POTIONS: - if (item.sub_type == POT_SPEED || item.sub_type == POT_BERSERK_RAGE) - return (true); + retval = (item.sub_type == POT_SPEED + || item.sub_type == POT_BERSERK_RAGE); break; case OBJ_JEWELLERY: - if (item.sub_type == AMU_RAGE || item.sub_type == AMU_RESIST_SLOW) - return (true); + retval = (item.sub_type == AMU_RAGE + || item.sub_type == AMU_RESIST_SLOW); break; default: break; } - return (false); + if (is_artefact(item) + && artefact_wpn_property(item, ARTP_ANGRY) + || artefact_wpn_property(item, ARTP_BERSERK)) + { + retval = true; + } + + return (retval); } bool is_holy_discipline(int discipline) -- cgit v1.2.3-54-g00ecf