Fix issue with converted damage showing no poison stacks
Fixes #8990.
Description of the problem being solved:
Fixed poison stacks showing 0 despite 100% poison chance when using multi-step damage conversion chains (e.g., Cold→Fire→Chaos→Poison). The issue occurred because Path of Building's ailment calculations only considered unconverted damage portions and didn't account for damage that becomes eligible for ailments through conversion chains.
Root causes addressed:
calcAilmentSourceDamage()only used unconverted damage, ignoring conversion contributions- Poison chance calculation didn't include
ChaosPoisonChancefor both hit and crit scenarios - No automatic enabling of
CanPoisonflags for damage types that convert to Chaos - Same issues affected ignite calculations with fire conversions
Steps taken to verify a working solution:
- Test Setup: 2x The Consuming Dark daggers + 2x The Pyre rings + Cold Snap of Power skill
- Conversion Chain: Cold (100%) → Fire (40% via Pyre) → Chaos (12% via Consuming Dark) → Poison (60% chance per dagger)
- Before Fix: Poison DPS = 0, Poison Stacks = 0 (capped to 1)
- After Fix: Poison DPS = 1,178.9, Poison Stacks = 0.67, Poison Chance = 100%
- Regression Testing: Verified pure chaos poison builds still work correctly
- Edge Case Testing: Tested partial conversions and multiple ailment scenarios
Link to a build that showcases this PR:
Path of Building test build:
- Skill: Cold Snap of Power
- Weapons: 2x The Consuming Dark (Fiend Dagger)
- Rings: 2x The Pyre (Sapphire Ring)
- Expected: Poison calculations now work with conversion chains
Before fix:
Poison DPS: 0, Poison Stacks: 0, despite showing 100% poison chance
After fix:
Poison DPS: 1,178.9, Poison Stacks: 0.67, Poison Chance: 100% (working correctly)
Technical Changes:
- Added
calcAilmentConversionMultiplier()function for multi-step conversion tracking - Enhanced
calcAilmentSourceDamage()to use conversion chains instead of just unconverted portions - Added automatic
CanPoison/CanIgniteflag enabling for converted damage types - Fixed poison chance calculations to include
ChaosPoisonChancefor both hits and crits - Applied same fixes to ignite calculations for fire conversions
- Added comprehensive safety checks to prevent nil reference errors
While to poison chance is now calculated correctly, I don't think it's working for Full DPS yet? Poison DPS doesn't appear when a skill is toggled for Full DPS, forcing 100% Chance to Poison in Custom Modifiers makes the calculation correct.