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

A good night sleep is healthy #57592

Merged
merged 4 commits into from Jul 14, 2022
Merged

Conversation

Fris0uman
Copy link
Contributor

@Fris0uman Fris0uman commented May 9, 2022

Summary

Balance "A good night sleep is healthy"

Purpose of change

Part of #37446

Describe the solution

  • get the rate fo fatigue recovery
  • compute effective_time_slept as time_slept_between_update * fatigue._recovery_rate
  • every turn if we were sleeping last turn add effective_time_slept to daily_sleep
  • every turn if we were sleeping last turn add effective_time_slept to continuous_sleep
  • on the turn we woke up check how long continuous_sleep is, if it's more than 6_hours record a "sleep_health_mult" value of 2
  • reset continuous_sleep to 0
  • every 12_hours add daily_sleep * sleep_health_mult number of hours to daily_health with a cap of +10
  • and set "sleep_health_mult" value to 1
  • every 24_hours set daily_sleep to 0

Describe alternatives you've considered

Also use value to store daily_sleep and continuous_sleep instead of adding two new variables to character

Testing

  • load new world
  • go to bed from 9pm to 4 am
  • wait untill noon > healthy_mod is at 9 instead of 0

Additional context

effective_time_slept takes mutation, pain, and hibernation into account. However in my test setting a debug breakpoint just after it's computed show it was 1 even for an elfe with Tireless mutation, so I don't know what was happening there

@Fris0uman Fris0uman requested a review from I-am-Erk May 9, 2022 20:37
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels May 9, 2022
@Termineitor244
Copy link
Contributor

Trait that reduce the need for sleep, don't factor here. I'm not sure how to add that.

You could factor them by giving additional turns in daily_sleep and continuous_sleep for those mutations every x turns too, so they don't need to sleep the same as everyone else (while they can't do it).

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 10, 2022
@I-am-Erk
Copy link
Contributor

I'd have reduced sleep mutations change the number of turns we add to daily_sleep unless you have no need to sleep at all, in which case we could either give a passive +5 health every 12 hours, or we could have daily sleep apply to resting

@Inglonias
Copy link
Contributor

Is there a particular reason this PR has stalled out, or has it just slipped through the cracks?

@kevingranade
Copy link
Member

There's some issue wuth basic build.

@kevingranade
Copy link
Member

Possibly kill this pr and push the branch to a new one? No idea why the build cancels.

@Fris0uman Fris0uman marked this pull request as draft June 26, 2022 10:10
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 26, 2022
@Fris0uman Fris0uman marked this pull request as ready for review June 26, 2022 13:17
@Fris0uman
Copy link
Contributor Author

I think we're good now and the failure are unrelated to this PR

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 13, 2022
@I-am-Erk I-am-Erk merged commit e13f282 into CleverRaven:master Jul 14, 2022
@Fris0uman Fris0uman deleted the beauty_sleep branch July 19, 2022 21:35
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 [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants