diff options
author | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-31 10:40:13 -0500 |
---|---|---|
committer | David Lawrence Ramsey <dolorous@users.sourceforge.net> | 2009-10-31 10:41:17 -0500 |
commit | 0299c91350a8631d8042eeb8ca8ba088a45ce32b (patch) | |
tree | dd5b13284933a3d7f7508252dd517df41ecae290 | |
parent | 7070dd05f0db507684fd2f4d1344d0cd403fff15 (diff) | |
download | crawl-ref-0299c91350a8631d8042eeb8ca8ba088a45ce32b.tar.gz crawl-ref-0299c91350a8631d8042eeb8ca8ba088a45ce32b.zip |
Properly mark artefacts that make you angry or let you go berserk as
hasty items for Cheibriados' purposes.
-rw-r--r-- | crawl-ref/source/goditem.cc | 31 |
1 files changed, 18 insertions, 13 deletions
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) |