Skip to content

Commit

Permalink
fix milling products (CleverRaven#71677)
Browse files Browse the repository at this point in the history
* fix milling products

* milling from recipe

* addressed some style complaints

* addressed issues after good advice

* Added checks on input and milling start

* clang-tidy changes

* Prepared JSON for JSONified milling

* Incorrect conversion_rate for cattail, specified conversion_rate for wild rice yields too many calories for test => same as for dry_rice

* Converted milling to recipe and dealt with copy-from

* Changed milling to use recipe

* Get recipe directly + i_rem needs pointer to existing item, not item looking the same

* Corrections of bugs found during testing

* Increased rice milling yield to meet test and possibly reality

* Adjusted milling in mods
  • Loading branch information
PatrikLundell authored Feb 22, 2024
1 parent 4a6ac7a commit 78fb2bf
Show file tree
Hide file tree
Showing 18 changed files with 1,257 additions and 710 deletions.
6 changes: 3 additions & 3 deletions data/json/items/comestibles/carnivore.json
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@
"symbol": "%",
"description": "A bone from some creature or other. Could be used in cooking and crafting.",
"price_postapoc": 10,
"milling": { "into": "meal_bone", "conversion_rate": 4 },
"milling": { "into": "meal_bone", "recipe": "meal_bone_mill_1_4" },
"volume": "250 ml",
"longest_side": "40 cm",
"vitamins": [ [ "calcium", 96 ] ]
Expand All @@ -1351,7 +1351,7 @@
"description": "A huge bone of a large creature.",
"copy-from": "bone_abstract",
"price_postapoc": 20,
"milling": { "into": "meal_bone", "conversion_rate": 4 },
"//": "While it would make sense to be able to mill it, the bone won't fit into a mill...",
"volume": "36 L",
"longest_side": "2000 cm",
"to_hit": { "grip": "bad", "length": "short", "surface": "any", "balance": "clumsy" },
Expand Down Expand Up @@ -1503,7 +1503,7 @@
"description": "A rotten, brittle bone from some unnatural creature or other. Could be used to make some stuff, like charcoal or glue. You could eat it, but it will poison you.",
"price": 0,
"price_postapoc": 5,
"milling": { "into": "meal_bone_tainted", "conversion_rate": 4 },
"milling": { "into": "meal_bone_tainted", "recipe": "meal_bone_tainted_mill_1_4" },
"//": "Not for use in edible recipes, and should require ~200% as much as normal for applicable inedible recipes except for charcoal.",
"material": [ "bone" ],
"volume": "250 ml",
Expand Down
44 changes: 25 additions & 19 deletions data/json/items/comestibles/nuts.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"smoking_result": "pistachio_roasted",
"vitamins": [ [ "vitC", 1 ], [ "calcium", 3 ], [ "iron", 7 ] ],
"fun": 1,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -69,7 +69,8 @@
"description": "A handful of roasted nuts from a pistachio tree.",
"price": 150,
"flags": [ "EATEN_HOT", "EDIBLE_FROZEN" ],
"fun": 3
"fun": 3,
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand All @@ -92,7 +93,7 @@
"smoking_result": "almond_roasted",
"vitamins": [ [ "calcium", 6 ], [ "iron", 6 ] ],
"fun": 1,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -122,7 +123,8 @@
"price": 150,
"price_postapoc": 600,
"flags": [ "EATEN_HOT", "EDIBLE_FROZEN" ],
"fun": 3
"fun": 3,
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand All @@ -144,7 +146,7 @@
"flags": [ "EDIBLE_FROZEN", "NUTRIENT_OVERRIDE" ],
"vitamins": [ [ "calcium", 1 ], [ "iron", 12 ] ],
"fun": 3,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -167,7 +169,7 @@
"smoking_result": "pecan_roasted",
"vitamins": [ [ "calcium", 2 ], [ "iron", 4 ] ],
"fun": 1,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -177,7 +179,8 @@
"description": "A handful of roasted nuts from a pecan tree.",
"price": 150,
"flags": [ "EATEN_HOT", "EDIBLE_FROZEN" ],
"fun": 3
"fun": 3,
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand All @@ -199,7 +202,7 @@
"flags": [ "EDIBLE_FROZEN", "NUTRIENT_OVERRIDE", "RAW" ],
"vitamins": [ [ "calcium", 1 ], [ "iron", 3 ] ],
"fun": 3,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -219,7 +222,7 @@
"volume": "62 ml",
"flags": [ "EDIBLE_FROZEN", "NUTRIENT_OVERRIDE", "RAW" ],
"vitamins": [ [ "vitC", 5 ], [ "iron", 9 ] ],
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -241,7 +244,7 @@
"smoking_result": "walnut_roasted",
"vitamins": [ [ "calcium", 2 ], [ "iron", 4 ] ],
"fun": -1,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -272,7 +275,8 @@
"description": "A handful of roasted nuts from a walnut tree.",
"price": 90,
"flags": [ "EATEN_HOT", "EDIBLE_FROZEN" ],
"fun": 1
"fun": 1,
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -304,7 +308,7 @@
"smoking_result": "chestnut_roasted",
"vitamins": [ [ "vitC", 13 ], [ "iron", 1 ] ],
"fun": -10,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -314,7 +318,7 @@
"description": "A handful of roasted nuts from a chestnut tree.",
"price": 90,
"flags": [ "EATEN_HOT", "EDIBLE_FROZEN" ],
"milling": { "into": "flour_wheat_free", "conversion_rate": 1.25 },
"milling": { "into": "flour_wheat_free", "recipe": "flour_wheat_free_mill_4_5" },
"fun": 3
},
{
Expand All @@ -337,7 +341,7 @@
"smoking_result": "hazelnut_roasted",
"vitamins": [ [ "vitC", 2 ], [ "calcium", 3 ], [ "iron", 7 ] ],
"fun": -1,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -387,7 +391,8 @@
"description": "A handful of roasted nuts from a hazelnut tree.",
"price": 90,
"flags": [ "EATEN_HOT", "EDIBLE_FROZEN" ],
"fun": 1
"fun": 1,
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand All @@ -409,7 +414,7 @@
"smoking_result": "hickory_nut_roasted",
"vitamins": [ [ "calcium", 2 ], [ "iron", 8 ] ],
"fun": -10,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -420,7 +425,8 @@
"price": 90,
"price_postapoc": 500,
"flags": [ "EATEN_HOT", "EDIBLE_FROZEN" ],
"fun": 1
"fun": 1,
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -536,7 +542,7 @@
"price": "22 cent",
"price_postapoc": "75 cent",
"flags": [ "EDIBLE_FROZEN", "SMOKABLE" ],
"milling": { "into": "flour_wheat_free", "conversion_rate": 1.5 },
"milling": { "into": "flour_wheat_free", "recipe": "flour_wheat_free_mill_2_3" },
"smoking_result": "acorn_roasted",
"fun": 0
},
Expand Down Expand Up @@ -566,7 +572,7 @@
"flags": [ "EDIBLE_FROZEN", "SMOKABLE" ],
"smoking_result": "acorns_cooked",
"fun": -1,
"milling": { "into": "paste_nut", "conversion_rate": 0.1 }
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_10_1" }
},
{
"type": "COMESTIBLE",
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/comestibles/other.json
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@
"fun": -5,
"vitamins": [ [ "iron", 25 ], [ "vitC", 1 ], [ "calcium", 3 ] ],
"smoking_result": "dry_soybean",
"milling": { "into": "paste_nut", "conversion_rate": 0.2 },
"milling": { "into": "paste_nut", "recipe": "paste_nut_mill_5_1" },
"seed_data": {
"plant_name": "soybean",
"fruit": "soybean",
Expand All @@ -838,7 +838,7 @@
"price_postapoc": 50,
"material": [ "veggy" ],
"fun": -5,
"milling": { "into": "flour_wheat_free", "conversion_rate": 1 },
"milling": { "into": "flour_wheat_free", "recipe": "flour_wheat_free_mill_1_1" },
"vitamins": [ [ "iron", 25 ], [ "vitC", 1 ], [ "calcium", 3 ] ],
"seed_data": {
"plant_name": "soybean",
Expand Down
12 changes: 6 additions & 6 deletions data/json/items/comestibles/raw_grain.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
"price_postapoc": 100,
"material": [ "wheat" ],
"//": "These things are rock-hard and not digestible by humans, but birds and cattle can eat them just fine.",
"milling": { "into": "flour", "conversion_rate": 15 },
"milling": { "into": "flour", "recipe": "flour_mill_1_15" },
"volume": "250 ml",
"vitamins": [ [ "calcium", 4 ], [ "iron", 40 ] ],
"petfood": [ "CATTLEFOOD", "BIRDFOOD" ],
Expand Down Expand Up @@ -279,7 +279,7 @@
"price_postapoc": "62 cent",
"material": [ "veggy" ],
"volume": "250 ml",
"milling": { "into": "flour", "conversion_rate": 15 },
"milling": { "into": "flour", "recipe": "flour_mill_1_15" },
"vitamins": [ [ "calcium", 6 ], [ "iron", 29 ] ],
"petfood": [ "CATTLEFOOD", "BIRDFOOD" ],
"flags": [ "EDIBLE_FROZEN", "RAW", "INEDIBLE", "CATTLE", "PLANTABLE_SEED", "CUT_HARVEST", "BIRD", "RAT", "MOUSE" ],
Expand Down Expand Up @@ -333,7 +333,7 @@
"price_postapoc": 100,
"material": [ "wheat" ],
"volume": "250 ml",
"milling": { "into": "flour_wheat_free", "conversion_rate": 3.75 },
"milling": { "into": "flour_wheat_free", "recipe": "flour_wheat_free_mill_4_15" },
"vitamins": [ [ "calcium", 3 ], [ "iron", 20 ] ],
"petfood": [ "CATTLEFOOD", "BIRDFOOD" ],
"flags": [
Expand Down Expand Up @@ -380,7 +380,7 @@
"copy-from": "oats",
"calories": 120,
"description": "Raw wild rice, still in its fibrous shell. It'll need to be milled before it's edible for humans.",
"milling": { "into": "dry_wild_rice", "conversion_rate": 5 },
"milling": { "into": "dry_wild_rice", "recipe": "dry_wild_rice_mill_1_5" },
"fun": -20,
"petfood": [ "CATTLEFOOD", "BIRDFOOD" ],
"flags": [ "EDIBLE_FROZEN", "RAW", "INEDIBLE", "CATTLE", "PLANTABLE_SEED", "CUT_HARVEST", "BIRD", "RAT", "MOUSE" ],
Expand All @@ -401,7 +401,7 @@
"price_postapoc": "2 USD",
"material": [ "veggy" ],
"volume": "250 ml",
"milling": { "into": "flour_wheat_free", "conversion_rate": 15 },
"milling": { "into": "flour_wheat_free", "recipe": "flour_wheat_free_mill_1_15" },
"vitamins": [ [ "calcium", 3 ], [ "iron", 22 ] ],
"petfood": [ "CATTLEFOOD", "BIRDFOOD" ],
"flags": [ "EDIBLE_FROZEN", "RAW", "INEDIBLE", "CATTLE", "PLANTABLE_SEED", "CUT_HARVEST", "BIRD", "RAT", "MOUSE" ],
Expand Down Expand Up @@ -478,7 +478,7 @@
"MOUSE"
],
"seed_data": { "plant_name": "canola", "fruit": "canola_stalks", "seeds": false, "grow": "91 days" },
"milling": { "into": "paste_seed", "conversion_rate": 0.02 }
"milling": { "into": "paste_seed", "recipe": "paste_seed_mill_1_1" }
},
{
"type": "COMESTIBLE",
Expand Down
28 changes: 17 additions & 11 deletions data/json/items/comestibles/seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"byproducts": [ "grape_leaves", "withered" ],
"grow": "91 days"
},
"milling": { "into": "paste_seed", "conversion_rate": 0.02 }
"milling": { "into": "paste_seed", "recipe": "paste_seed_mill_8_1" }
},
{
"id": "seed_rose",
Expand Down Expand Up @@ -160,7 +160,8 @@
"name": { "str_sp": "barley seeds" },
"extend": { "flags": [ "NUTRIENT_OVERRIDE" ] },
"description": "This pile of dried barley is earmarked for planting.",
"seed_data": { "plant_name": "barley", "fruit": "barley_stalks", "seeds": false, "grow": "70 days" }
"seed_data": { "plant_name": "barley", "fruit": "barley_stalks", "seeds": false, "grow": "70 days" },
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -215,7 +216,7 @@
"weight": "5 g",
"flags": [ "PLANTABLE_SEED", "NUTRIENT_OVERRIDE", "INEDIBLE" ],
"seed_data": { "plant_name": "cotton", "fruit": "cotton_boll", "byproducts": [ "withered" ], "grow": "130 days" },
"milling": { "into": "paste_seed", "conversion_rate": 0.05 },
"milling": { "into": "paste_seed", "recipe": "paste_seed_mill_8_1" },
"volume": "6 ml"
},
{
Expand Down Expand Up @@ -413,7 +414,8 @@
"name": { "str_sp": "corn seeds" },
"description": "A pile of dried corn, designated for planting. It could just as easily become food.",
"extend": { "flags": [ "NUTRIENT_OVERRIDE" ] },
"seed_data": { "plant_name": "corn", "fruit": "corn", "seeds": false, "byproducts": [ "withered" ], "grow": "80 days" }
"seed_data": { "plant_name": "corn", "fruit": "corn", "seeds": false, "byproducts": [ "withered" ], "grow": "80 days" },
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -473,7 +475,7 @@
"price": "1 cent",
"flags": [ "PLANTABLE_SEED", "NUTRIENT_OVERRIDE", "INEDIBLE" ],
"seed_data": { "plant_name": "cannabis", "fruit": "cannabis", "grow": "91 days" },
"milling": { "into": "paste_seed", "conversion_rate": 0.02 }
"milling": { "into": "paste_seed", "recipe": "paste_seed_mill_8_1" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -531,7 +533,8 @@
"extend": { "flags": [ "NUTRIENT_OVERRIDE", "INEDIBLE" ] },
"description": "A pile of dry soybeans. These are intended for planting, but there's no reason they couldn't be made into food.",
"price": 90,
"seed_data": { "plant_name": "soybean", "fruit": "raw_edamame", "seeds": false, "byproducts": [ "withered" ], "grow": "91 days" }
"seed_data": { "plant_name": "soybean", "fruit": "raw_edamame", "seeds": false, "byproducts": [ "withered" ], "grow": "91 days" },
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -588,7 +591,7 @@
"price": 100,
"flags": [ "PLANTABLE_SEED" ],
"seed_data": { "plant_name": "pumpkin", "fruit": "pumpkin", "seeds": false, "byproducts": [ "withered" ], "grow": "91 days" },
"milling": { "into": "paste_seed", "conversion_rate": 0.02 }
"milling": { "into": "paste_seed", "recipe": "paste_seed_mill_8_1" }
},
{
"type": "COMESTIBLE",
Expand All @@ -604,7 +607,7 @@
"price": "1 cent",
"flags": [ "PLANTABLE_SEED" ],
"seed_data": { "plant_name": "sunflower", "fruit": "seed_sunflower", "byproducts": [ "withered" ], "grow": "91 days" },
"milling": { "into": "paste_seed", "conversion_rate": 0.02 }
"milling": { "into": "paste_seed", "recipe": "paste_seed_mill_8_1" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -658,7 +661,8 @@
"description": "A pile of buckwheat, ready to be planted.",
"category": "seeds",
"extend": { "flags": [ "NUTRIENT_OVERRIDE" ] },
"seed_data": { "plant_name": "buckwheat", "fruit": "buckwheat_stalks", "seeds": false, "grow": "91 days" }
"seed_data": { "plant_name": "buckwheat", "fruit": "buckwheat_stalks", "seeds": false, "grow": "91 days" },
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand Down Expand Up @@ -888,7 +892,8 @@
"description": "A pile of dried whole oats, ready for planting.",
"extend": { "flags": [ "NUTRIENT_OVERRIDE" ] },
"category": "seeds",
"seed_data": { "plant_name": "oats", "fruit": "oat_stalks", "seeds": false, "grow": "65 days" }
"seed_data": { "plant_name": "oats", "fruit": "oat_stalks", "seeds": false, "grow": "65 days" },
"milling": { "into": "null", "recipe": "" }
},
{
"id": "seed_wheat",
Expand All @@ -898,7 +903,8 @@
"name": { "str_sp": "wheat seeds" },
"extend": { "flags": [ "NUTRIENT_OVERRIDE" ] },
"description": "A pile of dry wheatberries, designated for planting.",
"seed_data": { "plant_name": "wheat", "fruit": "wheat_stalks", "seeds": false, "grow": "120 days" }
"seed_data": { "plant_name": "wheat", "fruit": "wheat_stalks", "seeds": false, "grow": "120 days" },
"milling": { "into": "null", "recipe": "" }
},
{
"type": "COMESTIBLE",
Expand Down
Loading

0 comments on commit 78fb2bf

Please sign in to comment.