CleverRaven / Cataclysm-DDA

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

Non-murky water ends up with parasites anyway #55101

Open CalKerethi opened 2 years ago

CalKerethi commented 2 years ago

Describe the bug

Drinking water from a water pump can give the survivor parasites. From a question on the new players thread. I think only dubious water from puddles and such should be triggering this.

Steps to reproduce

  1. Create a new character.
  2. Find a water pump (an LMOE shelter is a good bet) and drink from it a lot.
  3. Check your effects. "Debug Menu -> Info -> Generate effect list" is one way, there's probably an easier one I'm forgetting.
  4. Look for bloodworms, brainworms, or tapeworm effects.

Expected behavior

Base water doesn't look like it has the properties to apply parasites, so I would only expect it to be triggering them through the code that checks the MURKY terrain flag.

Screenshots

No response

Versions and configuration

Additional context

I ran out of time trying to track the bug down, but maybe the code for spawning murky water is setting parasites = 5 globally instead of to the specific instance of water it's creating, so all unclean water becomes parasite-ridden.

moxian commented 2 years ago

I ran out of time trying to track the bug down, but maybe the code for spawning murky water is setting parasites = 5 globally instead of to the specific instance of water it's creating, so all unclean water becomes parasite-ridden.

Yes, this is exactly what's happening.

There are exactly two pieces of code that set the parasites value - one handling player getting water from murky water https://github.com/CleverRaven/Cataclysm-DDA/blob/9fb7080268f2e90968a817175ca142f182441e43/src/map.cpp#L4623-L4624 and another that's generating terrain with the murky puddles on it at https://github.com/CleverRaven/Cataclysm-DDA/blob/9fb7080268f2e90968a817175ca142f182441e43/src/map.cpp#L1811-L1812

Both of those modify the parasites of the underlying islot_comestible which is shared by all items of this type and is supposed to be readonly. Which is also why the .parasites field is never serialized to json on save, among other things.

As i see it the solution here is either

(P.s.: i spent a bit of time debuging this but i'm not intending to work on the fix myself. Feel free to grab, and stuff)

NetSysFire commented 2 years ago

There are a few problems with parasites. Currently the least dangerous parasites are tapeworms, but regardless of the source you have a static chance of catching a given parasite:

https://github.com/CleverRaven/Cataclysm-DDA/blob/2c41bdfa83632eb67271facabdd8100f62183a5e/src/consumption.cpp#L1039-L1061

Both bloodworms and brainworms will wear you down extremely quickly, leaving you with Severe pain and no way out without antiparasitic drugs.

I tried hacking the code to modify that a bit, like only having a tiny chance of getting brainworms from unclean water but a much higher chance when consuming brains. But you can also get brainworms from e.g hot springs: https://en.wikipedia.org/wiki/Hot_spring#Precautions I am no C++ dev but I do not know if there is there an easy way to know where water came from (from e.g a puddle, toilet, swamp, river, well etc).

In real life, water from such pumps is not 100% safe, both because there is still a possibility for diseases and parasites, see https://en.wikipedia.org/wiki/Pump#Pumps_as_public_water_supplies

You would also have to deal with potential contaminated groundwater. Since the blob reached global groundwater saturation, I am not sure on the implications but I am more worried about humans and their toxic waste, leading to heavy metals in the water and stuff. This may be out of scope.

Maleclypse commented 2 years ago

do either bloodworms or brainworms have symptoms that can be identified on the @ menu so the player has some idea why they are getting sick? Tetanus was doing a flat -4 to dex but giving no indicators as to why you were experiencing a stat modifier.

LeahLuong commented 2 years ago

@Maleclypse #54896 came up recently & would seem to indicate even w/ debug info, bloodworms can be elusive to diagnose. I think brainworms are much more severe in their effects but I would have to look into it further.

Maleclypse commented 2 years ago

I’ll try to find symptoms the PC could feel that might be these parasites. Then I’ll try and find other diseases with similar symptoms to add lol.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.