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:
+16
-12
@@ -5,32 +5,37 @@
|
||||
name = "coin press"
|
||||
icon = 'icons/obj/economy.dmi'
|
||||
icon_state = "coinpress0"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
var/datum/material_container/materials
|
||||
var/newCoins = 0 //how many coins the machine made in it's last load
|
||||
var/processing = FALSE
|
||||
var/processing = FALSE
|
||||
var/chosen = MAT_METAL //which material will be used to make coins
|
||||
var/coinsToProduce = 10
|
||||
speed_process = 1
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/Initialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM), MINERAL_MATERIAL_AMOUNT * 50)
|
||||
/obj/machinery/mineral/mint/Initialize()
|
||||
. = ..()
|
||||
materials = new /datum/material_container(src,
|
||||
list(MAT_METAL, MAT_PLASMA, MAT_SILVER, MAT_GOLD, MAT_URANIUM, MAT_DIAMOND, MAT_BANANIUM),
|
||||
max_amt = MINERAL_MATERIAL_AMOUNT*50)
|
||||
|
||||
/obj/machinery/mineral/mint/Destroy()
|
||||
QDEL_NULL(materials)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/mineral/mint/process()
|
||||
var/turf/T = get_step(src, input_dir)
|
||||
if(!T)
|
||||
return
|
||||
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
|
||||
for(var/obj/item/stack/sheet/O in T)
|
||||
materials.insert_stack(O, O.amount)
|
||||
|
||||
/obj/machinery/mineral/mint/attack_hand(mob/user)
|
||||
var/dat = "<b>Coin Press</b><br>"
|
||||
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
for(var/mat_id in materials.materials)
|
||||
var/datum/material/M = materials.materials[mat_id]
|
||||
if(!M.amount && chosen != mat_id)
|
||||
@@ -63,7 +68,6 @@
|
||||
if(processing==1)
|
||||
to_chat(usr, "<span class='notice'>The machine is processing.</span>")
|
||||
return
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
if(href_list["choose"])
|
||||
if(materials.materials[href_list["choose"]])
|
||||
chosen = href_list["choose"]
|
||||
@@ -71,7 +75,7 @@
|
||||
coinsToProduce = Clamp(coinsToProduce + text2num(href_list["chooseAmt"]), 0, 1000)
|
||||
if(href_list["makeCoins"])
|
||||
var/temp_coins = coinsToProduce
|
||||
processing = TRUE
|
||||
processing = TRUE
|
||||
icon_state = "coinpress1"
|
||||
var/coin_mat = MINERAL_MATERIAL_AMOUNT * 0.2
|
||||
var/datum/material/M = materials.materials[chosen]
|
||||
@@ -87,7 +91,7 @@
|
||||
sleep(5)
|
||||
|
||||
icon_state = "coinpress0"
|
||||
processing = FALSE
|
||||
processing = FALSE
|
||||
coinsToProduce = temp_coins
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user