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

296 lines
7.6 KiB
Plaintext

/datum/crafting_recipe/strobeshield
name = "Strobe Shield"
result = /obj/item/shield/riot/flash
reqs = list(
/obj/item/wallframe/flasher = 1,
/obj/item/assembly/flash/handheld = 1,
/obj/item/shield/riot = 1,
)
time = 4 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/strobeshield/New()
..()
blacklist |= subtypesof(/obj/item/shield/riot)
/datum/crafting_recipe/improvisedshield
name = "Improvised Shield"
result = /obj/item/shield/improvised
reqs = list(
/obj/item/stack/sheet/iron = 10,
/obj/item/stack/sticky_tape = 2,
)
time = 4 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/moonflowershield
name = "Moonflower Shield"
result = /obj/item/shield/buckler/moonflower
reqs = list(
/obj/item/seeds/sunflower/moonflower = 3,
/obj/item/grown/log/steel = 3,
)
time = 4 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/radiogloves
name = "Radio Gloves"
result = /obj/item/clothing/gloves/radio
time = 1.5 SECONDS
reqs = list(
/obj/item/clothing/gloves/color/black = 1,
/obj/item/stack/cable_coil = 2,
/obj/item/radio = 1,
)
tool_behaviors = list(TOOL_WIRECUTTER)
category = CAT_EQUIPMENT
/datum/crafting_recipe/radiogloves/New()
..()
blacklist |= typesof(/obj/item/radio/headset)
blacklist |= typesof(/obj/item/radio/intercom)
/datum/crafting_recipe/wheelchair
name = "Wheelchair"
result = /obj/vehicle/ridden/wheelchair
reqs = list(
/obj/item/stack/sheet/iron = 4,
/obj/item/stack/rods = 6,
)
time = 10 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/motorized_wheelchair
name = "Motorized Wheelchair"
result = /obj/vehicle/ridden/wheelchair/motorized
reqs = list(
/obj/item/stack/sheet/iron = 10,
/obj/item/stack/rods = 8,
/obj/item/stock_parts/servo = 2,
/obj/item/stock_parts/capacitor = 1,
/obj/item/stock_parts/power_store/cell = 1,
)
parts = list(
/obj/item/stock_parts/power_store/cell = 1,
)
tool_behaviors = list(TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_WRENCH)
time = 20 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/secured_freezer_cabinet
name = "Secure Freezer Cabinet"
result = /obj/structure/closet/secure_closet/freezer/empty
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/assembly/igniter/condenser = 1,
/obj/item/electronics/airlock = 1,
)
time = 5 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/barbeque_grill
name = "Barbeque grill"
result = /obj/machinery/grill
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/rods = 5,
/obj/item/assembly/igniter = 1,
)
time = 7 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/secure_closet
name = "Secure Closet"
result = /obj/structure/closet/secure_closet
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/electronics/airlock = 1,
)
time = 5 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/trapdoor_kit
name = "Trapdoor Construction Kit"
result = /obj/item/trapdoor_kit
reqs = list(
/obj/item/stack/sheet/iron = 4,
/obj/item/stack/rods = 4,
/obj/item/stack/cable_coil = 10,
/obj/item/stock_parts/servo = 2,
/obj/item/assembly/signaler = 1,
)
tool_behaviors = list(TOOL_WELDER, TOOL_SCREWDRIVER)
time = 10 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/trapdoor_remote
name = "Trapdoor Remote"
result = /obj/item/trapdoor_remote/preloaded // since its useless without its assembly just require an assembly to craft it
reqs = list(
/obj/item/compact_remote = 1,
/obj/item/stack/cable_coil = 5,
/obj/item/assembly/trapdoor = 1,
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
time = 5 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/mousetrap
name = "Mouse Trap"
result = /obj/item/assembly/mousetrap
time = 1 SECONDS
reqs = list(
/obj/item/stack/sheet/cardboard = 1,
/obj/item/stack/rods = 1,
)
category = CAT_EQUIPMENT
/datum/crafting_recipe/flashlight_eyes
name = "Flashlight Eyes"
result = /obj/item/organ/eyes/robotic/flashlight
time = 10
reqs = list(
/obj/item/flashlight = 2,
/obj/item/restraints/handcuffs/cable = 1
)
category = CAT_EQUIPMENT
/datum/crafting_recipe/flashlight_eyes/New()
. = ..()
blacklist += typesof(/obj/item/flashlight/flare)
/datum/crafting_recipe/extendohand_r
name = "Extendo-Hand (Right Arm)"
reqs = list(
/obj/item/bodypart/arm/right/robot = 1,
/obj/item/clothing/gloves/boxing = 1,
)
result = /obj/item/extendohand
category = CAT_EQUIPMENT
/datum/crafting_recipe/extendohand_l
name = "Extendo-Hand (Left Arm)"
reqs = list(
/obj/item/bodypart/arm/left/robot = 1,
/obj/item/clothing/gloves/boxing = 1,
)
result = /obj/item/extendohand
category = CAT_EQUIPMENT
/datum/crafting_recipe/ore_sensor
name = "Ore Sensor"
time = 3 SECONDS
reqs = list(
/datum/reagent/brimdust = 15,
/obj/item/stack/sheet/bone = 1,
/obj/item/stack/sheet/sinew = 1,
)
result = /obj/item/ore_sensor
category = CAT_EQUIPMENT
/datum/crafting_recipe/material_sniffer
name = "Material Sniffer"
time = 3 SECONDS
reqs = list(
/obj/item/analyzer = 1,
/obj/item/stack/cable_coil = 5,
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WIRECUTTER)
result = /obj/item/pinpointer/material_sniffer
category = CAT_EQUIPMENT
/datum/crafting_recipe/pressureplate
name = "Pressure Plate"
result = /obj/item/pressure_plate
time = 0.5 SECONDS
reqs = list(
/obj/item/stack/sheet/iron = 1,
/obj/item/stack/tile/iron = 1,
/obj/item/stack/cable_coil = 2,
/obj/item/assembly/igniter = 1,
)
category = CAT_EQUIPMENT
/datum/crafting_recipe/rcl
name = "Makeshift Rapid Pipe Cleaner Layer"
result = /obj/item/rcl/ghetto
time = 4 SECONDS
tool_behaviors = list(TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_WRENCH)
reqs = list(/obj/item/stack/sheet/iron = 15)
category = CAT_EQUIPMENT
/datum/crafting_recipe/ghettojetpack
name = "Improvised Jetpack"
result = /obj/item/tank/jetpack/improvised
time = 30
reqs = list(
/obj/item/tank/internals/oxygen = 2,
/obj/item/extinguisher = 1,
/obj/item/pipe = 3,
/obj/item/stack/cable_coil = MAXCOIL,
)
category = CAT_EQUIPMENT
tool_behaviors = list(TOOL_WRENCH, TOOL_WELDER, TOOL_WIRECUTTER)
/datum/crafting_recipe/gripperoffbrand
name = "Improvised Gripper Gloves"
reqs = list(
/obj/item/clothing/gloves/fingerless = 1,
/obj/item/stack/sticky_tape = 1,
)
result = /obj/item/clothing/gloves/tackler/offbrand
category = CAT_EQUIPMENT
/**
* Recipe used for upgrading fake N-spect scanners to bananium HONK-spect scanners
*/
/datum/crafting_recipe/clown_scanner_upgrade
name = "Bananium HONK-spect scanner"
result = /obj/item/inspector/clown/bananium
reqs = list(
/obj/item/inspector/clown = 1,
/obj/item/stack/sticky_tape = 3,
/obj/item/stack/sheet/mineral/bananium = 5,
) //the chainsaw of prank tools
tool_paths = list(/obj/item/bikehorn)
time = 40 SECONDS
category = CAT_EQUIPMENT
/datum/crafting_recipe/rebar_quiver
name = "Rebar Storage Quiver"
result = /obj/item/storage/bag/rebar_quiver
time = 10
reqs = list(
/obj/item/tank/internals/oxygen = 1,
/obj/item/stack/cable_coil = 15,
)
category = CAT_EQUIPMENT
tool_behaviors = list(TOOL_WELDER, TOOL_WIRECUTTER)
// SKYRAT EDIT REMOVAL START
/*
/datum/crafting_recipe/arrow_quiver
name = "Archery Quiver"
result = /obj/item/storage/bag/quiver/lesser
time = 10
reqs = list(
/obj/item/stack/sheet/leather = 4,
/obj/item/stack/sheet/cardboard = 4
)
category = CAT_EQUIPMENT
tool_behaviors = list(TOOL_WELDER, TOOL_WIRECUTTER)
*/ // SKYRAT EDIT REMOVAL END
/datum/crafting_recipe/tether_anchor
name = "Tether Anchor"
result = /obj/item/tether_anchor
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/rods = 2,
/obj/item/stack/cable_coil = 15
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WRENCH)
time = 5 SECONDS
category = CAT_EQUIPMENT