CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.66k stars 4.18k forks source link

Hibernation mutation is not functioning #34645

Open AllSystemsGo opened 5 years ago

AllSystemsGo commented 5 years ago

Describe the bug

The hibernation mutation does not appear to be functioning

Steps To Reproduce

Steps to reproduce the behavior:

  1. Start a game, debug in ursine mutations, notably hibernation, and some food and water
  2. Open the mutation window, and activate hibernation.
  3. Notice that there are no text prompts after activating hibernation
  4. Proceed to eat and drink until engorged.
  5. Notice that fatigue does not increase.
  6. Notice that eating a lot can result in vomiting.
  7. Attempt to sleep, and fail.

Expected behavior

Screenshots

Versions and configuration

Additional context

Add any other context about the problem here.

snipercup commented 5 years ago

I got the following results using the steps you described:

  1. wished the hybernation mutations after I wished the prereqs for it

  2. I activated hybernation

  3. I got this message: image

  4. Drank milk untill engorged

  5. I did get this message about 3x: image

But then I got tired: image

  1. I did not vomit from my milk.

  2. I slept: image

untill: image

AllSystemsGo commented 5 years ago

Sorry I should have been clearer about the text; You do get told it activates, but it should be telling you a lot more. Back in 0.D, it would tell you how close you were to filling up enough for hibernation as you ate, and how tired you were getting from eating. You would then eat until it told you you were ready to hibernate (not necessarily until you're 'engorged'), but trying to eat to this point on current builds will give you the 'you are forcing to eat' prompt, and then if you continue to eat you will vomit.

snipercup commented 5 years ago

Ah I see, I did get the 'force to eat' prompt but I chose no. Some time later I was not engorged anymore so I ate my milk again and the force to eat prompt showed again and I chose not to eat.

Maybe the messages were taken out by some PR?

AllSystemsGo commented 5 years ago

I guess it is possible, but I would think that - even with the additional messages removed - it would still make you tired enough to sleep.

I opened my old 0.D install to show that it used to look like: 2019-10-11 14_02_44-Cataclysm_ Dark Days Ahead - 0 C-34879-g0d38d2d

2019-10-11 14_00_07-Cataclysm_ Dark Days Ahead - 0 C-34879-g0d38d2d

yowshi commented 4 years ago

i think hibernation needs an entire rework. It doesn't seem to work right with the calories system. I'm having trouble even getting to trigger. and even then i only seem to sleep for a couple days. IRL bears store about 1 million calories in order to hibernate through the entire winter. Maybe we should base it around that?

Saicchi commented 3 years ago

This bug is still happening in 0.F-1687-gbadd5e3393. Here is the probable culprit: https://github.com/CleverRaven/Cataclysm-DDA/blob/37f60cd29312029d1bc9f5893fc41028d9446e65/src/player_hardcoded_effects.cpp#L943-L952

The player wakes up after their fatigue reaches 19, and instead of sleeping for 10_days, they wake up in less than a day. I suggest adding a trait check has_active_mutation( trait_HIBERNATE ) or Character::is_hibernating() to prevent the duration from being reset while it's active.

There are other issues with hibernation that weren't present in 0.E but are not present in 0.F: #30370

Hunger and thrist no longer goes this low so these messages won't show up. https://github.com/CleverRaven/Cataclysm-DDA/blob/2e01ea8f9728fc563e0e47897a09dd227340f991/src/handle_action.cpp#L1093-L1094

const bool hibernate = you.has_active_mutation( trait_HIBERNATE );

https://github.com/CleverRaven/Cataclysm-DDA/blob/f56e69033ea8c1f68cb7fd16a575fedea3b8cd40/src/consumption.cpp#L926-L931

https://github.com/CleverRaven/Cataclysm-DDA/blob/f56e69033ea8c1f68cb7fd16a575fedea3b8cd40/src/consumption.cpp#L1420-L1428