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

260 lines
6.6 KiB
Plaintext

/datum/crafting_recipe/moffers
name = "Moffers"
result = /obj/item/clothing/shoes/clown_shoes/moffers
time = 6 SECONDS //opportunity to rethink your life
reqs = list(
/obj/item/stack/sheet/animalhide/mothroach = 2,
/obj/item/clothing/shoes/clown_shoes = 1,
)
blacklist = list(
/obj/item/clothing/shoes/clown_shoes/combat,
/obj/item/clothing/shoes/clown_shoes/banana_shoes,
/obj/item/clothing/shoes/clown_shoes/banana_shoes/combat,
/obj/item/clothing/shoes/clown_shoes/jester,
/obj/item/clothing/shoes/clown_shoes/meown_shoes,
/obj/item/clothing/shoes/clown_shoes/moffers,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/mothplush
name = "Moth Plushie"
result = /obj/item/toy/plush/moth
reqs = list(
/obj/item/stack/sheet/animalhide/mothroach = 1,
/obj/item/organ/heart = 1,
/obj/item/stack/sheet/cloth = 3,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/sharkplush
name = "Shark Plushie"
result = /obj/item/toy/plush/shark
reqs = list(
/obj/item/clothing/suit/hooded/shark_costume = 1,
/obj/item/grown/cotton = 10,
/obj/item/stack/sheet/cloth = 5,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/monkeyplush
name = "Monkey Plushie"
result = /obj/item/toy/plush/monkey
reqs = list(
/obj/item/clothing/mask/gas/monkeymask = 1,
/obj/item/clothing/suit/costume/monkeysuit = 1,
/obj/item/grown/cotton = 10,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/mixedbouquet
name = "Mixed bouquet"
result = /obj/item/bouquet
reqs = list(
/obj/item/food/grown/poppy/lily = 2,
/obj/item/food/grown/sunflower = 2,
/obj/item/food/grown/poppy/geranium = 2,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/sunbouquet
name = "Sunflower bouquet"
result = /obj/item/bouquet/sunflower
reqs = list(/obj/item/food/grown/sunflower = 6)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/poppybouquet
name = "Poppy bouquet"
result = /obj/item/bouquet/poppy
reqs = list (/obj/item/food/grown/poppy = 6)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/rosebouquet
name = "Rose bouquet"
result = /obj/item/bouquet/rose
reqs = list(/obj/item/food/grown/rose = 6)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/spooky_camera
name = "Camera Obscura"
result = /obj/item/camera/spooky
time = 1.5 SECONDS
reqs = list(
/obj/item/camera = 1,
/datum/reagent/water/holywater = 10,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/skateboard
name = "Skateboard"
result = /obj/vehicle/ridden/scooter/skateboard/improvised
time = 6 SECONDS
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/rods = 10,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/scooter
name = "Scooter"
result = /obj/vehicle/ridden/scooter
time = 6.5 SECONDS
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/rods = 12,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/headpike
name = "Spike Head (Glass Spear)"
time = 6.5 SECONDS
reqs = list(
/obj/item/spear = 1,
/obj/item/bodypart/head = 1,
)
parts = list(
/obj/item/bodypart/head = 1,
/obj/item/spear = 1,
)
blacklist = list(
/obj/item/spear/explosive,
/obj/item/spear/bonespear,
/obj/item/spear/bamboospear,
/obj/item/spear/military,
)
result = /obj/structure/headpike
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/headpikebone
name = "Spike Head (Bone Spear)"
time = 6.5 SECONDS
reqs = list(
/obj/item/spear/bonespear = 1,
/obj/item/bodypart/head = 1,
)
parts = list(
/obj/item/bodypart/head = 1,
/obj/item/spear/bonespear = 1,
)
result = /obj/structure/headpike/bone
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/headpikebamboo
name = "Spike Head (Bamboo Spear)"
time = 6.5 SECONDS
reqs = list(
/obj/item/spear/bamboospear = 1,
/obj/item/bodypart/head = 1,
)
parts = list(
/obj/item/bodypart/head = 1,
/obj/item/spear/bamboospear = 1,
)
result = /obj/structure/headpike/bamboo
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/headpikemilitary
name = "Spike Head (Military)"
time = 6.5 SECONDS
reqs = list(
/obj/item/spear/military = 1,
/obj/item/bodypart/head = 1,
)
parts = list(
/obj/item/bodypart/head = 1,
/obj/item/spear/military = 1,
)
result = /obj/structure/headpike/military
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/guillotine
name = "Guillotine"
result = /obj/structure/guillotine
time = 15 SECONDS // Building a functioning guillotine takes time
reqs = list(
/obj/item/stack/sheet/plasteel = 3,
/obj/item/stack/sheet/mineral/wood = 20,
/obj/item/stack/cable_coil = 10,
)
tool_behaviors = list(TOOL_SCREWDRIVER, TOOL_WRENCH, TOOL_WELDER)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/toiletbong
name = "Toiletbong"
category = CAT_ENTERTAINMENT
tool_behaviors = list(TOOL_WRENCH)
reqs = list(/obj/item/flamethrower = 1)
structures = list(/obj/structure/toilet = CRAFTING_STRUCTURE_CONSUME)
result = /obj/structure/toiletbong
time = 5 SECONDS
steps = list(
"make sure the flamethrower has a plasma tank attached",
)
/datum/crafting_recipe/toiletbong/check_requirements(mob/user, list/collected_requirements)
var/obj/item/flamethrower/flamethrower = collected_requirements[/obj/item/flamethrower][1]
if(!flamethrower.ptank)
return FALSE
return ..()
/datum/crafting_recipe/punching_bag
name = "Punching Bag"
result = /obj/structure/punching_bag
tool_behaviors = list(TOOL_SCREWDRIVER)
reqs = list(
/obj/item/stack/sheet/iron = 2,
/obj/item/stack/rods = 1,
/obj/item/pillow = 1,
)
category = CAT_ENTERTAINMENT
time = 10 SECONDS
/datum/crafting_recipe/stacklifter
name = "Chest Press"
result = /obj/structure/weightmachine
tool_behaviors = list(TOOL_SCREWDRIVER)
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/rods = 2,
/obj/item/chair = 1,
)
category = CAT_ENTERTAINMENT
time = 10 SECONDS
/datum/crafting_recipe/weightlifter
name = "Bench Press"
result = /obj/structure/weightmachine/weightlifter
tool_behaviors = list(TOOL_SCREWDRIVER)
reqs = list(
/obj/item/stack/sheet/iron = 5,
/obj/item/stack/rods = 2,
/obj/item/chair = 1,
)
category = CAT_ENTERTAINMENT
time = 10 SECONDS
/datum/crafting_recipe/latexballoon
name = "Latex Balloon"
result = /obj/item/latexballoon
time = 5 SECONDS
reqs = list(
/obj/item/clothing/gloves/latex = 1,
/obj/item/stack/cable_coil = 2,
)
category = CAT_ENTERTAINMENT
/datum/crafting_recipe/violin
name = "Violin"
result = /obj/item/instrument/violin
reqs = list(
/obj/item/stack/sheet/mineral/wood = 4,
/obj/item/stack/sheet/cloth = 2,
/obj/item/stack/sheet/iron = 1,
)
tool_paths = list(
/obj/item/hatchet,
)
time = 30 SECONDS
category = CAT_ENTERTAINMENT
crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_MUST_BE_LEARNED