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: reapplying conditions no longer removes them #298

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SondreElg
Copy link
Contributor

Add functions addCondition and removeCondition to creature.ts to allow for better handling of conditions. Add remove_status field to CreatureUpdate, which is used to call creature.removeCondition. Add remove_status to logger.types.ts and move logging of condition removal to the logger

Pull Request Description

Change behaviour upon reapplying a condition to not change the state of the tracker if the conditions are considered equal.
Note that comparisons on IDs is specifically not done in order to avoid problems with improvised conditions.

Changes Proposed

  • Reapplying a condition no longer removes it from a creature
  • Handle adding and removing conditions as separate operations
  • Move logic for logging removing conditions to the logger

Related Issues

Fixes #297

Checklist

  • I have read the contribution guidelines and code of conduct.
  • I have tested the changes locally and they are working as expected.
  • I have added appropriate comments and documentation for the code changes.
  • My code follows the coding style and standards of this project.
  • I have rebased my branch on the latest main (or master) branch.
  • All tests (if applicable) have passed successfully.
  • I have checked for any potential security issues or vulnerabilities.

Additional Notes

I haven't run my linter as my and Javelent's settings are different and cause massive merge conflicts, but I've taken care to style the changes properly.

Add functions addCondition and removeCondition to creature.ts to allow for better handling of conditions.
Add remove_status field to CreatureUpdate, which is used to call creature.removeCondition.
Add remove_status to logger.types.ts and move logging of condition removal to the logger
@SondreElg SondreElg changed the title fix: reapplying conditions won't remove them fix: reapplying conditions no longer removes them Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐞 Reapplying conditions remove them
1 participant