summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index abf7f089e0..836b7d877f 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4934,6 +4934,40 @@ void player::go_berserk(bool intentional)
::go_berserk(intentional);
}
+bool player::can_go_berserk() const
+{
+ return can_go_berserk(false);
+}
+
+bool player::can_go_berserk(bool verbose) const
+{
+ if (you.berserker)
+ {
+ if (verbose)
+ mpr("You're already berserk!");
+ // or else you won't notice -- no message here.
+ return (false);
+ }
+
+ if (you.exhausted)
+ {
+ if (verbose)
+ mpr("You're too exhausted to go berserk.");
+ // or else they won't notice -- no message here
+ return (false);
+ }
+
+ if (you.is_undead)
+ {
+ if (verbose)
+ mpr("You cannot raise a blood rage in your lifeless body.");
+ // or else you won't notice -- no message here
+ return (false);
+ }
+
+ return (true);
+}
+
void player::god_conduct(int thing_done, int level)
{
::did_god_conduct(thing_done, level);