diff options
author | Stefan O'Rear <stefanor@cox.net> | 2009-11-08 23:32:42 -0800 |
---|---|---|
committer | Stefan O'Rear <stefanor@cox.net> | 2009-11-08 23:36:10 -0800 |
commit | dce267d966c2a6466ebc57f84dccda7fa5012a75 (patch) | |
tree | d010174f4b02d66485305c426503c3b72dc48aed /crawl-ref/source/player.cc | |
parent | 6521776b1fc7b68f7cb025397797cd8cad5a32e0 (diff) | |
download | crawl-ref-dce267d966c2a6466ebc57f84dccda7fa5012a75.tar.gz crawl-ref-dce267d966c2a6466ebc57f84dccda7fa5012a75.zip |
Reform SH to be more transparent
Before: SH was a function of items and skills. Blocking was a function
of SH, skills, and stats.
Now: SH is a function of items, skills, and stats. Blocking is a
function of SH and SH alone.
Your ability to block attacks in given equipment should be more or less
the same, although there will be small differences. Condensation Shield
was doubled (since nobody uses it), Divine Shield was made to not use
intelligence.
SH values have been rescaled to be on approximately the same scale as
AC and EV. This meant increasing the max enchant of shields to +3.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index fe7b7bca31..4340a1c6ab 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2301,37 +2301,59 @@ int player_mag_abil(bool is_weighted) int player_shield_class(void) //jmf: changes for new spell { - int base_shield = 0; + int shield = 0; + int stat = 0; + + if (you.incapacitated()) + return (0); if (player_wearing_slot(EQ_SHIELD)) { const item_def& item = you.inv[you.equip[EQ_SHIELD]]; - base_shield = property(item, PARM_AC); + int base_shield = property(item, PARM_AC); - int racial_bonus = _player_armour_racial_bonus(item) * 2 / 3; + int racial_bonus = _player_armour_racial_bonus(item); // bonus applied only to base, see above for effect: - base_shield *= (20 + you.skills[SK_SHIELDS] + racial_bonus); - base_shield /= 20; + shield += base_shield * 100; + shield += base_shield * 5 * you.skills[SK_SHIELDS]; + shield += base_shield * racial_bonus * 10 / 3; - base_shield += item.plus; + shield += item.plus * 100; + + if (item.sub_type == ARM_BUCKLER) + stat = you.dex * 38; + else if (item.sub_type == ARM_LARGE_SHIELD) + stat = you.dex * 12 + you.strength * 26; + else + stat = you.dex * 19 + you.strength * 19; } else { if (you.duration[DUR_MAGIC_SHIELD]) - base_shield = 2 + you.skills[SK_EVOCATIONS] / 6; + { + stat = 600 + you.skills[SK_EVOCATIONS] * 50; + shield += 300 + you.skills[SK_EVOCATIONS] * 25; + } if (!you.duration[DUR_FIRE_SHIELD] && you.duration[DUR_CONDENSATION_SHIELD]) { - base_shield += 2 + (you.skills[SK_ICE_MAGIC] / 6); // max 6 + shield += 300 + (you.skills[SK_ICE_MAGIC] * 25); + stat = std::max(stat, you.intel * 38); } } if (you.duration[DUR_DIVINE_SHIELD]) - base_shield += you.attribute[ATTR_DIVINE_SHIELD]; + { + shield += you.attribute[ATTR_DIVINE_SHIELD] * 150; + stat = std::max(stat, int(you.attribute[ATTR_DIVINE_SHIELD] * 300)); + } + + if (shield + stat > 0) + shield += skill_bump(SK_SHIELDS) * 38; - return (base_shield); + return (shield + stat + 50) / 100; } int player_sust_abil(bool calc_unid) @@ -6097,31 +6119,10 @@ int player::shield_block_penalty() const int player::shield_bonus() const { const int shield_class = player_shield_class(); - if (!shield_class) + if (shield_class <= 0) return (-100); - // Note that 0 is not quite no-blocking. - if (incapacitated()) - return (0); - - 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 - { - // Magical and divine shields are governed by the mind. - stat = intel / 2; - } - - return (random2(shield_class) - + (random2(stat) / 4) - + (random2(skill_bump(SK_SHIELDS)) / 4) - - 1); + return random2avg(shield_class * 2, 2) / 3 - 1; } int player::shield_bypass_ability(int tohit) const |