Add support for Cost Efficiency mods #1313
Merged
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.
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
costslist, 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:
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:
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:
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.