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

workaround for "inaccurate" healing quality #75857

Closed

Conversation

sonphantrung
Copy link
Contributor

@sonphantrung sonphantrung commented Aug 21, 2024

Summary

None

Purpose of change

Fixes #75736
Every time the survivor bandages, the effect's intensity is added by 1, leading to the issue above.

Describe the solution

Worked around the problem by making it print out the same as when the char bandages

Describe alternatives you've considered

I could try and prevent it from adding intensity by 1, but then I realize it's also the same in stims (e.g. black coffee's 12 stim in the JSON gives the player "Stimulants [13]" effect). Even more so, the "issue" appears way back in 0.G. The DDA src rabbit hole is so huge.

Testing

Will try and compile it later on, but just let the tests do its job first.
Char with 3 Health Care + Wound Care
image
image

Additional context

Yeah yeah I'll compile

@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Aug 21, 2024
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 21, 2024
Why the hell did I overlook such obvious stuff????
@sonphantrung
Copy link
Contributor Author

I think it can be merged now.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 22, 2024
@akrieger
Copy link
Member

I don't really like the idea of sprinkling random +1s around? Wouldn't it be better to take away the random +1 thats happening? Where is that?

@sonphantrung
Copy link
Contributor Author

sonphantrung commented Aug 28, 2024

I don't really like the idea of sprinkling random +1s around? Wouldn't it be better to take away the random +1 thats happening? Where is that?

Yay, a response! To answer your question, the code for adding +1 to the effect intensity resides right here. The line (via git blame) is quite old, so IDK whether it's intended or not.

@akrieger
Copy link
Member

akrieger commented Aug 28, 2024

Yeah pretty sure if I were to implement that I'd have used e.set_intensity( std::max( 1, e.get_duration() / e.get_int_dur_factor() ) );

@akrieger
Copy link
Member

akrieger commented Aug 30, 2024

@sonphantrung can you try if the ceil max call I wrote fixes this from the other direction, by not unnecessarily buffing healing (or other low intensity effects)?

@sonphantrung
Copy link
Contributor Author

Yeah, I'm doing that one, but I think it should be std::max, as I don't think ceil function supports two arguments

@akrieger
Copy link
Member

akrieger commented Sep 2, 2024

I edited my comment to what I actually meant which correctly uses max, sorry :)

@sonphantrung
Copy link
Contributor Author

@akrieger
Copy link
Member

Aha. Try e.set_intensity( std::max( 1, static_cast<int>( e.get_duration() / e.get_int_dur_factor() ) ) );.

@Night-Pryanik
Copy link
Contributor

@sonphantrung is this ready?

@sonphantrung
Copy link
Contributor Author

Nah, should close this, as my goal now change from "sprinkling +1s" to "searching the problem that caused the +1 effect intensity".

@sonphantrung sonphantrung deleted the efficacy-workaround branch October 20, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disinfection and bandaging not acting as it should
3 participants