CleverRaven / Cataclysm-DDA

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

Change to Code fix for #71971 Water purification tablets only purify up to 4 water each #76326 #76387

Open Severhead opened 2 months ago

Severhead commented 2 months ago

Is your feature request related to a problem? Please describe.

Water purification tablets are designed for one qt army canteens which hold 6 charges of water.

Solution you would like.

Instead of purifying a bottle of water (4 charges) it should clean a canteen (6 charges)

Describe alternatives you have considered.

Increasing the amount cleaned to a 2 qt canteen with 12 charges of water

Additional context

Military grade tablets clean 1.5 liters or less in 30 minutes of time. National Stock Number (NSN) 6850-01-618-1533, or NIIN 016181533, (water purification tablet,iodine)

(FEAT) IODINE; 8 MG TABLET; BOTTLE OF 50 (SUFFICIENT FOR 25 WATER PURIFICATION TREATMENTS); SHELF LIFE IS 4 YEARS IF SEAL IS NOT BROKEN; SHELF LIFE REDUCED TO 1 YEAR WHEN SEAL IS BROKEN; KEEP AWAY FROM WATER OR HUMIDITY; EPA REGISTERED
ZeroInternalReflection commented 2 months ago

71971 was written with specific consumer tablets in mind (see notes I left in the json):

https://github.com/CleverRaven/Cataclysm-DDA/blob/5e06aadc2bd9419df972671786f73d09859f5f93/data/json/items/chemicals_and_resources.json#L1185-L1189

Given that many (but not all) of the tablet sources are military or military-adjacent, it might make sense to:

  1. Reconfigure to model the "military style" tablets rather than "camping style", or
  2. Have different "brands"/sizes of tablets (this would probably require separate water purification recipes, which might be annoying), or
  3. Bump up purification tablet spawns from military-related sources by 50-100% to handwave the different types

If someone wanted to change the ratio, then I think it's possible to do it locally within the json by changing the activation ratio here: https://github.com/CleverRaven/Cataclysm-DDA/blob/5e06aadc2bd9419df972671786f73d09859f5f93/data/json/items/chemicals_and_resources.json#L1196

And changing the recipe here (Wait, shouldn't that be water_murky, 4?): https://github.com/CleverRaven/Cataclysm-DDA/blob/5e06aadc2bd9419df972671786f73d09859f5f93/data/json/recipes/recipe_food.json#L101

The "making sure it purifies the water on activation" tests are unfortunately fairly strongly linked to the 1:4 ratio, so changing it in-repo would require c++ tinkering here: https://github.com/CleverRaven/Cataclysm-DDA/blob/5e06aadc2bd9419df972671786f73d09859f5f93/tests/iuse_test.cpp#L762 The different inventory scenarios being tested should be fairly self-explanatory, and it would just be a matter of updating the numbers to suit.