[READY] Bespoke Datum Mats (#55296)

* Bespoke Material Backend

- Adds support for bespoke materials:
  - Reimplements [/datum/material/var/id]
  - Ports GetIdFromArguments from SSdcs
  - Adds a wrapper define for GetMaterialRef
  - Adds [MATERIAL_INIT_BESPOKE]
  - Adds [/datum/material/proc/Initialize]
- Does not actually add any bespoke materials

- [ ] TODO: Code docs
- [ ] TODO: Actually adding bespoke materials

* Some has_material procs and cleaning up some spaghetti

- Adds a pair of has_material procs for use in checking whether a given atom has a given material

* Adds meat

- Adds bespoke meat variants
  - Does not make them accessible
- Shuts up the linter

* Implements bespoke meat

- Makes the material container preserve bespoke materials
- Makes the sheetifier accept bespoke materials
- Makes the autolathe accept bespoke materials
- Makes the gibber produce bespoke meats

* Makes butchering produce bespoke meats

This is jank and really needs to be folded into a unified butchering and gibbing system

* Material documentation

- Adds, fixes, and touches up some documentation

* Material container insertion callback

- Changes the proc used to expand the material container's material list ot a proc used to check whether a material fits into a material container
- Instantiating new materials is no longer O(n) relative to the number of autolathes in existence.

* Makes processing meat conserve materials

- Makes bespoke meat carry over into meatballs

* Makes preserving custom materials an option

- Implements the ability to turn preserving custom materials _off_ for processor recipes

* Fixes all bespoke materials of the same type using the same singleton

- We use ids now, not just types.

* Makes the fat sucker produce bespoke meats

- Because consistency is good.

* Fixes autolathes merging bespoke stacks into normal stacks.

* Makes the callback to test materials for holdibility optional

- @Floyd

* GetMaterialRef -> GET_MATERIAL_REF

- We capitalize macros.

* Removes an extraneous callback

- Makes the sheetifier use functionality I didn't notice I implemented a few commits ago.

* Makes mob and species meat null compatible

* Fixes the ore silo

- The ore silo had really snowflake material handling that has been brought in line with the rest.
- The materials should show up in the correct order.

* Fixes minor lathe bugs

- Fixes stack_traces caused when lathes tried to fetch materials using reagent typepaths
- Fixed the selective reagent disposal topic. I have no idea how long this has been broken.

* Various documentation fixes

- Clarified a couple comments
- Removes an extraneous ?. operator
- Fixed mat floor tiles having bugged reagent temperatures

* More fixes

-/datum/material/meat/mob -> /datum/material/meat/mob_meat
- Adds atom typecheck to material containers.

* Fixes old typepaths
This commit is contained in:
TemporalOroboros
2021-01-15 23:39:58 -08:00
committed by GitHub
parent 685602afd9
commit 976c1fcb8c
55 changed files with 641 additions and 245 deletions
+12 -2
View File
@@ -139,7 +139,11 @@
iter_reagent.on_merge(data, amount)
if(reagtemp != cached_temp)
set_temperature(((old_heat_capacity * cached_temp) + (iter_reagent.specific_heat * amount * reagtemp)) / heat_capacity())
var/new_heat_capacity = heat_capacity()
if(new_heat_capacity)
set_temperature(((old_heat_capacity * cached_temp) + (iter_reagent.specific_heat * amount * reagtemp)) / new_heat_capacity)
else
set_temperature(reagtemp)
SEND_SIGNAL(src, COMSIG_REAGENTS_ADD_REAGENT, iter_reagent, amount, reagtemp, data, no_react)
if(!no_react)
@@ -160,7 +164,11 @@
update_total()
if(reagtemp != cached_temp)
set_temperature(((old_heat_capacity * cached_temp) + (new_reagent.specific_heat * amount * reagtemp)) / heat_capacity())
var/new_heat_capacity = heat_capacity()
if(new_heat_capacity)
set_temperature(((old_heat_capacity * cached_temp) + (new_reagent.specific_heat * amount * reagtemp)) / new_heat_capacity)
else
set_temperature(reagtemp)
SEND_SIGNAL(src, COMSIG_REAGENTS_NEW_REAGENT, new_reagent, amount, reagtemp, data, no_react)
if(!no_react)
@@ -978,6 +986,8 @@
*/
/datum/reagents/proc/adjust_thermal_energy(delta_energy, min_temp = 2.7, max_temp = 1000)
var/heat_capacity = heat_capacity()
if(!heat_capacity)
return // no div/0 please
set_temperature(clamp(chem_temp + (delta_energy / heat_capacity), min_temp, max_temp))
/// Applies heat to this holder
+1 -1
View File
@@ -85,7 +85,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
addiction_type = type
if(material)
material = SSmaterials.GetMaterialRef(material)
material = GET_MATERIAL_REF(material)
/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
. = ..()
@@ -125,7 +125,7 @@
*/
/obj/item/reagent_containers/glass/on_accidental_consumption(mob/living/carbon/M, mob/living/carbon/user, obj/item/source_item, discover_after = TRUE)
if(!custom_materials)
set_custom_materials(list(SSmaterials.GetMaterialRef(/datum/material/glass) = 5))//sets it to glass so, later on, it gets picked up by the glass catch (hope it doesn't 'break' things lol)
set_custom_materials(list(GET_MATERIAL_REF(/datum/material/glass) = 5))//sets it to glass so, later on, it gets picked up by the glass catch (hope it doesn't 'break' things lol)
return ..()
/obj/item/reagent_containers/glass/beaker