summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-18 11:37:24 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-18 11:37:24 +0000
commit5c1d15b2a0ba16caafbc5f426541386776e6ad70 (patch)
tree340d1ea4b5fb4d28b3578dbb3257eca03714b2e9
parenta7c16941b77fcdcc841c3edbcd0514c16ac4c2e5 (diff)
downloadcrawl-ref-5c1d15b2a0ba16caafbc5f426541386776e6ad70.tar.gz
crawl-ref-5c1d15b2a0ba16caafbc5f426541386776e6ad70.zip
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
-rw-r--r--crawl-ref/source/invent.cc5
-rw-r--r--crawl-ref/source/it_use2.cc8
-rw-r--r--crawl-ref/source/item_use.cc12
-rw-r--r--crawl-ref/source/items.cc3
-rw-r--r--crawl-ref/source/mutation.cc5
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<SelItem> 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<SelItem> 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;
}