Repository navigation
Fix totem additional physical damage reduction not being shown - #10572
Open
lucaskarsten wants to merge 1 commit into
Open
lucaskarsten wants to merge 1 commit into
lucaskarsten wants to merge 1 commit into
Conversation
"Totems have X% additional Physical Damage Reduction" (Ancestral Preservation, Ironwood, Scourge) was parsed as a player PhysicalDamageReduction mod with the Totem keyword flag, which nothing reads. It is now a TotemPhysicalDamageReduction mod shown in Calcs next to Totem Armour, capped at the monster maximum (75%), which totems inherit from Monster.ot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #375 .
Description of the problem being solved:
"Totems have X% additional Physical Damage Reduction" (Ironwood 40% on the tree, the Ancestral Preservation cluster notable 15%, Scourge upsides) was caught by the generic
^totems haveprefix and became a playerPhysicalDamageReductionmod with the Totem keyword flag. Nothing reads it: the player's damage reduction is summed without a skill cfg, so the keyword-flagged mod is skipped, and no totem output uses it. The notable showed as supported but did nothing visible.Changes:
ModParser: the line now maps to a newTotemPhysicalDamageReductionBASE mod, next to the other totem defence mods (TotemElementalResist,TotemChaosResist).CalcOffence: newTotemPhysicalDamageReductionoutput in the totem block, next toTotemArmour, capped atdata.misc.EnemyPhysicalDamageReductionCap(75%). Totems are monsters: in the client,Metadata/Monsters/Totems/Totem.otextendsTotemBase, which extendsMetadata/Monsters/Monster, whosemaximum_physical_damage_reduction_% = 75; neither totem file overrides it.CalcSections: "Totem Phys. Dmg. Red." row under "Totem Armour".ModCache.lua: only the 5 "Totems have X% additional Physical Damage Reduction" lines change. A full regeneration on currentdevalso rewrites ~40 unrelated lines, so I left those out.Not changed: totem damage reduction and resistances are still not applied to the "damage taken from your totems before you" pool (it uses raw totem life, same as before).
Steps taken to verify a working solution:
TestDefence_spec.lua: Holy Flame Totem with 15% givesTotemPhysicalDamageReduction15, 60% + 40% gives 75 (cap), and the player'sPhysicalDamageReductionstays 0. It fails ondev(nil instead of 15) and passes with this PR. Removing the cap makes it fail (100 instead of 75).busted --lua=luajit: 929 / 929 passing (dev with only the new test: 928 / 929, the new test failing).--exclude-tags=none --tags=builds: 1264 ok / 900 failing on bothdevand this branch, with an identical list of failures.Link to a build that showcases this PR:
Any totem build with Ironwood allocated (tree notable, 40%) or a Medium Cluster Jewel with Ancestral Preservation (15%).
Checked headless on a real 3.29 build converted to the 3.30 tree, with Holy Flame Totem 20 as the main skill and Ironwood allocated (12 points with the path):
devBefore screenshot:
No totem physical damage reduction anywhere in Calcs.
After screenshot:
"Totem Phys. Dmg. Red." 40% under "Totem Armour" with Ironwood.