Revert "[MIRROR] Port material containers to datum components" (#2597)
* Revert "sprite fix on kitsune tails" This reverts commit44d5b21a43. * Revert "Update vg_clothing_packs.dm (#2591)" This reverts commit7f46280d6b. * Revert "Automatic changelog generation for PR #2590 [ci skip]" This reverts commit201e07033f. * Revert "[MIRROR] Gives the detective a mass spectrometer (#2590)" This reverts commit5c98b9a13b. * Revert "Quick sync (#2587)" This reverts commit92e055be97. * Revert "Automatic changelog generation for PR #2557 [ci skip]" This reverts commit241a10d88d. * Revert "Decreases hacked ai module cost (#2557)" This reverts commitd959b7538a. * Revert "[MIRROR] Port material containers to datum components (#2562)" This reverts commit32300086d5.
This commit is contained in:
@@ -66,6 +66,7 @@
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
var/obj/machinery/mineral/CONSOLE = null
|
||||
var/datum/material_container/materials
|
||||
var/on = FALSE
|
||||
var/selected_material = MAT_METAL
|
||||
var/selected_alloy = null
|
||||
@@ -74,11 +75,12 @@
|
||||
/obj/machinery/mineral/processing_unit/Initialize()
|
||||
. = ..()
|
||||
proximity_monitor = new(src, 1)
|
||||
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE), INFINITY)
|
||||
materials = new(src, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TITANIUM, MAT_BLUESPACE),INFINITY)
|
||||
files = new /datum/research/smelter(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/Destroy()
|
||||
CONSOLE = null
|
||||
QDEL_NULL(materials)
|
||||
QDEL_NULL(files)
|
||||
return ..()
|
||||
|
||||
@@ -87,7 +89,6 @@
|
||||
process_ore(AM)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/ore/O)
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
var/material_amount = materials.get_item_material_amount(O)
|
||||
if(!materials.has_space(material_amount))
|
||||
unload_mineral(O)
|
||||
@@ -99,7 +100,6 @@
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/get_machine_data()
|
||||
var/dat = "<b>Smelter control console</b><br><br>"
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
for(var/mat_id in materials.materials)
|
||||
var/datum/material/M = materials.materials[mat_id]
|
||||
dat += "<span class=\"res_name\">[M.name]: </span>[M.amount] cm³"
|
||||
@@ -165,7 +165,6 @@
|
||||
continue*/
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
var/datum/material/mat = materials.materials[selected_material]
|
||||
if(mat)
|
||||
var/sheets_to_remove = (mat.amount >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT) ) ? SMELT_AMOUNT : round(mat.amount / MINERAL_MATERIAL_AMOUNT)
|
||||
@@ -188,7 +187,6 @@
|
||||
on = FALSE
|
||||
return
|
||||
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
materials.use_amount(alloy.materials, amount)
|
||||
|
||||
generate_mineral(alloy.build_path)
|
||||
@@ -199,7 +197,6 @@
|
||||
|
||||
var/build_amount = SMELT_AMOUNT
|
||||
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
|
||||
for(var/mat_id in D.materials)
|
||||
var/M = D.materials[mat_id]
|
||||
@@ -217,7 +214,6 @@
|
||||
unload_mineral(O)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/on_deconstruction()
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
materials.retrieve_all()
|
||||
..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user