From 5c1d15b2a0ba16caafbc5f426541386776e6ad70 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 18 Apr 2008 11:37:24 +0000 Subject: Fix 1945337: Vampires getting carnivorous/herbivorous mutations. Fix 1944345: Dropping worn/wielded items while Berserk. Fix 1945347: Drinking from fountans while Berserk. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4326 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/invent.cc | 5 +++-- crawl-ref/source/it_use2.cc | 8 +++++++- crawl-ref/source/item_use.cc | 12 ++++++++++++ crawl-ref/source/items.cc | 3 ++- crawl-ref/source/mutation.cc | 5 +++-- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index f232e5374c..31c4c09e11 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -628,8 +628,8 @@ std::vector InvMenu::get_selitems() const bool InvMenu::process_key( int key ) { if (items.size() - && type == MT_DROP - && (key == CONTROL('D') || key == '@')) + && type == MT_DROP + && (key == CONTROL('D') || key == '@')) { int newflag = is_set(MF_MULTISELECT)? @@ -954,6 +954,7 @@ std::vector prompt_invent_items( && (!pre_select || pre_select->empty())? MF_SINGLESELECT | MF_EASY_EXIT | MF_ANYPRINTABLE : MF_MULTISELECT | MF_ALLOW_FILTER; + // The "view inventory listing" mode. int ch = invent_select( prompt, diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc index 3245babafb..6ca4a09a46 100644 --- a/crawl-ref/source/it_use2.cc +++ b/crawl-ref/source/it_use2.cc @@ -386,12 +386,18 @@ bool unwield_item(bool showMsgs) if ( unw == -1 ) return (false); + if (you.duration[DUR_BERSERKER]) + { + canned_msg(MSG_TOO_BERSERK); + return (false); + } + if (!safe_to_remove_or_wear(you.inv[unw], true)) return (false); you.equip[EQ_WEAPON] = -1; you.special_wield = SPWLD_NONE; - you.wield_change = true; + you.wield_change = true; you.m_quiver->on_weapon_changed(); item_def &item(you.inv[unw]); diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index af1c6906c5..ad37d5f351 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1134,6 +1134,12 @@ bool takeoff_armour(int item) return false; } + if (you.duration[DUR_BERSERKER]) + { + canned_msg(MSG_TOO_BERSERK); + return false; + } + if (item_cursed( you.inv[item] )) { for (int loopy = EQ_CLOAK; loopy <= EQ_BODY_ARMOUR; loopy++) @@ -3533,6 +3539,12 @@ bool _drink_fountain() return false; } + if (you.duration[DUR_BERSERKER]) + { + canned_msg(MSG_TOO_BERSERK); + return false; + } + potion_type fountain_effect = POT_WATER; if ( feat == DNGN_FOUNTAIN_BLUE ) { diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 4a082d92fb..6cc75ce3bd 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1887,7 +1887,8 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer ) if (item_dropped == you.equip[EQ_WEAPON] && quant_drop >= you.inv[item_dropped].quantity) { - unwield_item(); + if (!unwield_item()) + return (false); canned_msg( MSG_EMPTY_HANDED ); } diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index d54883ac1f..7cd4b1c931 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1876,8 +1876,9 @@ bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation, return false; // Vampires' hunger rate depends on their blood level. - if ((mutat == MUT_SLOW_METABOLISM || mutat == MUT_FAST_METABOLISM) - && you.species == SP_VAMPIRE) + if (you.species == SP_VAMPIRE + && (mutat == MUT_SLOW_METABOLISM || mutat == MUT_FAST_METABOLISM + || mutat == MUT_CARNIVOROUS || mutat == MUT_HERBIVOROUS)) { return false; } -- cgit v1.2.3-54-g00ecf