Skip to content

Conversation

@Wires77
Copy link
Member

@Wires77 Wires77 commented Sep 5, 2025

Inspired by @Nostrademous I had Claude Sonnet 4 take a crack at these mods. Below is the summary it created. I'll have it update the tests too. The AI added Spirit costs, which I don't think will ever be a thing, especially considering it's not even in the costs list, so I'll probably end up removing that one.

Summary

I have successfully implemented cost efficiency modifier support in Path of Building PoE2, similar to the existing ReservationEfficiency modifiers. Here's what I've added:

  1. ModParser.lua Changes
    Added parsing support for cost efficiency modifiers in the stat translation table:

cost efficiency → CostEfficiency (generic cost efficiency)
cost efficiency of skills → CostEfficiency
mana cost efficiency → ManaCostEfficiency
mana cost efficiency of skills → ManaCostEfficiency
life cost efficiency → LifeCostEfficiency
life cost efficiency of skills → LifeCostEfficiency
spirit cost efficiency → SpiritCostEfficiency
spirit cost efficiency of skills → SpiritCostEfficiency
energy shield cost efficiency → ESCostEfficiency
es cost efficiency → ESCostEfficiency
soul cost efficiency → SoulCostEfficiency
rage cost efficiency → RageCostEfficiency
2. CalcOffence.lua Changes
Modified the cost calculation logic to include cost efficiency modifiers:

Cost Calculation: Added cost efficiency as a divisor in the cost calculation formula, similar to how reservation efficiency works:

local costEfficiency = calcLib.mod(skillModList, skillCfg, val.type.."CostEfficiency", "CostEfficiency")
output[costName] = m_max(0, output[costName] / m_max(0.01, costEfficiency))

Both Code Paths: Applied cost efficiency to both the main cost calculation path and the "unaffected by generic cost multipliers" path, ensuring all costs can benefit from efficiency modifiers.

Breakdown Display: Added cost efficiency information to the cost breakdown display:

if costEfficiency ~= 1 then
    t_insert(breakdown[costName], s_format("/ %.2f ^8("..val.text.." cost efficiency)", costEfficiency))
end

How It Works

Cost efficiency works exactly like reservation efficiency:

Base efficiency: 1.0 (100%)
Higher efficiency values = lower costs (e.g., 1.5 efficiency = 67% of original cost)
Lower efficiency values = higher costs (e.g., 0.8 efficiency = 125% of original cost)
Minimum efficiency: 0.01 to prevent division by zero

Supported Cost Types

The implementation supports efficiency modifiers for all cost types present in the game:

Mana costs
Life costs
Energy Shield costs
Spirit costs
Soul costs
Rage costs
This implementation follows the same patterns and conventions used for reservation efficiency in the existing codebase, ensuring consistency and maintainability.

@Wires77 Wires77 added the enhancement New feature, calculation, or mod label Sep 5, 2025
@LocalIdentity LocalIdentity merged commit e17b74e into dev Sep 9, 2025
2 checks passed
@LocalIdentity LocalIdentity deleted the cost_efficiency branch September 9, 2025 09:45
@LocalIdentity LocalIdentity changed the title Implement parsing support for cost efficiency modifiers Implement parsing support for Cost Efficiency mods Sep 9, 2025
@LocalIdentity LocalIdentity changed the title Implement parsing support for Cost Efficiency mods Add support for Cost Efficiency mods Sep 9, 2025
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.

3 participants