Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old January 2, 2019, 16:44   #1
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,780
wobbly is on a distinguished road
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?
wobbly is offline   Reply With Quote
Old January 2, 2019, 22:13   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,350
Donated: $60
Nick is on a distinguished road
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.
Nick is offline   Reply With Quote
Old January 2, 2019, 22:20   #3
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 1,780
wobbly is on a distinguished road
Quote:
Originally Posted by Nick View Post
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 at 22:50.
wobbly is offline   Reply With Quote
Old January 3, 2019, 05:39   #4
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,608
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:
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.
Derakon is offline   Reply With Quote
Old January 3, 2019, 06:21   #5
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 53
Posts: 7,350
Donated: $60
Nick is on a distinguished road
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.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Two-weapon Fighting vs. Rapid Attack vs. Normal Attack? protopulse Sil 7 April 18, 2017 00:38
Close and bash doors with ctrl+direction fph Vanilla 7 September 19, 2011 14:49
Bug: "Find Traps, Doors & Stairs" doesn't work on chests Raggy Vanilla 26 June 29, 2011 14:28
High-Energy Magi ekolis Oook! 13 March 27, 2011 23:22
stochastic energy and fractional blows tigen Vanilla 22 September 13, 2009 22:47


All times are GMT +1. The time now is 05:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.