Skip to content

Conversation

@majochem
Copy link
Contributor

Description of the problem being solved:

Adds support for several "leech based on x" mods including (but not limited to):

  • "Walker of the Wilds" Keystone
  • "Sap of Nightmares" (Acolyte of Chayula Ascendancy Node)
  • "Spire of Ire" unique spear

This also refactors the area of the code that determines base leech values and standardizes some of the flag naming logic for previously existing mods.

Finally, it also adds two technical things:

  1. A new function hasTag to modlib in ModTools.lua that determines whether a mod includes a given specific tag. From what I could tell this functionality did not previously exist, but was very useful when converting phys leech without deleting the original mod (as it might apply multiple times) and also helps to prevent adding a tag multiple times. Pretty sure that it could be useful in other scenarios as well.
  2. A way to force a condition to be true/false via the cfg passed to ModStore:GetCondition. I had a problem with this because I needed to tabulate the values for physical leech, even though they were not applying due to the flag that disables them. Adding an option to force the value for a single calculation seemed easier than actually changing the condition on the actor, only to change it back after.

Steps taken to verify a working solution:

  • Relevant mods get parsed correctly (appear blue)
  • Mods only apply to respective resources (Life/Mana/ES) unless generic leech (then applies to all)
  • "instead of physical" wording disables physical leech, whereas "as well as" keeps it intact
  • Mods get "converted" properly for respective damage types (Chaos, Cold, Fire, Lightning) and "Elemental" works for Cold, Fire, Lightning
  • Multiple mods affecting leech conversion interact correctly
    • If one mod specifies "instead" it supersedes the "as well"
    • Adding e.g. "lightning" leech when you already have "elemental" leech has no effect
  • Ensure relevant new mods & flags appear in Calcs breakdown

Link to a build that showcases this PR:

Leech Test Build
includes items for testing different combinations

After screenshot:

Leech Breakdown without converion
image
Leech Breakdown with conversion (note that the item mod now specifies "elemental leech" instead of physical leech
image

image image

Intent was to standardize mod phrasing and logic, as well as reducing
repetition of code.
There was no easy existing way to check if a specific tag is already
present on a on mod (Or I couldn't find it)
So I added a function for it, which makes it easy to check for, add, or
replace/modify specific tags
It was kinda hard to tell `ModStore:GetCondition` to assume a condition
is `false` without changing the actual conditions on the actor, so I
added the opton to force the value via `cfg.overrideCond`.

I needed to force the condition because I wanted to tabulate mods that
do not apply, but are used as basis for the value of other mods. e.g.
Leech Elemental Damage *instead* of Physical Damage
Better handling of actual conversion of mods with the correct tags for
display in breakdown later
This adds general support for parsing most expected forms of leech
conversion mods.

Specific mods now supported:
- Sap of Nightmares (Acolyte of Chayula)
- Mystic Harvest (Amazon)
- Spire of Ire (Unique Helix Spear)
Mostly just for testing, as these mods don't exist in the game yet, but
might be added in the future via unique items.
@majochem majochem marked this pull request as ready for review September 10, 2025 14:59
@LocalIdentity LocalIdentity added the enhancement New feature, calculation, or mod label Sep 12, 2025
@LocalIdentity LocalIdentity merged commit 17a473f into PathOfBuildingCommunity:dev Sep 12, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, calculation, or mod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants