Skip to content

Fix totem additional physical damage reduction not being shown - #10572

Open
lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/375-totem-phys-reduction
Open

lucaskarsten wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
lucaskarsten:fix/375-totem-phys-reduction

Conversation

@lucaskarsten

@lucaskarsten lucaskarsten commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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 have prefix and became a player PhysicalDamageReduction mod 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 new TotemPhysicalDamageReduction BASE mod, next to the other totem defence mods (TotemElementalResist, TotemChaosResist).
  • CalcOffence: new TotemPhysicalDamageReduction output in the totem block, next to TotemArmour, capped at data.misc.EnemyPhysicalDamageReductionCap (75%). Totems are monsters: in the client, Metadata/Monsters/Totems/Totem.ot extends TotemBase, which extends Metadata/Monsters/Monster, whose maximum_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 current dev also 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:

  • New test in TestDefence_spec.lua: Holy Flame Totem with 15% gives TotemPhysicalDamageReduction 15, 60% + 40% gives 75 (cap), and the player's PhysicalDamageReduction stays 0. It fails on dev (nil instead of 15) and passes with this PR. Removing the cap makes it fail (100 instead of 75).
  • Full 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 both dev and 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):

dev this PR
TotemLife 2925 2925
TotemPhysicalDamageReduction nil (not shown) 40
Player PhysicalDamageReduction 0 0

Before screenshot:

No totem physical damage reduction anywhere in Calcs.

After screenshot:

"Totem Phys. Dmg. Red." 40% under "Totem Armour" with Ironwood.

"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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Ancestral Preservation Notable

1 participant