Comestible JSON Info: Difference between revisions

From The Cataclysm: Dark Days Ahead Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(19 intermediate revisions by the same user not shown)
Line 3: Line 3:


== Comestible Specific Entries ==
== Comestible Specific Entries ==
Most of these are optional.


;<nowiki>"addiction_type" : "crack",</nowiki>: Addiction type
;<nowiki>"addiction_type"</nowiki>: an optional addiction type


Example: <nowiki>"addiction_type" : "crack",</nowiki>
    "addiction_type" : "crack",
;<nowiki>"spoils_in" : 0,</nowiki>:             // A time duration: how long a comestible is good for. 0 = no spoilage.
;<nowiki>"spoils_in"</nowiki>: A time duration: how long a comestible is good for. 0 = no spoilage.
;<nowiki>"use_action" : "CRACK",</nowiki>:     // What effects a comestible has when used, see special definitions below
 
;<nowiki>"stim" : 40, </nowiki>:               // Stimulant effect
    "spoils_in" : 0,
;<nowiki>"fatigue_mod": 3,</nowiki>:           // How much fatigue this comestible removes. (Negative values add fatigue)
;<nowiki>"use_action"</nowiki>:  
;<nowiki>"radiation": 8,</nowiki>:             // How much radiation you get from this comestible.
 
;<nowiki>"comestible_type" : "MED",</nowiki>:   // Comestible type, used for inventory sorting
What effects a comestible has when used, see special definitions.
;<nowiki>"quench" : 0,</nowiki>:               // Thirst quenched
 
;<nowiki>"heal" : -2,</nowiki>:                 // Health effects (used for sickness chances)
    "use_action": [ "ANTIASTHMATIC" ],
;<nowiki>"addiction_potential" : 80,</nowiki>: // Ability to cause addictions
    "use_action" : [ "CRACK" ],
;<nowiki>"monotony_penalty" : 0,</nowiki>:     // (Optional, default: 2) Fun is reduced by this number for each one you've consumed in the last 48 hours.
 
                            // Can't drop fun below 0, unless the comestible also has the "NEGATIVE_MONOTONY_OK" flag.
;<nowiki>"stim"</nowiki>:  
;<nowiki>"calories" : 0,</nowiki>:             // Hunger satisfied (in kcal)
optional stimulant effect
;<nowiki>"nutrition" : 0,</nowiki>:            // Hunger satisfied (OBSOLETE)
 
;<nowiki>"tool" : "apparatus",</nowiki>:       // Tool required to be eaten/drank
    "stim" : 40,
;<nowiki>"charges" : 4,</nowiki>:               // Number of uses when spawned
 
;<nowiki>"stack_size" : 8,</nowiki>:           // (Optional) How many uses are in the above-defined volume. If omitted, is the same as 'charges'
;<nowiki>"fatigue_mod"</nowiki>:  
;<nowiki>"fun" : 50</nowiki>:                   // Morale effects when used
 
;<nowiki>"freezing_point": 32,</nowiki>:        // (Optional) Temperature in F at which item freezes, default is water (32F/0C)
How much fatigue this comestible removes. (Negative values add fatigue)
;<nowiki>"cooks_like": "meat_cooked",</nowiki>:         // (Optional) If the item is used in a recipe, replaces it with its cooks_like
 
;<nowiki>"parasites": 10, </nowiki>:           // (Optional) Probability of becoming parasitised when eating
    "fatigue_mod": 3,
<br>
;<nowiki>"radiation"</nowiki>:  
;<nowiki>"contamination": [ { "disease": "bad_food", "probability": 5 } ],</nowiki>:         // (Optional) List of diseases carried by this comestible and their associated probability. Values must be in the [0, 100] range.
How much radiation you get from this comestible.
;<nowiki>"vitamins": [ [ "calcium", 5 ], [ "iron", 12 ] ],</nowiki>:         // Vitamins provided by consuming a charge (portion) of this.  An integer percentage of ideal daily value average.  Vitamins array keys include the following: calcium, iron, vitA, vitB, vitC, mutant_toxin, bad_food, blood, and redcells.  Note that vitB is B12.
 
Example: <nowiki>"radiation": 8,</nowiki>
 
;<nowiki>"comestible_type"</nowiki>:  
 
Comestible type, used for inventory sorting (MED, DRINK, FOOD)
 
* Example 1: <nowiki>"comestible_type" : "MED",</nowiki>  
* Example 2: <nowiki>"comestible_type" : "DRINK",</nowiki>
 
;<nowiki>"quench"</nowiki>:
Thirst quenched
    "quench" : 0,
;<nowiki>"heal"</nowiki>:  
 
Health effects (used for sickness chances)
 
    "heal" : -2,
;<nowiki>"addiction_potential"</nowiki>:
 
Ability to cause addictions. Higher is more
 
    "addiction_potential" : 80,
;<nowiki>"monotony_penalty"</nowiki>:
 
(Optional, default: 2) Fun is reduced by this number for each one you've consumed in the last 48 hours.
 
 
Can't drop fun below 0, unless the comestible also has the "NEGATIVE_MONOTONY_OK" flag.
 
* Example 1: "monotony_penalty" : 0, ''// never monotonous''
* Example 2: "monotony_penalty" : 1, ''// less monotonous''
* Example 3: "monotony_penalty" : 4, ''// gets boring to eat twice as fast a usual''
 
