Files
Bubberstation/code/datums/components/crafting/atmospheric.dm
Ghom 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

250 lines
7.3 KiB
Plaintext

/datum/crafting_recipe/bluespace_vendor_mount
name = "Bluespace Vendor Wall Mount"
result = /obj/item/wallframe/bluespace_vendor_mount
time = 6 SECONDS
reqs = list(
/obj/item/stack/sheet/iron = 15,
/obj/item/stack/sheet/glass = 10,
/obj/item/stack/cable_coil = 10,
)
category = CAT_ATMOSPHERIC
/datum/crafting_recipe/pipe
name = "Smart pipe fitting"
tool_behaviors = list(TOOL_WRENCH)
result = /obj/item/pipe/quaternary/pipe/crafted
reqs = list(/obj/item/stack/sheet/iron = 1)
time = 0.5 SECONDS
category = CAT_ATMOSPHERIC
/datum/crafting_recipe/igniter
name = "Igniter"
result = /obj/machinery/igniter
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/assembly/igniter = 1,
)
blacklist = list(/obj/item/assembly/igniter/condenser)
crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF
time = 2 SECONDS
category = CAT_ATMOSPHERIC
/datum/crafting_recipe/air_sensor
name = "Monitored Air Sensor"
result = /obj/item/air_sensor
reqs = list(
/obj/item/analyzer = 1,
/obj/item/stack/sheet/iron = 1,
)
blacklist = list(/obj/item/analyzer/ranged)
category = CAT_ATMOSPHERIC
///abstract path for pipe crafting recipes that set the pipe_type of their results and have other checks as well
/datum/crafting_recipe/spec_pipe
var/pipe_type
/datum/crafting_recipe/spec_pipe/check_requirements(mob/user, list/collected_requirements)
var/obj/item/pipe/required_pipe = collected_requirements[/obj/item/pipe][1]
if(ispath(required_pipe.pipe_type, /obj/machinery/atmospherics/pipe/smart))
return TRUE
return FALSE
/datum/crafting_recipe/spec_pipe/layer_adapter
name = "Layer manifold fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/binary/layer_adapter
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
)
time = 1 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/pipe/layer_manifold
/datum/crafting_recipe/spec_pipe/color_adapter
name = "Color adapter fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/binary/color_adapter
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
)
time = 1 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/pipe/color_adapter
/datum/crafting_recipe/spec_pipe/he_pipe
name = "H/E pipe fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/quaternary/he_pipe
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
)
time = 1 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w
/datum/crafting_recipe/spec_pipe/he_junction
name = "H/E junction fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/he_junction
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
)
time = 1 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/pipe/heat_exchanging/junction
/datum/crafting_recipe/spec_pipe/pressure_pump
name = "Pressure pump fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/binary/pressure_pump
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/cable_coil = 5,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/binary/pump
/datum/crafting_recipe/spec_pipe/manual_valve
name = "Manual valve fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/binary/manual_valve
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/binary/valve
/datum/crafting_recipe/spec_pipe/vent
name = "Vent pump fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/vent
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/cable_coil = 5,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/unary/vent_pump
/datum/crafting_recipe/spec_pipe/scrubber
name = "Scrubber fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/scrubber
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/cable_coil = 5,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/unary/vent_scrubber
/datum/crafting_recipe/spec_pipe/filter
name = "Filter fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/trinary/flippable/filter
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/cable_coil = 5,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/trinary/filter
/datum/crafting_recipe/spec_pipe/mixer
name = "Mixer fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/trinary/flippable/mixer
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/cable_coil = 5,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/trinary/mixer
/datum/crafting_recipe/spec_pipe/connector
name = "Portable connector fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/connector
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/unary/portables_connector
/datum/crafting_recipe/spec_pipe/passive_vent
name = "Passive vent fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/passive_vent
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/unary/passive_vent
/datum/crafting_recipe/spec_pipe/injector
name = "Outlet injector fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/injector
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 1,
/obj/item/stack/cable_coil = 5,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/unary/outlet_injector
/datum/crafting_recipe/spec_pipe/he_exchanger
name = "Heat exchanger fitting"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/he_exchanger
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/plasteel = 1,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/unary/heat_exchanger
/datum/crafting_recipe/steam_vent
name = "Steam Vent"
result = /obj/structure/steam_vent
time = 0.8 SECONDS
reqs = list(
/obj/item/stack/sheet/iron = 2,
/obj/item/stack/tile/iron = 1,
/obj/item/stock_parts/water_recycler = 1,
)
category = CAT_ATMOSPHERIC
/datum/crafting_recipe/spec_pipe/airlock_pump
name = "External Airlock Pump"
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER)
result = /obj/item/pipe/directional/airlock_pump
reqs = list(
/obj/item/pipe = 1,
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/cable_coil = 5,
/obj/item/analyzer = 1,
)
time = 2 SECONDS
category = CAT_ATMOSPHERIC
pipe_type = /obj/machinery/atmospherics/components/unary/airlock_pump