mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-15 09:56:47 +01:00
Materials Repath (#22388)
Soft-ish port of https://github.com/NebulaSS13/Nebula/pull/540. Except we call them singletons. Repaths all materials as singletons instead of datums, and replaces material defines from strings to paths so that we can just run GET_SINGLETON instead of needing to use SSMaterials. This is Step One. This PR has no player-facing changes. changes: - refactor: "Repaths /material to /singleton/material." - refactor: "Replaces all material string defines to path defines, replacing SSmaterials procs w/ GET_SINGLETON instead." - refactor: "Removes all material var edited objects from all maps, adding new presets where necessary." - refactor: "Updates recipes unit test to run all recipes against all material singletons." --------- Signed-off-by: Batrachophreno <Batrochophreno@gmail.com> Co-authored-by: kano-dot <bhutanlikanoxy@gmail.com>
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
var/points = 0
|
||||
|
||||
var/list/ore/input_mats = list()
|
||||
var/list/material/output_mats = list()
|
||||
var/list/singleton/material/output_mats = list()
|
||||
var/list/datum/alloy/alloy_mats = list()
|
||||
var/waste = 0
|
||||
var/idx = 0
|
||||
@@ -275,7 +275,7 @@
|
||||
|
||||
dat += "<table>"
|
||||
|
||||
for(var/material/OM in output_mats)
|
||||
for(var/singleton/material/OM in output_mats)
|
||||
if(output_mats[OM] > 1)
|
||||
dat += "<tr><td><b><small>[output_mats[OM]]</b></small></td><td><small>[OM.display_name] [OM.sheet_plural_name]</small></td></tr>"
|
||||
else
|
||||
@@ -523,7 +523,7 @@ GLOBAL_LIST_EMPTY_TYPED(alloy_data, /datum/alloy)
|
||||
if(can_make % 2 > 0)
|
||||
can_make--
|
||||
|
||||
var/material/M = SSmaterials.get_material_by_name(O.compresses_to)
|
||||
var/singleton/material/M = GET_SINGLETON(O.compresses_to)
|
||||
|
||||
if(!istype(M) || !can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
@@ -541,7 +541,7 @@ GLOBAL_LIST_EMPTY_TYPED(alloy_data, /datum/alloy)
|
||||
else if(ores_processing[metal] & SMELTER_MODE_SMELTING && O.smelts_to)
|
||||
var/can_make = clamp(ores_stored[metal], 0, ROUND_UP(sheets_per_second*seconds_per_tick) - sheets)
|
||||
|
||||
var/material/M = SSmaterials.get_material_by_name(O.smelts_to)
|
||||
var/singleton/material/M = GET_SINGLETON(O.smelts_to)
|
||||
if(!istype(M) || !can_make || ores_stored[metal] < 1)
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user