From 5d21ab53cd4c5c73b5aa0c69376619a4992c9414 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 7 Apr 2007 14:54:30 +0000 Subject: Moth of wrath angering attack was lost in 0.2, reintroduced. Monsters can now go berserk (the rage spell, or by moth of wrath attack). Rupert is now a crusading-style berserker. Moths of wrath can now enrage nearby monsters of similar attitude. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1256 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'crawl-ref/source/player.cc') 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); -- cgit v1.2.3-54-g00ecf