feat(content): Add sleepdebt effect #3673
Merged
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.
Purpose of change
We had no way of using effects to add or remove sleep deprivation, now we do.
Describe the solution
It appears under effect.cpp adding a new "member" for SLEEPDEBT and the relevant json fields happen there, and under character_turn.cpp is the part that hooks into mod_sleep_deprivation to cause the relevant effect to change a players stats.
I don't know the underlying code, this was reworked from the thirst effect and modified to work for sleep.
Describe alternatives you've considered
scream
Testing
I loaded one of my old worlds from 0.4 stable and this change had no related bugs. I have successfully tested it using a spell effect from my mod. You can add the json field
"sleepdebt_min": [ -100 ]
to any effect you want on testing.Additional context
Here's some screenshots.
We need to update all effects documentation. That is out of scope right now.
Checklist
If this is a C++ PR that modifies JSON loading or behavior:
doc/
folder.