summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-24 11:17:45 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-24 11:17:45 +0000
commitc633d5d2b956aab18819d51236982db57ee17134 (patch)
tree0170fa5726a920b2df20a5c78c7f28d998a0d37a /crawl-ref/source/player.cc
parenta9f1fec61232ffd3c80b7a6589bcca31b8524aff (diff)
downloadcrawl-ref-c633d5d2b956aab18819d51236982db57ee17134.tar.gz
crawl-ref-c633d5d2b956aab18819d51236982db57ee17134.zip
Fixed condensation shield (Haran).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1636 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc21
1 files changed, 13 insertions, 8 deletions
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<player*>(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<player*>(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;