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

Fixed Coughing during a cold prevents sleeping even when Dead Tired #35372

Merged
merged 5 commits into from
Nov 7, 2019

Conversation

Ramza13
Copy link
Contributor

@Ramza13 Ramza13 commented Nov 7, 2019

Summary

SUMMARY: Bugfixes "Fixed Coughing during a cold prevents sleeping even when Dead Tired"

Purpose of change

Fixes #33588
Fixes cough suppression not preventing stamina loss for prevented harmful coughs
Greatly reduced chances of waking up from coughing. Reduced fatigue recovery shortly after coughing.

Describe the solution

Moved cough suppression return code to top
Removed chance to wake up from cough method. There is still a chance to wake up based on the sound but its more realistically frequent. Added effect coughing for 5 minutes after coughing that reduces fatigue recovery while sleeping

Describe alternatives you've considered

I attempted to build an option to auto retry sleeping after waking, but couldn't get it to feel/work right.

Testing

Additional context

@Night-Pryanik
Copy link
Contributor

This could lead to eternal sleep if one is coughing too frequently while sleeping?

@Ramza13
Copy link
Contributor Author

Ramza13 commented Nov 7, 2019

This could lead to eternal sleep if one is coughing too frequently while sleeping?

Hmmm, I guess that's true it didn't happen with the flu but under the right circumstances it could. Shoot.

@Ramza13 Ramza13 changed the title Fixed Coughing during a cold prevents sleeping even when Dead Tired WIP Fixed Coughing during a cold prevents sleeping even when Dead Tired Nov 7, 2019
@Ramza13 Ramza13 changed the title WIP Fixed Coughing during a cold prevents sleeping even when Dead Tired Fixed Coughing during a cold prevents sleeping even when Dead Tired Nov 7, 2019
@I-am-Erk
Copy link
Member

I-am-Erk commented Nov 7, 2019

I think the fatigue effect is a really good idea... Could you store how much fatigue is being generated, and have it applied as an effect upon waking up? Maybe with a cap so that at worst you're still not quite as bad as if you hadn't slept at all?

@Ramza13 Ramza13 changed the title Fixed Coughing during a cold prevents sleeping even when Dead Tired WIP Fixed Coughing during a cold prevents sleeping even when Dead Tired Nov 7, 2019
@Ramza13 Ramza13 changed the title WIP Fixed Coughing during a cold prevents sleeping even when Dead Tired Fixed Coughing during a cold prevents sleeping even when Dead Tired Nov 7, 2019
@Ramza13
Copy link
Contributor Author

Ramza13 commented Nov 7, 2019

To prevent infinite sleeping I changed it so that now for five minutes after coughing you only recover half as much fatigue from sleeping.

@curstwist curstwist added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Character / Player Character / Player mechanics labels Nov 7, 2019
@I-am-Erk
Copy link
Member

I-am-Erk commented Nov 7, 2019

That's a very good fix

@ZhilkinSerg ZhilkinSerg merged commit 1472e72 into CleverRaven:master Nov 7, 2019
AMurkin pushed a commit to AMurkin/Cataclysm-DDA that referenced this pull request Nov 13, 2019
…leverRaven#35372)

* rebalance cough

* Fix cough suppresion and make effects smaller but more frequent

* Remove fatigue effect

* changed balance to reduce fatigue restore

* Changed name to be less confusing
AMurkin added a commit to AMurkin/Cataclysm-DDA that referenced this pull request Nov 13, 2019
@l29ah
Copy link
Contributor

l29ah commented Jan 18, 2020

Re-tested with the saved game from #33588, and i still wake up after 1-3 coughs.

@l29ah
Copy link
Contributor

l29ah commented Jan 18, 2020

Oh, that was because i had enhanced hearing enabled.

@Ramza13 Ramza13 deleted the cough_rebalance branch November 17, 2021 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coughing during a cold prevents sleeping even when Dead Tired
6 participants