Files
Ghom 0b0c5ea91e 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.
/🆑
2025-12-02 18:29:01 -05:00

150 lines
4.7 KiB
Plaintext

/obj/structure/closet/secure_closet/freezer
icon_state = "freezer"
base_icon_state = "freezer"
flags_1 = PREVENT_CONTENTS_EXPLOSION_1
door_anim_squish = 0.22
door_anim_angle = 123
door_anim_time = 4
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 5.3, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 3.5)
/// If FALSE, we will protect the first person in the freezer from an explosion / nuclear blast.
var/jones = FALSE
paint_jobs = null
sealed = TRUE
/// The rate at which the internal air mixture cools
var/cooling_rate_per_second = 4
/// Minimum temperature of the internal air mixture
var/minimum_temperature = T0C - 60
/obj/structure/closet/secure_closet/freezer/process_internal_air(seconds_per_tick)
if(opened)
var/datum/gas_mixture/current_exposed_air = loc.return_air()
if(!current_exposed_air)
return
// The internal air won't cool down the external air when the freezer is opened.
internal_air.temperature = max(current_exposed_air.temperature, internal_air.temperature)
return ..()
else
if(internal_air.temperature <= minimum_temperature)
return
var/temperature_decrease_this_tick = min(cooling_rate_per_second * seconds_per_tick, internal_air.temperature - minimum_temperature)
internal_air.temperature -= temperature_decrease_this_tick
/obj/structure/closet/secure_closet/freezer/ex_act()
if(jones)
return ..()
jones = TRUE
flags_1 &= ~PREVENT_CONTENTS_EXPLOSION_1
return FALSE
/obj/structure/closet/secure_closet/freezer/atom_deconstruct(disassembled)
new /obj/item/assembly/igniter/condenser(drop_location())
/obj/structure/closet/secure_closet/freezer/empty
name = "freezer"
/obj/structure/closet/secure_closet/freezer/empty/open
req_access = null
locked = FALSE
/obj/structure/closet/secure_closet/freezer/kitchen
name = "kitchen cabinet"
req_access = list(ACCESS_KITCHEN)
/obj/structure/closet/secure_closet/freezer/kitchen/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/reagent_containers/condiment/flour(src)
new /obj/item/reagent_containers/condiment/rice(src)
new /obj/item/reagent_containers/condiment/sugar(src)
/obj/structure/closet/secure_closet/freezer/kitchen/all_access
req_access = null
/obj/structure/closet/secure_closet/freezer/kitchen/maintenance
name = "maintenance refrigerator"
desc = "This refrigerator looks quite dusty, is there anything edible still inside?"
req_access = null
/obj/structure/closet/secure_closet/freezer/kitchen/maintenance/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/reagent_containers/condiment/milk(src)
new /obj/item/reagent_containers/condiment/soymilk(src)
for(var/i in 1 to 2)
new /obj/item/storage/fancy/egg_box(src)
/obj/structure/closet/secure_closet/freezer/kitchen/mining
req_access = null
/obj/structure/closet/secure_closet/freezer/meat
name = "meat fridge"
req_access = list(ACCESS_KITCHEN)
/obj/structure/closet/secure_closet/freezer/meat/PopulateContents()
..()
for(var/i in 1 to 4)
new /obj/item/food/meat/slab/monkey(src)
/obj/structure/closet/secure_closet/freezer/meat/open
locked = FALSE
req_access = null
/obj/structure/closet/secure_closet/freezer/meat/all_access
req_access = null
/obj/structure/closet/secure_closet/freezer/gulag_fridge
name = "refrigerator"
/obj/structure/closet/secure_closet/freezer/gulag_fridge/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/reagent_containers/cup/glass/bottle/beer/light(src)
/obj/structure/closet/secure_closet/freezer/fridge
name = "refrigerator"
req_access = list(ACCESS_KITCHEN)
/obj/structure/closet/secure_closet/freezer/fridge/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/reagent_containers/condiment/milk(src)
new /obj/item/reagent_containers/condiment/soymilk(src)
for(var/i in 1 to 2)
new /obj/item/storage/fancy/egg_box(src)
/obj/structure/closet/secure_closet/freezer/fridge/all_access
req_access = null
/obj/structure/closet/secure_closet/freezer/fridge/open
req_access = null
locked = FALSE
/obj/structure/closet/secure_closet/freezer/fridge/preopen
req_access = null
locked = FALSE
opened = TRUE
/obj/structure/closet/secure_closet/freezer/money
name = "freezer"
desc = "This contains cold hard cash."
req_access = list(ACCESS_VAULT)
/obj/structure/closet/secure_closet/freezer/money/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/stack/spacecash/c1000(src)
for(var/i in 1 to 5)
new /obj/item/stack/spacecash/c500(src)
for(var/i in 1 to 6)
new /obj/item/stack/spacecash/c200(src)
/obj/structure/closet/secure_closet/freezer/cream_pie
name = "cream pie closet"
desc = "Contains pies filled with cream and/or custard, you sickos."
req_access = list(ACCESS_THEATRE)
/obj/structure/closet/secure_closet/freezer/cream_pie/PopulateContents()
..()
new /obj/item/food/pie/cream(src)