mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-09 16:05:07 +00:00
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. /🆑
84 lines
2.4 KiB
Plaintext
84 lines
2.4 KiB
Plaintext
/obj/effect/decal/cleanable/food
|
|
icon = 'icons/effects/tomatodecal.dmi'
|
|
gender = NEUTER
|
|
beauty = -100
|
|
|
|
/obj/effect/decal/cleanable/food/tomato_smudge
|
|
name = "tomato smudge"
|
|
desc = "It's red."
|
|
icon_state = "tomato_floor1"
|
|
random_icon_states = list("tomato_floor1", "tomato_floor2", "tomato_floor3")
|
|
|
|
/obj/effect/decal/cleanable/food/tomato_smudge/can_bloodcrawl_in()
|
|
return TRUE // why? why not.
|
|
|
|
/obj/effect/decal/cleanable/food/plant_smudge
|
|
name = "plant smudge"
|
|
desc = "Chlorophyll? More like borophyll!"
|
|
icon_state = "smashed_plant"
|
|
|
|
/obj/effect/decal/cleanable/food/egg_smudge
|
|
name = "smashed egg"
|
|
desc = "Seems like this one won't hatch."
|
|
icon_state = "smashed_egg1"
|
|
random_icon_states = list("smashed_egg1", "smashed_egg2", "smashed_egg3")
|
|
|
|
/obj/effect/decal/cleanable/food/pie_smudge //honk
|
|
name = "smashed pie"
|
|
desc = "It's pie cream from a cream pie."
|
|
icon_state = "smashed_pie"
|
|
|
|
/obj/effect/decal/cleanable/food/salt
|
|
name = "salt pile"
|
|
desc = "A sizable pile of table salt. Someone must be upset."
|
|
icon_state = "salt_pile"
|
|
var/safepasses = 3 //how many times can this salt pile be passed before dissipating
|
|
|
|
/obj/effect/decal/cleanable/food/salt/Initialize(mapload, list/datum/disease/diseases)
|
|
. = ..()
|
|
var/static/list/loc_connections = list(
|
|
COMSIG_ATOM_ENTERED = PROC_REF(on_entered)
|
|
)
|
|
AddElement(/datum/element/connect_loc, loc_connections)
|
|
|
|
/obj/effect/decal/cleanable/food/salt/CanAllowThrough(atom/movable/mover, border_dir)
|
|
. = ..()
|
|
if(is_species(mover, /datum/species/snail))
|
|
return FALSE
|
|
|
|
/obj/effect/decal/cleanable/food/salt/Bumped(atom/movable/AM)
|
|
. = ..()
|
|
if(is_species(AM, /datum/species/snail))
|
|
to_chat(AM, span_danger("Your path is obstructed by [span_phobia("salt")]."))
|
|
|
|
/obj/effect/decal/cleanable/food/salt/proc/on_entered(datum/source, atom/movable/AM)
|
|
SIGNAL_HANDLER
|
|
|
|
if(!isliving(AM))
|
|
return
|
|
|
|
if(iscarbon(AM))
|
|
var/mob/living/carbon/C = AM
|
|
if(C.move_intent == MOVE_INTENT_WALK)
|
|
return
|
|
|
|
safepasses--
|
|
if(safepasses <= 0 && !QDELETED(src))
|
|
qdel(src)
|
|
|
|
/obj/effect/decal/cleanable/food/flour
|
|
name = "flour"
|
|
desc = "It's still good. Four second rule!"
|
|
icon_state = "flour"
|
|
|
|
/obj/effect/decal/cleanable/food/squid_ink
|
|
name = "ink smear"
|
|
desc = "a smear from some inky substance..."
|
|
icon = 'icons/effects/blood.dmi'
|
|
icon_state = "floor1"
|
|
color = COLOR_DARK
|
|
|
|
/obj/effect/decal/cleanable/food/squid_ink/Initialize(mapload, list/datum/disease/diseases)
|
|
icon_state = "floor[rand(1, 7)]"
|
|
return ..()
|