Unit test material checks are now performed on all crafting recipes by default. All stack recipes now transfer mats to the results (#92620)

## About The Pull Request
Extends the part of the crafting unit test that ensures consistency
between the total mats of the components of a recipe (or rather, the
result of said recipe) and a generic instance of the same type as its
result, previously only implemented on food recipes.

## Why It's Good For The Game
This ensures a degree of consistency with the material composition of
various objects in the game. I couldn't do it in the original PR as that
one was too big already and it took months to get it merged, and have
the relative bugs fixed.

Currently a WIP as I slowly deal with the unit test reports.

## Changelog

🆑
refactor: Follow-up to the crafting/material refactor from months ago.
All objects crafted with stacks now inherit their mat composition (not
necessarily the effects and color) by default, while previously only a
few things like chair, sinks and toilets did. Report any object looking
or behaving weirdly as a result.
fix: The material composition of ammo boxes is no longer a 1/10 of what
it's supposed to be. It was a shitty hack to make it harder to recycle
empty ammo boxes. Instead, they lose materials as they're emptied now.
/🆑
This commit is contained in:
Ghom
2025-12-02 18:29:01 -05:00
committed by GitHub
parent 085007eae1
commit 0b0c5ea91e
272 changed files with 850 additions and 280 deletions
@@ -6,6 +6,7 @@
base_icon_state = "toilet"
density = FALSE
anchored = TRUE
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT)
/// Boolean if whether the toilet is currently flushing.
var/flushing = FALSE
@@ -17,10 +18,6 @@
var/w_items = 0
/// Reference to the mob being given a swirlie.
var/mob/living/swirlie
/// The type of material used to build the toilet.
var/buildstacktype = /obj/item/stack/sheet/iron
/// How much of the buildstacktype is needed to construct the toilet.
var/buildstackamount = 1
/// Lazylist of items in the cistern.
var/list/cistern_items
/// Lazylist of fish in the toilet, not to be mixed with the items in the cistern. Max of 3
@@ -238,11 +235,7 @@
/obj/structure/toilet/atom_deconstruct(dissambled = TRUE)
dump_contents()
if(buildstacktype)
new buildstacktype(loc,buildstackamount)
else
for(var/datum/material/M as anything in custom_materials)
new M.sheet_type(loc, FLOOR(custom_materials[M] / SHEET_MATERIAL_AMOUNT, 1))
drop_costum_materials()
if(has_water_reclaimer)
new /obj/item/stock_parts/water_recycler(drop_location())
@@ -396,7 +389,7 @@
/obj/structure/toilet/greyscale
material_flags = MATERIAL_EFFECTS | MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
buildstacktype = null
custom_materials = null
has_water_reclaimer = FALSE
/obj/structure/toilet/secret
@@ -409,3 +402,29 @@
secret.desc += " It's a secret!"
w_items += secret.w_class
LAZYADD(cistern_items, secret)
///A toilet made of meat that only drops remains when deconstructed, often unleashed unto this cursed plane of existence by hopeless people off'ing themselves with experi-scanners.
/obj/structure/toilet/greyscale/flesh
desc = "A horrendous mass of fused flesh resembling a standard-issue HT-451 model toilet. How it manages to function as one is beyond you. \
This one seems to be made out of the flesh of a devoted employee of the RnD department."
/obj/structure/toilet/greyscale/flesh/Initialize(mapload, mob/living/carbon/suicide)
. = ..()
///The suicide victim's brain that will be placed inside the toilet's cistern
var/obj/item/organ/brain/toilet_brain
if(suicide)
toilet_brain = suicide.get_organ_slot(ORGAN_SLOT_BRAIN)
suicide.gib(DROP_BRAIN) //we delete everything but the brain, as it's going to be moved to the cistern
set_custom_materials(list(GET_MATERIAL_REF(/datum/material/meat/mob_meat, suicide) = SHEET_MATERIAL_AMOUNT))
else
toilet_brain = new(drop_location())
set_custom_materials(list(/datum/material/meat = SHEET_MATERIAL_AMOUNT))
toilet_brain.forceMove(src)
w_items += toilet_brain.w_class
//this also prevents the toilet from dropping meat sheets. if you want to cheese the meat exepriments, sacrifice more people
/obj/structure/toilet/greyscale/flesh/atom_deconstruct(dissambled = TRUE)
for(var/obj/toilet_item in cistern_items)
toilet_item.forceMove(drop_location())
new /obj/effect/decal/remains/human(loc)