Files
GhomandRoxy 1f3894e793 Crafting refactor, implementing materials (#89465)
My original plan was to just implement materials into crafting so that
items would inherit the materials of their components, allowing for some
interesting stuff if the material flags of the item allow it. However to
my dismay crafting is a pile of old tech debt, starting from the old
`del_reqs` and `CheckParts` which still contain lines about old janky
bandaids that are no longer in use nor reachable, up to the
`customizable_reagent_holder` component which has some harddel issues
when your custom food is sliced, and items used in food recipes not
being deleted and instead stored inside the result with no purpose as
well as other inconsistencies like stack recipes that transfer materials
having counterparts in the UI that don't do that.

EDIT: Several things have come up while working on this, so I apologise
that it ended up changing over 100+ files. I managed to atomize some of
the changes, but it's a bit tedious.

EDIT: TLDR because I was told this section is too vague and there's too
much going on. This PR:
- Improves the dated crafting code (not the UI).
- replaced `atom/CheckParts` and `crafting_recipe/on_craft_completion`
with `atom/on_craft_completion`.
- Reqs used in food recipes are now deleted by default and not stored
inside the result (they did nothing).
- Renames the customizable_reagent_holder comp and improves it (No
harddels/ref issues).
- Adds a unit test that tries to craft all recipes to see what's wrong
(it skips some of the much more specific reqs for now).
- In the unit test is also the code to make sure materials of the
crafted item and a non-crafted item of the same type are roughly the
same, so far only applied to food.
- Some mild material/food refactoring around the fact that food item
code has been changed to support materials.

Improving the backbone of the crafting system. Also materials and food
code.

🆑
refactor: Refactored crafting backend. Report possible pesky bugs.
balance: the MEAT backpack (from the MEAT cargo pack) may be a smidge
different because of code standardization.
/🆑
2025-06-05 20:05:13 -04:00

146 lines
4.3 KiB
Plaintext

/datum/food_processor_process
/// What this recipe takes
var/input
/// Subtypes of what the recipe takes that it can't actually take.
var/list/blacklist
/// What this recipe creates
var/output
/// The amount of time this recipe takes.
var/time = 40
/// The machine required to do this recipe
var/required_machine = /obj/machinery/processor
/// Multiplied additional food made when processed
var/food_multiplier = 1
/// Whether to copy the materials from the input to the output
var/preserve_materials = TRUE
/datum/food_processor_process/meat
input = /obj/item/food/meat/slab
output = /obj/item/food/raw_meatball
blacklist = list(/obj/item/food/meat/slab/human,
/obj/item/food/meat/slab/corgi,
/obj/item/food/meat/slab/xeno,
/obj/item/food/meat/slab/bear,
/obj/item/food/meat/slab/chicken)
food_multiplier = MEATSLAB_PROCESSED_AMOUNT
/datum/food_processor_process/cutlet
input = /obj/item/food/meat/cutlet/plain
blacklist = list(/obj/item/food/meat/cutlet/plain/human,
/obj/item/food/meat/cutlet/xeno,
/obj/item/food/meat/cutlet/bear,
/obj/item/food/meat/cutlet/chicken)
output = /obj/item/food/raw_meatball
/datum/food_processor_process/meat/human
input = /obj/item/food/meat/slab/human
output = /obj/item/food/raw_meatball/human
blacklist = null
/datum/food_processor_process/cutlet/human
input = /obj/item/food/meat/cutlet/plain/human
output = /obj/item/food/raw_meatball/human
blacklist = null
/datum/food_processor_process/meat/corgi
input = /obj/item/food/meat/slab/corgi
output = /obj/item/food/raw_meatball/corgi
blacklist = null
/datum/food_processor_process/meat/xeno
input = /obj/item/food/meat/slab/xeno
output = /obj/item/food/raw_meatball/xeno
blacklist = null
/datum/food_processor_process/cutlet/xeno
input = /obj/item/food/meat/cutlet/xeno
output = /obj/item/food/raw_meatball/xeno
blacklist = null
/datum/food_processor_process/meat/bear
input = /obj/item/food/meat/slab/bear
output = /obj/item/food/raw_meatball/bear
blacklist = null
/datum/food_processor_process/cutlet/bear
input = /obj/item/food/meat/cutlet/bear
output = /obj/item/food/raw_meatball/bear
blacklist = null
/datum/food_processor_process/meat/chicken
input = /obj/item/food/meat/slab/chicken
output = /obj/item/food/raw_meatball/chicken
food_multiplier = 3
blacklist = null
/datum/food_processor_process/cutlet/chicken
input = /obj/item/food/meat/cutlet/chicken
output = /obj/item/food/raw_meatball/chicken
/datum/food_processor_process/fishmeat
input = /obj/item/food/fishmeat/carp
output = /obj/item/food/fishmeat
blacklist = null
/datum/food_processor_process/bacon
input = /obj/item/food/meat/rawcutlet
output = /obj/item/food/meat/rawbacon
/datum/food_processor_process/potatowedges
input = /obj/item/food/grown/potato/wedges
output = /obj/item/food/fries
/datum/food_processor_process/tempeh
input = /obj/item/food/tempehstarter
output = /obj/item/food/tempeh
food_multiplier = 2
/datum/food_processor_process/spidereggs
input = /obj/item/food/spidereggs
blacklist = list(/obj/item/food/spidereggs/processed)
output = /obj/item/food/spidereggs/processed
/datum/food_processor_process/potato
input = /obj/item/food/grown/potato
blacklist = list(/obj/item/food/grown/potato/sweet, /obj/item/food/grown/potato/wedges)
output = /obj/item/food/tatortot
/datum/food_processor_process/carrot
input = /obj/item/food/grown/carrot
output = /obj/item/food/carrotfries
/datum/food_processor_process/soybeans
input = /obj/item/food/grown/soybeans
output = /obj/item/food/soydope
/datum/food_processor_process/spaghetti
input = /obj/item/food/doughslice
output = /obj/item/food/spaghetti/raw
/datum/food_processor_process/corn
input = /obj/item/food/grown/corn
output = /obj/item/food/tortilla
/datum/food_processor_process/tortilla
input = /obj/item/food/tortilla
output = /obj/item/food/cornchips
/datum/food_processor_process/parsnip
input = /obj/item/food/grown/parsnip
output = /obj/item/food/roastparsnip
/datum/food_processor_process/mob/slime
input = /mob/living/basic/slime
output = null
required_machine = /obj/machinery/processor/slime
/datum/food_processor_process/towercap
input = /obj/item/grown/log
output = /obj/item/popsicle_stick
food_multiplier = 3
preserve_materials = FALSE
/datum/food_processor_process/canned_ink
input = /obj/item/food/ink_sac
output = /obj/item/food/canned/squid_ink