diff options
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index a3418761d4..7543da8ea5 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1921,7 +1921,7 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer ) if (item_dropped == you.equip[EQ_WEAPON] && you.inv[item_dropped].base_type == OBJ_WEAPONS - && item_cursed( you.inv[item_dropped] )) + && you.inv[item_dropped] .cursed()) { mpr("That object is stuck to you!"); return (false); @@ -2821,7 +2821,7 @@ int item_def::book_number() const bool item_def::cursed() const { - return (item_cursed(*this)); + return (flags & ISFLAG_CURSED); } bool item_def::launched_by(const item_def &launcher) const @@ -2919,6 +2919,21 @@ bool item_def::is_valid() const return (base_type != OBJ_UNASSIGNED && quantity > 0); } +// The Orb of Zot and unique runes are considered critical. +bool item_def::is_critical() const +{ + if (!is_valid()) + return (false); + + if (base_type == OBJ_ORBS) + return (true); + + return (base_type == OBJ_MISCELLANY + && sub_type == MISC_RUNE_OF_ZOT + && plus != RUNE_DEMONIC + && plus != RUNE_ABYSSAL); +} + static void _rune_from_specs(const char* _specs, item_def &item) { char specs[80]; |