diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-10 10:59:16 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-10 10:59:16 +0000 |
commit | 1edb944f9eb349a498c395d8b30959d5be4c4df1 (patch) | |
tree | 4629668711881c3c03ef685523badefb142065ec /crawl-ref/source | |
parent | 8ef6811945f142303038f8a20af41f3ebb875cea (diff) | |
download | crawl-ref-1edb944f9eb349a498c395d8b30959d5be4c4df1.tar.gz crawl-ref-1edb944f9eb349a498c395d8b30959d5be4c4df1.zip |
Make shields more likely to block missiles, a little less likely to block melee
attacks.
Make training shields in melee easier.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1009 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/beam.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 15 |
3 files changed, 20 insertions, 16 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 0cbcbd778b..3f2cbdda3e 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3059,18 +3059,15 @@ static int affect_player( struct bolt &beam ) && player_shield_class() > 0) { int exer = one_chance_in(3) ? 1 : 0; - // [dshaligram] beam.hit multiplier lowered to 3 - was 5. - // In favour of blocking, dex multiplier changed to .25 - // (was .2), added shield skill into the equation with a - // skill bump. - const int hit = random2( beam.hit * 3 - + 5 * you.shield_blocks * you.shield_blocks ); - - const int block = random2(player_shield_class()) - + (random2(you.dex) / 4) - + (random2(skill_bump(SK_SHIELDS)) / 4) - - 1; + const int hit = random2( beam.hit * 130 / 100 + + you.shield_block_penalty() ); + const int block = you.shield_bonus(); + +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Beamshield: hit: %d, block %d", + hit, block); +#endif if (hit < block) { you.shield_blocks++; diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 063d1929ec..49065dc41b 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -2811,7 +2811,7 @@ int monsters::shield_block_penalty() const int monsters::shield_bypass_ability(int) const { - return (15 + hit_dice / 2); + return (15 + hit_dice * 2 / 3); } int monsters::armour_class() const diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 262ef24b49..3889f85b15 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4992,8 +4992,17 @@ int player::shield_block_penalty() const int player::shield_bonus() const { + const item_def *sh = const_cast<player*>(this)->shield(); + if (!sh) + 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()) - + (random2(dex) / 4) + + (random2(stat) / 4) + (random2(skill_bump(SK_SHIELDS)) / 4) - 1; } @@ -5006,9 +5015,7 @@ int player::shield_bypass_ability(int tohit) const void player::shield_block_succeeded() { shield_blocks++; - - if (one_chance_in(4)) - exercise(SK_SHIELDS, 1); + exercise(SK_SHIELDS, 1); } bool player::wearing_light_armour(bool with_skill) const |