Repository navigation
Fix: Power Attack on natural attacks (1.5x Str, secondary halving) and lost temp bonuses on save - #7762
Conversation
Power Attack says the damage bonus is halved (-50%) for an off-hand weapon or a secondary natural weapon, but "Power Attack (Natural Secondary)" used the same PowerAttackDamageBase*PowerAttackModifier formula as the primary one, so a secondary natural attack got the full bonus. At BAB +7 an eidolon's tail slap gained +4 instead of +2. Halve the base the way "Two-Handed" and "Natural Primary - Single" scale theirs by 1.5, giving (PowerAttackDamageBase/2)*PowerAttackModifier. The to-hit penalty is unchanged - it is not halved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The "Power Attack (Natural Primary - Single)" virtual ability was dead code: it was only granted when the character had an Internal ability of TYPE.NaturalAttackPrimarySingle (nothing has that type) and its TEMPBONUS targeted weapon type NaturalPrimarySingle (no weapon has that type). As a result a primary natural weapon that adds 1-1/2x Str (e.g. a lone bite, or an eidolon bite with the Improved Bite evolution) only received the 1x Power Attack bonus instead of 1.5x. Wire it up to match the working 1x "Power Attack (Natural Primary)" ability: grant it on PREABILITY TYPE.NaturalAttackPrimary and target the real NaturalPrimary weapon type, keeping the intended 1.5x multiplier. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
With the previous commit both "Power Attack (Natural Primary)" and
"Power Attack (Natural Primary - Single)" are offered on any primary natural
weapon, and the player picks per weapon. "Single" gave no hint that it is
the one to use on an attack that adds 1-1/2x Strength, such as a lone bite
or a bite with the Improved Bite evolution.
TempBonusHelper builds an attack's bracket label from getKeyName(), so the
key is what the character sheet prints ("*Bite [Power Attack (Natural
Primary - 1.5x Str)]"). Rename the key along with the name and update the
ABILITY:FEAT|VIRTUAL reference that grants it. Nothing else in the data
refers to the old key, and before the previous commit the ability could not
be granted (it keyed off an Internal type nothing has), so no saved
character can have it applied.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…atural attacks The items in tempBonusItemList are reused on every rebuild, so addType(TEMPORARY) kept appending the type; only add it when it is not already present. Only offer "Power Attack (Natural Primary - 1.5x Str)" when the natural attack actually adds 1-1/2x Str: a lone natural attack (NaturalAttacks < 2) or the Improved Bite evolution. Adds PowerAttackNaturalAttackTest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rgets appendTempBonuses sorts the temp bonuses into a TreeSet whose comparator only looks at the bonus text, so two entries with the same text from different sources or targets compared equal and one was silently dropped. Applying Power Attack (Natural Primary) to a bite and Power Attack (Natural Secondary) to a tail slap saved the shared "WEAPON|TOHIT|-PowerAttackModifier" bonus for only one of them, so the other weapon lost its -2 to hit on reload. Break ties on the source/target name so every applied bonus is written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8b72f98 to
09bf655
Compare
|
@LegacyKing I will check Java, can you please check LST/DATA changes? |
|
@liao1994, Since you have written code with a bot, here is the reply from mine: The Java fixes look correct, and halving the secondary natural attack damage bonus matches the feat text. I’d like one data correction before approving: The new 1.5× eligibility restriction excludes Dragon Disciple’s Dragon Bite. In Please extend eligibility to cover this case and add a Dragon Disciple regression test. One smaller testing point: |
Dragon Bite is a primary natural attack that adds 1-1/2 times Strength, but it comes with the Draconic bloodline's two claws, so a dragon disciple has NaturalAttacks 3 and no Improved Bite: neither condition for "Power Attack (Natural Primary - 1.5x Str)" held and the variant was not offered for the bite. Add Dragon Disciple ~ Dragon Bite to the abilities that qualify, and test a Sorcerer 1 (Draconic) / Dragon Disciple 2 with claws and a bite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
savingKeepsTheSameToHitBonusOnEachNaturalWeapon only looked for both TEMPBONUS lines in the saved PCG text. Rename it to saveAndReloadKeepsPowerAttackOnEachNaturalWeapon: it now saves the eidolon to a file, opens it again and checks that the bite and the tail slap each still get their Power Attack to-hit penalty and damage bonus (-2/+4 and -2/+2). Without the PCGVer2Creator fix the reloaded bite gets 0 instead of -2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @Vest, both points are addressed in two new commits:
|
LegacyKing
left a comment
There was a problem hiding this comment.
We've added a counter var NaturalAttacks. I'm not seeing how that propogated to the creatures with natural attacks, but overall, seems like a safe change. I approve.
| Pinpoint Targeting CATEGORY:FEAT TYPE:Combat PREABILITY:3,CATEGORY=FEAT,Improved Precise Shot,Point-Blank Shot,Precise Shot PREMULT:1,[PREVARGTEQ:PreStatScore_DEX,19],[PREVARGTEQ:FeatDexRequirement,19] PRETOTALAB:16 DESC:You can target the weak points in your opponent's armor. SOURCEPAGE:p.131 BENEFIT:As a standard action, make a single ranged attack. The target does not gain any armor, natural armor, or shield bonuses to its Armor Class. You do not gain the benefit of this feat if you move this round. | ||
| Point-Blank Shot CATEGORY:FEAT TYPE:Combat DESC:You are especially accurate when making ranged attacks against close target. BONUS:COMBAT|TOHIT-SHORTRANGE,DAMAGE-SHORTRANGE|1 SOURCEPAGE:p.131 BENEFIT:You get a +1 bonus on attack and damage rolls with ranged weapons at ranges of up to 30 feet. | ||
| Power Attack CATEGORY:FEAT TYPE:Combat.AttackOption PRETOTALAB:1 PREVARGTEQ:PreStatScore_STR,13 DEFINE:PowerAttackModifier|0 DEFINE:MonkFlurryPowerAttackModifier|0 DEFINE:PowerAttackDamageModifier|0 DEFINE:PowerAttackDamageBase|0 DESC:You can make exceptionally deadly melee attacks by sacrificing accuracy for strength. ABILITY:FEAT|VIRTUAL|Power Attack (Light)|Power Attack (Off-Hand)|Power Attack (One-Handed)|Power Attack (Two-Handed) ABILITY:FEAT|VIRTUAL|Power Attack (Flurry)|PRECLASS:1,Monk=1 ABILITY:FEAT|VIRTUAL|Power Attack (Natural Secondary)|PREABILITY:1,CATEGORY=Internal,TYPE.NaturalAttackSecondary ABILITY:FEAT|VIRTUAL|Power Attack (Natural Primary)|PREABILITY:1,CATEGORY=Internal,TYPE.NaturalAttackPrimary ABILITY:FEAT|VIRTUAL|Power Attack (Natural Primary - Single)|PREABILITY:1,CATEGORY=Internal,TYPE.NaturalAttackPrimarySingle BONUS:VAR|PowerAttackModifier|(BAB/4)+1 BONUS:VAR|PowerAttackDamageBase|2 BONUS:VAR|PowerAttackDamageModifier|PowerAttackDamageBase*floor(PowerAttackModifier) BONUS:VAR|MonkFlurryPowerAttackModifier|BAB+(FlurryLVL-MonkBAB) SOURCEPAGE:p.131 BENEFIT:You can choose to take a -%1 penalty on all melee attack rolls and combat maneuver checks to gain a +%2 bonus on all melee damage rolls. This bonus to damage is increased by half (+50%%) if you are making an attack with a two-handed weapon, a one handed weapon using two hands, or a primary natural weapon that adds 1-1/2 times your Strength modifier on damage rolls. This bonus to damage is halved (-50%%) if you are making an attack with an off-hand weapon or secondary natural weapon. You must choose to use this feat before making an attack roll, and its effects last until your next turn. The bonus damage does not apply to touch attacks or effects that do not deal hit point damage.|PowerAttackModifier|PowerAttackDamageModifier | ||
| Power Attack CATEGORY:FEAT TYPE:Combat.AttackOption PRETOTALAB:1 PREVARGTEQ:PreStatScore_STR,13 DEFINE:PowerAttackModifier|0 DEFINE:MonkFlurryPowerAttackModifier|0 DEFINE:PowerAttackDamageModifier|0 DEFINE:PowerAttackDamageBase|0 DEFINE:NaturalAttacks|0 DESC:You can make exceptionally deadly melee attacks by sacrificing accuracy for strength. ABILITY:FEAT|VIRTUAL|Power Attack (Light)|Power Attack (Off-Hand)|Power Attack (One-Handed)|Power Attack (Two-Handed) ABILITY:FEAT|VIRTUAL|Power Attack (Flurry)|PRECLASS:1,Monk=1 ABILITY:FEAT|VIRTUAL|Power Attack (Natural Secondary)|PREABILITY:1,CATEGORY=Internal,TYPE.NaturalAttackSecondary ABILITY:FEAT|VIRTUAL|Power Attack (Natural Primary)|PREABILITY:1,CATEGORY=Internal,TYPE.NaturalAttackPrimary ABILITY:FEAT|VIRTUAL|Power Attack (Natural Primary - 1.5x Str)|PREABILITY:1,CATEGORY=Internal,TYPE.NaturalAttackPrimary|PREMULT:1,[PREVARLT:NaturalAttacks,2],[PREABILITY:1,CATEGORY=Special Ability,Evolution ~ Improved Bite,Temp Evolution ~ Improved Bite,Dragon Disciple ~ Dragon Bite] BONUS:VAR|PowerAttackModifier|(BAB/4)+1 BONUS:VAR|PowerAttackDamageBase|2 BONUS:VAR|PowerAttackDamageModifier|PowerAttackDamageBase*floor(PowerAttackModifier) BONUS:VAR|MonkFlurryPowerAttackModifier|BAB+(FlurryLVL-MonkBAB) SOURCEPAGE:p.131 BENEFIT:You can choose to take a -%1 penalty on all melee attack rolls and combat maneuver checks to gain a +%2 bonus on all melee damage rolls. This bonus to damage is increased by half (+50%%) if you are making an attack with a two-handed weapon, a one handed weapon using two hands, or a primary natural weapon that adds 1-1/2 times your Strength modifier on damage rolls. This bonus to damage is halved (-50%%) if you are making an attack with an off-hand weapon or secondary natural weapon. You must choose to use this feat before making an attack roll, and its effects last until your next turn. The bonus damage does not apply to touch attacks or effects that do not deal hit point damage.|PowerAttackModifier|PowerAttackDamageModifier |
There was a problem hiding this comment.
Looks like we added a new define... lst here looks fine.
| Power Attack (Two-Handed) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,TwoHanded;OneHanded;Natural|WEAPON|TOHIT|-PowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,TwoHanded;OneHanded;Natural|WEAPON|DAMAGE|(PowerAttackDamageBase*1.5)*PowerAttackModifier|TYPE=Temporary | ||
| Power Attack (Flurry) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,Unarmed,Special,Monk|WEAPON|TOHIT|-MonkFlurryPowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,Unarmed,Special,Monk|WEAPON|DAMAGE|PowerAttackDamageBase*MonkFlurryPowerAttackModifier|TYPE=Temporary | ||
| Power Attack (Natural Secondary) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalSecondary|WEAPON|TOHIT|-PowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalSecondary|WEAPON|DAMAGE|PowerAttackDamageBase*PowerAttackModifier|TYPE=Temporary | ||
| Power Attack (Natural Secondary) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalSecondary|WEAPON|TOHIT|-PowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalSecondary|WEAPON|DAMAGE|(PowerAttackDamageBase/2)*PowerAttackModifier|TYPE=Temporary |
There was a problem hiding this comment.
Formula changed here. Seems reasonable.
| Power Attack (Natural Secondary) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalSecondary|WEAPON|TOHIT|-PowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalSecondary|WEAPON|DAMAGE|(PowerAttackDamageBase/2)*PowerAttackModifier|TYPE=Temporary | ||
| Power Attack (Natural Primary) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalPrimary|WEAPON|TOHIT|-PowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalPrimary|WEAPON|DAMAGE|PowerAttackDamageBase*PowerAttackModifier|TYPE=Temporary | ||
| Power Attack (Natural Primary - Single) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalPrimarySingle|WEAPON|TOHIT|-PowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalPrimarySingle|WEAPON|DAMAGE|(PowerAttackDamageBase*1.5)*PowerAttackModifier|TYPE=Temporary | ||
| Power Attack (Natural Primary - 1.5x Str) KEY:Power Attack (Natural Primary - 1.5x Str) CATEGORY:FEAT VISIBLE:NO TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalPrimary|WEAPON|TOHIT|-PowerAttackModifier|TYPE=Temporary TEMPBONUS:EQ|Weapon,Melee,Natural,NaturalPrimary|WEAPON|DAMAGE|(PowerAttackDamageBase*1.5)*PowerAttackModifier|TYPE=Temporary |
There was a problem hiding this comment.
Renamed a feat, and it's referenced earlier, so that looks fine.
🚧 PCGen Code Coverage
|
Fixes #7695
On a primary natural weapon that adds 1-1/2x Str (a lone bite, or a bite with Improved Bite), the natural-attack Power Attack options only gave the 1x damage bonus. The 1.5x natural-attack ability existed in the data but could never be granted.
This PR also fixes:
PCGVer2Creator.appendTempBonusessorted temp bonuses with a comparator that ignored the source and target, so an identical temp bonus applied to two different targets (e.g. two weapons) was saved for only one of them. With Power Attack on both a bite and a tail slap, one of the two weapons (the bite, in the test) lost its to-hit penalty after reload. Ties are now broken on the source/target name.The commits are meant to be reviewed one at a time. Each is one self-contained change with its own message; the commit that limits the 1.5x option also carries the small TEMPORARY-type fix.
PowerAttackNaturalAttackTest(slowtest) covers all of the above, including a save and reload.Not changed here:
Power Attack (Two-Handed),(One-Handed)and(Light)also listNaturalin their weapon targets, so Two-Handed's 1.5x is still offered on any natural weapon, as on master.🤖 Generated with Claude Code