Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spell absorption capping #2680

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

petchema
Copy link
Collaborator

When absorbing magicka from own spells, DFU explicitly ensures that magicka recovered is not larger than the magicka that was used. For this, it needs to track how much magicka was spent for the last spell: lastReadySpellCastingCost

A special case was not correctly handled though: when the last spell came from a magic item, lastReadySpellCastingCost should be set 0 so that next absorption of own spells is not capped.
That worked by luck when the game was just started because lastReadySpellCastingCost was still 0, but broke after first spell casting.

Forums: https://forums.dfworkshop.net/viewtopic.php?t=6755

When absorbing magicka from own spells, DFU explicitly ensures that
magicka recovered is not larger than the magicka that was used.
For this, it needs to track how much magicka was spent for the last
spell: lastReadySpellCastingCost

A special case was not correctly handled though: when the last spell
came from a magic item, lastReadySpellCastingCost should be set 0 so
that next absorption of own spells is not capped.
That worked by luck when the game was just started because
lastReadySpellCastingCost was still 0, but broke after first spell
casting.

Forums: https://forums.dfworkshop.net/viewtopic.php?t=6755
@petchema petchema added the bug label Jul 30, 2024
@petchema
Copy link
Collaborator Author

petchema commented Aug 1, 2024

Test protocol:

  • notice current spellpoints
  • use the magic item to cast fireball at the facing wall
  • check that spellpoints increased by 62, cost of the fireball spell for the character
  • cast slowfall from the spellbook
  • notice current spellpoints
  • use the magic item to cast fireball at the facing wall
  • check that spellpoints increased by less than 62 (actually increased by the cost of slowfall)

(sorry for the traces of french translation mod in the save)
SAVE37.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants