How does attack energy for shield bash work & is it broken?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wobbly
    Prophet
    • May 2012
    • 2629

    How does attack energy for shield bash work & is it broken?

    My paladin at speed 0 & 1 blow just bashed something to death without anything moving. I've seen a similar effect with "stumble". So how does this actually work? If I never make a blow, do I actually use any energy?
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9634

    #2
    Shield bashes don't exactly cost energy. With every round of player melee
    • there's a test for if you get a shield bash;
    • if you do, there's a test for whether you stumble, which costs blows in that melee turn;
    • then you get to take any remaining blows for the turn.


    Shield bashes can stun or confuse the monster. Did that happen?
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • wobbly
      Prophet
      • May 2012
      • 2629

      #3
      Originally posted by Nick
      Shield bashes don't exactly cost energy. With every round of player melee
      • there's a test for if you get a shield bash;
      • if you do, there's a test for whether you stumble, which costs blows in that melee turn;
      • then you get to take any remaining blows for the turn.


      Shield bashes can stun or confuse the monster. Did that happen?
      So I've seen 3 cases:
      A shield bash against a 1 star monster killing it. No blows happened. No time appeared to pass.
      A shield bash with stumble, no stun or confusion. No blows happened. No time appeared to pass.
      A shield bash with stumble, confusing the monster. No blows happened. No time appeared to pass.

      Edit:Ok it appears to be passing for stun or confuse but not for stumble with no stun/confuse
      Last edited by wobbly; January 2, 2019, 22:50.

      Comment

      • Derakon
        Prophet
        • Dec 2009
        • 9022

        #4
        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:
        Code:
        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:

        Code:
        /* 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.

        Comment

        • Nick
          Vanilla maintainer
          • Apr 2007
          • 9634

          #5
          OK, thanks - I was totally failing to see that.
          One for the Dark Lord on his dark throne
          In the Land of Mordor where the Shadows lie.

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