;<nowiki>"calories"</nowiki>:  
Hunger satisfied (in kcal)
 
Example: <nowiki>"calories" : 120,</nowiki>
;<strike><nowiki>"nutrition"</nowiki></strike>: Hunger satisfied (OBSOLETE)
;<nowiki>"tool"</nowiki>:  
 
Tool required to be eaten/drank
 
    "tool" : "apparatus",
 
;<nowiki>"charges"</nowiki>:
 
Optional number of uses when spawned.
 
Example: <nowiki>"charges" : 4,</nowiki>
;<nowiki>"stack_size"</nowiki>: (Optional) How many uses are in the above-defined volume. If omitted, is the same as 'charges.' Note that you'll want to omit this unless you know exactly what you are doing; for best results use charges instead.
 
    "stack_size" : 8,
 
;<nowiki>"fun"</nowiki>: Morale effects when used
 
    "fun" : 5,
;"freezing_point":
(Optional) Temperature in F at which item freezes, default is water (32F/0C)
    "freezing_point": 32,
;"cooks_like":  
(Optional) If the item is used in a recipe, replaces it with its cooks_like
    "cooks_like": "meat_cooked",
;<nowiki>"parasites" </nowiki>:  
(Optional) Probability of becoming parasitised when eating
    "parasites": 10,
;<nowiki>"contamination"</nowiki>:  
 
(Optional) List of diseases carried by this comestible and their associated probability. Values must be in the [0, 100] range.
 
    "contamination": [ { "disease": "bad_food", "probability": 5 } ],
;<nowiki>"vitamins"</nowiki>:  
 
An array of vitamins provided by consuming a charge (portion) of this.  An integer percentage of ideal daily value average.  Vitamins array keys include the following: calcium, iron, vitA, vitB, vitC, mutant_toxin, bad_food, blood, and redcells.  Note that vitB is B12.
 
    <nowiki>"vitamins": [ [ "calcium", 5 ], [ "iron", 12 ] ],</nowiki>
 
== Complete examples ==
 
 
== See Also ==
 
* [[Recipe JSON Info]]
 
[[Category:JSON]]

Latest revision as of 19:15, 19 August 2020

"type" : "COMESTIBLE",
Defines this as a COMESTIBLE


Comestible Specific Entries

Most of these are optional.

"addiction_type"
an optional addiction type
    "addiction_type" : "crack",
"spoils_in"
A time duration: how long a comestible is good for. 0 = no spoilage.
    "spoils_in" : 0,
"use_action"

What effects a comestible has when used, see special definitions.

    "use_action": [ "ANTIASTHMATIC" ],
    "use_action" : [ "CRACK" ],
"stim"

optional stimulant effect

    "stim" : 40, 
"fatigue_mod"

How much fatigue this comestible removes. (Negative values add fatigue)

    "fatigue_mod": 3,
"radiation"

How much radiation you get from this comestible.

Example: "radiation": 8,

"comestible_type"

Comestible type, used for inventory sorting (MED, DRINK, FOOD)

  • Example 1: "comestible_type" : "MED",
  • Example 2: "comestible_type" : "DRINK",
"quench"

Thirst quenched

    "quench" : 0,
"heal"

Health effects (used for sickness chances)

    "heal" : -2,
"addiction_potential"

Ability to cause addictions. Higher is more

    "addiction_potential" : 80,
"monotony_penalty"

(Optional, default: 2) Fun is reduced by this number for each one you've consumed in the last 48 hours.


Can't drop fun below 0, unless the comestible also has the "NEGATIVE_MONOTONY_OK" flag.

  • Example 1: "monotony_penalty" : 0, // never monotonous
  • Example 2: "monotony_penalty" : 1, // less monotonous
  • Example 3: "monotony_penalty" : 4, // gets boring to eat twice as fast a usual
"calories"

Hunger satisfied (in kcal)

Example: "calories" : 120,

"nutrition"
Hunger satisfied (OBSOLETE)
"tool"

Tool required to be eaten/drank

    "tool" : "apparatus",
"charges"

Optional number of uses when spawned.

Example: "charges" : 4,

"stack_size"
(Optional) How many uses are in the above-defined volume. If omitted, is the same as 'charges.' Note that you'll want to omit this unless you know exactly what you are doing; for best results use charges instead.
    "stack_size" : 8,
"fun"
Morale effects when used
    "fun" : 5,
"freezing_point"

(Optional) Temperature in F at which item freezes, default is water (32F/0C)

    "freezing_point": 32,
"cooks_like"

(Optional) If the item is used in a recipe, replaces it with its cooks_like

    "cooks_like": "meat_cooked",
"parasites"

(Optional) Probability of becoming parasitised when eating

    "parasites": 10,
"contamination"

(Optional) List of diseases carried by this comestible and their associated probability. Values must be in the [0, 100] range.

    "contamination": [ { "disease": "bad_food", "probability": 5 } ],
"vitamins"

An array of vitamins provided by consuming a charge (portion) of this. An integer percentage of ideal daily value average. Vitamins array keys include the following: calcium, iron, vitA, vitB, vitC, mutant_toxin, bad_food, blood, and redcells. Note that vitB is B12.

    "vitamins": [ [ "calcium", 5 ], [ "iron", 12 ] ],

Complete examples

See Also