Open IdleSol opened 2 months ago
I think I'm right. I changed the duration parameter:
{
"type": "effect_type",
"id": "pkill1_nsaid",
-- "max_duration": "4 m",
++ "max_duration": "4 h",
"base_mods": { "pkill_tick": [ 42 ], "pkill_min": [ 1 ], "pkill_max_val": [ 15 ] },
"rating": "good",
"blood_analysis_description": "Minor Painkiller (NSAID-based)"
},
Minor Painkiller (NSAID-based)
effect is gone after 2.5 hours (or 9000 seconds). The Painkiller
effect disappeared after about 3 hours. Which tells us that its duration is somehow related to the duration of the Minor Painkiller
effect.
Another problem. For the test, I specifically selected the time for ease of counting. So, for the test, I took the pill at 9:00:00. The vitamins were added 30 minutes later, at 9:30. Great?
But if I take the pill at 8:59:50. I'll get the vitamins at 9:00. That's 10 seconds later. Although the documentation says 30 minutes, without specifying that the cycle is hard-coded somewhere.
Describe the bug
It's me again and medicine again. I'll start right away by saying that maybe this is my misconception of how this all works.
Let me start with the initial data: the corresponding json https://github.com/CleverRaven/Cataclysm-DDA/blob/5f6f5e06a32ce82eac22e3ccebac27f1d1640c0f/data/json/items/comestibles/med.json#L150
https://github.com/CleverRaven/Cataclysm-DDA/blob/65aca7f154933aa62002d95d3e178a0fe8619452/data/json/effects.json#L2460
https://github.com/CleverRaven/Cataclysm-DDA/blob/65aca7f154933aa62002d95d3e178a0fe8619452/data/json/vitamin.json#L75
My expectations:
"effects": [ { "id": "pkill1_nsaid", "duration": 9000 } ]
Minor Painkiller (NSAID-based)
. Based on"blood_analysis_description": "Minor Painkiller (NSAID-based)"
Based on the hidden parameter “dur_add_perc”. Defaults to 100%. https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/EFFECTS_JSON.md
The results I got: 00:00 - taking the first tablet 00:06 ... 00:40 00:45 ... 04:00 04:05 ...25:00 25:05
Additionally, I checked the increase in the duration of the effect of taking two tablets. 00:00 - taking the first tablet 00:06 - taking the second tablet Between 04:10 and 04:15, the Minor Painkiller (NSAID-based) effect disappears Between 26:05 and 31:10, the Painkiller effect disappears
Result
The effect duration specified in
"effects": [ { "id": "pkill1_nsaid", "duration": 9000 } ]
is ignored. Probably because it exceeds the maximum duration specified in"max_duration": "4 m",
. The effect lasts exactly 4 minutes.The simultaneous presence of two effects:
I'm basing it on the name on the blood test:
"blood_analysis_description": "Painkiller"
https://github.com/CleverRaven/Cataclysm-DDA/blob/65aca7f154933aa62002d95d3e178a0fe8619452/data/json/effects.json#L4267I assume that the occurrence of the Painkiller effect is hard-coded somewhere in the functions.
Attach save file
n/a
Steps to reproduce
n/a
Expected behavior
n/a
Screenshots
No response
Versions and configuration
cdda-windows-tiles-x64-2024-10-04-0532
Additional context
UPD. I forgot to mention the vitamins.
Their performance is completely as expected. After 30 minutes I was getting 215 (instead of 216) vitamins each. Every 100 seconds I lost 1. The maximum number of vitamins is 432. I.e. fully consistent with json. Except that one vitamin is lost immediately upon consumption.