summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-06 13:37:03 -0600
committerDavid Lawrence Ramsey <dolorous@users.sourceforge.net>2009-11-06 13:37:52 -0600
commitf858cfc60235a5cfb86dd2a2c510dde5e130a4bf (patch)
treed961eaf5b7122e52a9250e3381d93b1e9c80c88b /crawl-ref/source/item_use.cc
parent79d8c3044d2bb75d7f1e8ebad5cf6e3692fb7605 (diff)
downloadcrawl-ref-f858cfc60235a5cfb86dd2a2c510dde5e130a4bf.tar.gz
crawl-ref-f858cfc60235a5cfb86dd2a2c510dde5e130a4bf.zip
Move checks for the berserk state into actor::berserk().
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 8e7c500f98..19378c4da6 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -90,7 +90,7 @@ bool can_wield(item_def *weapon, bool say_reason,
{
#define SAY(x) if (say_reason) { x; } else
- if (!ignore_temporary_disability && you.duration[DUR_BERSERKER])
+ if (!ignore_temporary_disability && you.berserk())
{
SAY(canned_msg(MSG_TOO_BERSERK));
return (false);
@@ -712,7 +712,7 @@ bool armour_prompt(const std::string & mesg, int *index, operation_types oper)
if (inv_count() < 1)
canned_msg(MSG_NOTHING_CARRIED);
- else if (you.duration[DUR_BERSERKER])
+ else if (you.berserk())
canned_msg(MSG_TOO_BERSERK);
else
{
@@ -1067,7 +1067,7 @@ bool takeoff_armour(int item)
return (false);
}
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return (false);
@@ -1442,7 +1442,7 @@ static bool _fire_warn_if_impossible()
}
// Else shooting is possible.
}
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return (true);
@@ -3693,7 +3693,7 @@ bool puton_ring(int slot)
return (false);
}
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return (false);
@@ -3813,7 +3813,7 @@ bool remove_ring(int slot, bool announce)
return (false);
}
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return (false);
@@ -3982,7 +3982,7 @@ void zap_wand(int slot)
return;
}
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return;
@@ -4244,7 +4244,7 @@ void drink(int slot)
return;
}
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return;
@@ -4346,7 +4346,7 @@ bool _drink_fountain()
return (false);
}
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return (true);
@@ -4940,7 +4940,7 @@ static void _vulnerability_scroll()
void read_scroll(int slot)
{
- if (you.duration[DUR_BERSERKER])
+ if (you.berserk())
{
canned_msg(MSG_TOO_BERSERK);
return;