From c633d5d2b956aab18819d51236982db57ee17134 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 24 Jun 2007 11:17:45 +0000 Subject: Fixed condensation shield (Haran). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1636 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 8f5e5088bd..5e15851978 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5011,16 +5011,21 @@ int player::shield_block_penalty() const int player::shield_bonus() const { - const item_def *sh = const_cast(this)->shield(); - if (!sh) + const int shield_class = player_shield_class(); + if (!shield_class) return (0); - - const int stat = - sh->sub_type == ARM_BUCKLER? dex : - sh->sub_type == ARM_LARGE_SHIELD? (3 * strength + dex) / 4: - (dex + strength) / 2; - return random2(player_shield_class()) + int stat = 0; + if (const item_def *sh = const_cast(this)->shield()) + stat = + sh->sub_type == ARM_BUCKLER? dex : + sh->sub_type == ARM_LARGE_SHIELD? (3 * strength + dex) / 4: + (dex + strength) / 2; + else + // Condensation shield is guided by the mind. + stat = intel / 2; + + return random2(player_shield_class()) + (random2(stat) / 4) + (random2(skill_bump(SK_SHIELDS)) / 4) - 1; -- cgit v1.2.3-54-g00ecf