Bugfixes Fungal infection and antifungal drug effects broken #52050
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.
Summary
Bugfixes "Fungal infection and antifungal drug effects broken"
Purpose of change
Fixes #51939
Fixes #52040
Update player_hardcoded_effects.cpp to account for the changes to fungicide and antifungal drug mechanics made in #42388. Previously those drugs removed the effect directly, but after the change, fungal infections and its removal is time based.
The fungal infection code previously was set to permanent which meant that any infection would not get removed with this new mechanic.
Describe the solution
Updated player_hardcoded_effects.cpp to make it so that spore caused fungal infection has an initial fungal infection of 15 minutes, and the teleglow fungal infection has an initial infection of 1 hour. Both infection methods are now not permanent.
Updated the static void eff_fun_fungus method to use add_effects with a timescale rather than mod_duration which did not seem to work.
If the player resists the infection due to poison resist or fungicide, then the fungal infection duration is reduced by 4 extra seconds (for a total of 5 seconds reduction per second elapsed). If the player does not resist, then the fungal infection duration is increased by 2 seconds (for an effective increase of 1 second of fungal infection duration).
This means that after 5:45 hours (for 1 spore based infection), they'll start to feel the effects of 2nd tier effects. If they get infected multiple times with spores, it'll be slightly quicker.
Describe alternatives you've considered
N/A
Testing
Created a new character and infected them with spores. Stepped into the new spore effect to guarantee fungal infection. Checked that the fungal infection duration is correct, and did a few steps to see that the duration went up. Waited until 6 hours for the second tier events happened. Took antifungal and waited an hour to see that the effect is gone.
Additional context