Skip to content

Commit

Permalink
Prevent poisonous foods from softlocking the game (#3183)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosvolt authored Sep 19, 2023
1 parent 63afb0f commit da723f2
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
2 changes: 1 addition & 1 deletion data/json/items/chemicals_and_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"name": { "str_sp": "commercial fertilizer" },
"weight": "350 g",
"color": "yellow",
"flags": [ "FERTILIZER" ],
"flags": [ "FERTILIZER", "UNSAFE_CONSUME" ],
"use_action": "PLANTBLECH",
"container": "bag_canvas",
"comestible_type": "FOOD",
Expand Down
16 changes: 9 additions & 7 deletions data/json/items/comestibles/carnivore.json
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@
"material": "flesh",
"volume": "250 ml",
"fun": -10,
"flags": [ "TRADER_AVOID", "SMOKABLE", "NUTRIENT_OVERRIDE", "RAW" ],
"flags": [ "TRADER_AVOID", "SMOKABLE", "NUTRIENT_OVERRIDE", "RAW", "UNSAFE_CONSUME" ],
"smoking_result": "dry_meat_tainted"
},
{
Expand All @@ -648,7 +648,7 @@
"volume": "250 ml",
"milling": { "into": "meal_bone_tainted", "conversion_rate": 4 },
"fun": -10,
"flags": [ "NO_SALVAGE" ]
"flags": [ "NO_SALVAGE", "UNSAFE_CONSUME" ]
},
{
"type": "GENERIC",
Expand Down Expand Up @@ -678,7 +678,7 @@
"material": "flesh",
"volume": "250 ml",
"fun": -10,
"flags": [ "RAW" ]
"flags": [ "RAW", "UNSAFE_CONSUME" ]
},
{
"type": "COMESTIBLE",
Expand All @@ -701,7 +701,8 @@
"volume": "250 ml",
"charges": 2,
"stack_size": 4,
"fun": -18
"fun": -18,
"flags": [ "UNSAFE_CONSUME" ]
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -764,7 +765,7 @@
"price": 330,
"price_postapoc": 20,
"material": "flesh",
"flags": [ "RAW", "TRADER_AVOID" ],
"flags": [ "RAW", "TRADER_AVOID", "UNSAFE_CONSUME" ],
"stack_size": 1,
"fun": -12
},
Expand Down Expand Up @@ -819,7 +820,7 @@
"description": "A carefully folded raw skin harvested from a fur-bearing unnatural creature. It still has the fur attached and is poisonous. You can cure it for storage and tanning.",
"price": 0,
"price_postapoc": 50,
"flags": [ "NO_SALVAGE" ]
"flags": [ "NO_SALVAGE", "UNSAFE_CONSUME" ]
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -920,7 +921,8 @@
{ "id": "badpoison", "duration": 3600 },
{ "id": "shakes", "duration": 810 }
]
}
},
"flags": [ "UNSAFE_CONSUME" ]
},
{
"id": "meat_bark",
Expand Down
5 changes: 3 additions & 2 deletions data/json/items/comestibles/mushroom.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"material": "mushroom",
"volume": "250 ml",
"fun": 1,
"flags": [ "SMOKABLE" ],
"flags": [ "SMOKABLE", "UNSAFE_CONSUME" ],
"smoking_result": "dry_mushroom",
"vitamins": [ [ "calcium", 2 ], [ "iron", 52 ] ]
},
Expand All @@ -45,7 +45,8 @@
"price": 1500,
"price_postapoc": 50,
"fun": 4,
"vitamins": [ [ "calcium", 2 ], [ "iron", 52 ] ]
"vitamins": [ [ "calcium", 2 ], [ "iron", 52 ] ],
"delete": { "flags": [ "UNSAFE_CONSUME" ] }
},
{
"type": "COMESTIBLE",
Expand Down
8 changes: 5 additions & 3 deletions data/json/items/comestibles/other.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"price": 0,
"price_postapoc": 0,
"volume": "250 ml",
"fun": -10
"fun": -10,
"flags": [ "UNSAFE_CONSUME" ]
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -207,7 +208,8 @@
"material": "powder",
"volume": "250 ml",
"charges": 4,
"fun": -10
"fun": -10,
"flags": [ "UNSAFE_CONSUME" ]
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -568,7 +570,7 @@
"price": 80,
"price_postapoc": 0,
"material": "hflesh",
"flags": [ "TRADER_AVOID" ],
"flags": [ "TRADER_AVOID", "UNSAFE_CONSUME" ],
"volume": "250 ml",
"fun": -30
},
Expand Down
6 changes: 4 additions & 2 deletions data/json/items/comestibles/raw_veggy.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@
"material": [ "veggy" ],
"volume": "250 ml",
"price": 0,
"price_postapoc": 0
"price_postapoc": 0,
"flags": [ "UNSAFE_CONSUME" ]
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -792,7 +793,8 @@
"description": "This is a chunk of fungal matter from some sort of alien mushroom creature. Eating unfamiliar mushrooms is a bad idea.",
"price": 0,
"price_postapoc": 0,
"smoking_result": "dry_veggy_tainted"
"smoking_result": "dry_veggy_tainted",
"extend": { "flags": [ "UNSAFE_CONSUME" ] }
},
{
"type": "COMESTIBLE",
Expand Down
6 changes: 4 additions & 2 deletions data/json/items/comestibles/seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"primary_material": "dried_vegetable",
"symbol": ".",
"color": "brown",
"flags": [ "NUTRIENT_OVERRIDE", "PLANTABLE_SEED" ]
"flags": [ "NUTRIENT_OVERRIDE", "PLANTABLE_SEED", "UNSAFE_CONSUME" ]
},
{
"abstract": "seed_fruit",
Expand Down Expand Up @@ -318,6 +318,7 @@
"material": "garlic",
"volume": "150 ml",
"fun": -3,
"flags": [ "UNSAFE_CONSUME" ],
"seed_data": { "plant_name": "garlic", "fruit": "garlic", "byproducts": [ "withered" ], "grow": "10 days" }
},
{
Expand Down Expand Up @@ -382,7 +383,7 @@
"price": 100,
"weight": "2 g",
"charges": 2,
"flags": [ "RAW" ],
"flags": [ "RAW", "UNSAFE_CONSUME" ],
"seed_data": { "plant_name": "cannabis", "fruit": "cannabis", "grow": "14 days" }
},
{
Expand Down Expand Up @@ -419,6 +420,7 @@
"volume": "100 ml",
"stack_size": 10,
"fun": 30,
"flags": [ "UNSAFE_CONSUME" ],
"seed_data": { "fruit": "null", "//": "dummy entry, results are hardcoded", "plant_name": "marloss berry", "grow": "14 days" }
},
{
Expand Down

0 comments on commit da723f2

Please sign in to comment.