From ecdff56d9ff3bba10dc8d45994c3374e02e9454d Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 14 Jan 2008 16:48:41 +0000 Subject: 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 --- crawl-ref/source/player.cc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/player.cc') 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(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); } -- cgit v1.2.3-54-g00ecf