Multiple item actions possible in JSON

is it possible for one item to have multiple action items specified? Like one drug having an ability to act as a weak painkiller and weak disinfectant? Is it possible to do this in JSON?

Yes, you just specify the use actions in an array.

cdda->data->json->items->comestibles->meds seems to be where a lot of the drug json is stored.

If the following is too long, the json text file is easy enough to understand that you don’t need to read further.

use_action is where a lot of the properties are specified. From what I see, the stimulation bonus, morale bonus, health bonus, and addiction chance are specified outside of the use_action object.

There are two types of use_action, at least for drugs. There is consume_drug, meaning you just eat it, and then there is heal, where you choose which limb to apply the drug to.

You will probably use the heal type, since you disinfect specific limbs on the body, and then you can add the effects array to it.

example (item is based on disinfectant, and changes are in bold italics):
“id”: “test”,
“type”: “COMESTIBLE”,
“comestible_type”: “MED”,
“name”: “test”,
“description”: " This item is based on disinfectant. All the properties are the same except the words in bold italics ",
“weight”: 27,
“volume”: 1,
“price”: 1500,
“charges”: 10,
“symbol”: “~”,
“color”: “light_cyan”,
“phase”: “liquid”,
“container”: “bottle_plastic_small”,
“use_action”: { “type”: “heal”, “disinfectant_power”: 4, “bite”: 0.95, “move_cost”: 100, “effects”: [ { “id”: “pkill1”, “duration”: 100 } ] }
So the effects array will result in the disinfectant causing a painkiller effect with a bit less duration than aspirin (aspirin’s duration is 120).

1 Like