diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/goditem.cc | 22 | ||||
-rw-r--r-- | crawl-ref/source/goditem.h | 2 |
2 files changed, 21 insertions, 3 deletions
diff --git a/crawl-ref/source/goditem.cc b/crawl-ref/source/goditem.cc index d8e547339f..5b31e5efd8 100644 --- a/crawl-ref/source/goditem.cc +++ b/crawl-ref/source/goditem.cc @@ -207,13 +207,19 @@ bool is_hasty_item(const item_def& item) case OBJ_WANDS: retval = (item.sub_type == WAND_HASTING); break; + case OBJ_JEWELLERY: + retval = (item.sub_type == AMU_RAGE + || item.sub_type == AMU_RESIST_SLOW); + break; case OBJ_POTIONS: retval = (item.sub_type == POT_SPEED || item.sub_type == POT_BERSERK_RAGE); break; - case OBJ_JEWELLERY: - retval = (item.sub_type == AMU_RAGE - || item.sub_type == AMU_RESIST_SLOW); + case OBJ_BOOKS: + retval = is_hasty_spellbook(item); + break; + case OBJ_STAVES: + retval = is_hasty_rod(item); break; default: break; @@ -336,6 +342,11 @@ bool is_chaotic_spellbook(const item_def& item) return (is_spellbook_type(item, false, is_chaotic_spell)); } +bool is_hasty_spellbook(const item_def& item) +{ + return (is_spellbook_type(item, false, is_hasty_spell)); +} + bool god_hates_spellbook(const item_def& item) { return (is_spellbook_type(item, false, god_hates_spell_type)); @@ -356,6 +367,11 @@ bool is_chaotic_rod(const item_def& item) return (is_spellbook_type(item, true, is_chaotic_spell)); } +bool is_hasty_rod(const item_def& item) +{ + return (is_spellbook_type(item, true, is_hasty_spell)); +} + bool god_hates_rod(const item_def& item) { return (is_spellbook_type(item, true, god_hates_spell_type)); diff --git a/crawl-ref/source/goditem.h b/crawl-ref/source/goditem.h index 2ff0383614..8503b9d204 100644 --- a/crawl-ref/source/goditem.h +++ b/crawl-ref/source/goditem.h @@ -29,10 +29,12 @@ bool is_spellbook_type(const item_def& item, bool book_or_rod, bool is_holy_spellbook(const item_def& item); bool is_evil_spellbook(const item_def& item); bool is_chaotic_spellbook(const item_def& item); +bool is_hasty_spellbook(const item_def& item); bool god_hates_spellbook(const item_def& item); bool is_holy_rod(const item_def& item); bool is_evil_rod(const item_def& item); bool is_chaotic_rod(const item_def& item); +bool is_hasty_rod(const item_def& item); bool god_hates_rod(const item_def& item); conduct_type good_god_hates_item_handling(const item_def &item); conduct_type god_hates_item_handling(const item_def &item); |