summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-14 16:48:41 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-14 16:48:41 +0000
commitecdff56d9ff3bba10dc8d45994c3374e02e9454d (patch)
tree305bfb9ff471b901915fdc21fd96e06113063d2f /crawl-ref/source/player.cc
parentb79623e1153c424d61004bb0e5a85d3bba454c98 (diff)
downloadcrawl-ref-ecdff56d9ff3bba10dc8d45994c3374e02e9454d.tar.gz
crawl-ref-ecdff56d9ff3bba10dc8d45994c3374e02e9454d.zip
Fix 1871029: really lose beogh_water_walk() upon penance
-> Beogh worshipper now will fall into water and drown Fix 1871027: no autosacrifice of restricted items (!p or rune/orb) Fix 1870495: make RAP_ANGRY actually call go_berserk() from time to time Fix 1849181: fix mimic description to match item (undetected mimic) or mimic database entry (detected mimic) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3272 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 8e0810c440..fe969627d8 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5752,6 +5752,33 @@ bool player::cannot_fight() const
return (false);
}
+// If you have a randart equipped that has the RAP_ANGRY property
+// there's a 1/20 chance of it becoming activated whenever you
+// attack a monster. (Same as the berserk mutation at level 1.)
+// The probabilites for actually going berserk are cumulative!
+static bool equipment_make_berserk()
+{
+ for (int eq = EQ_WEAPON; eq < NUM_EQUIP; eq++)
+ {
+ const item_def *item = you.slot_item((equipment_type) eq);
+ if (!item)
+ continue;
+
+ if (!is_random_artefact(*item))
+ continue;
+
+ if (one_chance_in(20)
+ && randart_wpn_property(*item,
+ static_cast<randart_prop_type>(RAP_ANGRY)))
+ {
+ return (true);
+ }
+ }
+
+ // nothing found
+ return (false);
+}
+
void player::attacking(actor *other)
{
if (other && other->atype() == ACT_MONSTER)
@@ -5764,7 +5791,8 @@ void player::attacking(actor *other)
}
if (mutation[MUT_BERSERK] &&
- (random2(100) < (mutation[MUT_BERSERK] * 10) - 5))
+ (random2(100) < (mutation[MUT_BERSERK] * 10) - 5)
+ || equipment_make_berserk())
{
go_berserk(false);
}