Move spell cost calculation up slightly to account for spell cost ternaries #69760
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.
Summary
Infrastructure "Move spell cost calculation up slightly to account for spell cost ternaries"
Purpose of change
Ternaries in spell costs were working the opposite of the way the interface indicated they should work.
Describe the solution
Based on suggestion from andrei8l, move the spell cost deduction to before spell effects are applied.
Fixes #69751
Describe alternatives you've considered
Testing
Cast Karma Arms--it now costs 200 to apply and 0 to remove.
Cast Speak Through the Aether (cost 450 mana), spell cost properly deducted.
Cast Taze (cost 30 bionic power), spell cost properly deducted.
Channel Fountain of Flames (cost : of Stamina bar), power cost properly deducted.
Cast Spear of Brambles (cost 450 mana, components required), spell cost properly deducted, components consumed.
Cast Debug HP Spell (Cost | of HP bar), spell cost properly deducted.
All spells produced the appropriate effects (except for Debug HP spell, I got an error about a missing effect, but the cost worked)
Additional context