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

Spell swap target HP into MP not working #957

Closed
lucas-tardivo opened this issue Oct 13, 2021 · 1 comment · Fixed by #949
Closed

Spell swap target HP into MP not working #957

lucas-tardivo opened this issue Oct 13, 2021 · 1 comment · Fixed by #949
Labels
bug Something isn't working

Comments

@lucas-tardivo
Copy link
Contributor

Describe the bug
Actually, in the Attack() method, the baseDamage is being used on the damagingAttack boolean, which is also used on secondaryDamage attack. This means that when you're trying to swap targets HP into MP, the damagingAttack boolean is set to true since baseDamage > 0, but an if (secondaryDamage < 0 && damagingAttack) sets the secondaryDamage to 0, ignoring the swap.
Also, this lead us to another problem. Since the damagingAttack depends on baseDamage, it will be always false when trying to damage only enemies MP. In that case, if the CalculateFormula brings the secondaryDamage below 0, the if will not work and the damaging MP will turn into healing MP.

Version Encountered
b7

To Reproduce
Steps to reproduce the behavior 1:

  1. Create an combat targetted spell
  2. Set HP Damage to 5
  3. Set MP Damage to -5
  4. Test and the swap will not work

Steps to reproduce the behavior 2:
5. Set only the MP Damage to 1 and HP damage to 0
6. Modify the Formula to consider target defense against MP Damage
7. Create a NPC with too much defense
8. Test and the MP damaging will become MP healing

Expected behavior
Swap will not work at behavior 1 and MP Damage will become healing at behavior 2

@lucas-tardivo lucas-tardivo added the bug Something isn't working label Oct 13, 2021
@Cheshire92 Cheshire92 linked a pull request Oct 13, 2021 that will close this issue
@Cheshire92
Copy link
Contributor

Fixed on development branch with the merge of #949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants