habitica
habitica copied to clipboard
Show a notification when a critical hit occurs while using a spell.
Fixes #8128
Changes
In this PR, a "critBonus" return value is added to the "cast" method for spells. This value can be any of the following:
- If the spell cannot result in a critical hit, the "cast" method will return nothing and "critBonus" will be undefined.
- If the spell can result in a critical hit but a critical hit does not occur, the method will return 1.
- If the spell can result in a critical hit and a critical hit occurs, the method will return the value of the critical hit which will be over 1.
After calling the cast method, this PR will evaluate the "critBonus" return value and show a critical hit message if one is applicable. This has been added to all 3 of the spells that can cause a critical hit. (Brutal Smash, Burst of Flames, and Backstab)
Additionally, it seems that "package-lock.json" was added to this PR. I don't have experience with what that is but I asked ChatGPT and it said: "Including the package-lock.json file in the PR helps ensure that everyone working on the project is working with the same dependencies and reduces the likelihood of version conflicts or unexpected behavior due to inconsistent package versions. It is generally recommended to include the package-lock.json file in your version control system (e.g., Git) to ensure consistent and reproducible builds across different environments and collaborators."
That being said, if you would like me to remove that file from the PR, I can do that.
UUID: 88cf9b3e-5150-4298-ae14-b8b64e0b36a2