View Single Post
Old January 3, 2019, 04:39  
Derakon's Avatar
Join Date: Dec 2009
Posts: 8,754
Derakon is on a distinguished road
I decided to look up the relevant code, attempt_shield_bash in player-attack.c. Some interesting tidbits:

* Bash chance depends on melee skill and DEX
* Bash chance increases 4x if you don't have a weapon equipped
* ...or 2x if your weapon's dice * sides * (your blows per round) is less than your shield's dice * sides * 3.
* Bash chance is lower against higher-level monsters
* Bash damage scales with level (level 50 characters do about 3.5x more damage with their bashes than level 1 characters do)
* ...but damage is capped at 125 per bash.
* The "WHAMM!" message is completely cosmetic.
* Stunning and confusion are more likely as the player's level increases (and as bash damage goes up)
* Chance of stumbling scales solely with DEX. Stumbling increases the effective number of blows you have taken this round by 1d(blows per round you normally get), which should reduce the total blows you get to take after the bash.
* There's a level comparison check in py_attack on whether to attempt the shield bash that really should be in attempt_shield_bash. Indeed, that section (line 687) could be written as:
if (player can shield bash && monster is visible && attempt_shield_bash) {
  return; // because the shield bash killed the monster
If you do not stumble then there is no blows cost. If you do stumble, and you roll a max result on how many blows to lose, then the "Attack until energy runs out or monster dies" loop (lines 694-700) does not execute. That's the code that actually penalizes player energy.

More generally, while a stumble in attempt_shield_bash does prevent the player from attempting additional blows in that attack, it doesn't charge energy for the blows it deducts. So basically every shield bash is free -- either you don't stumble and you get a full set of follow-on attacks, or you do stumble, you get fewer follow-on attacks, and the turn uses less energy. The fix should be to add this after line 690:

/* Deduct any energy lost due to stumbling after shield bash. */
p->upkeep->energy_use += blow_energy * blows;
Sorry, no pull request, I don't have the appropriate dev environment set up right now.
Derakon is offline   Reply With Quote