@@ -1,17 +1,17 @@
|
||||
#define SMELT_AMOUNT 10
|
||||
|
||||
/**********************Mineral processing unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console
|
||||
name = "production machine console"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
speed_process = 1
|
||||
|
||||
/**********************Mineral processing unit console**************************/
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console
|
||||
name = "production machine console"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/processing_unit/machine = null
|
||||
var/machinedir = EAST
|
||||
speed_process = 1
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Initialize()
|
||||
. = ..()
|
||||
machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
|
||||
@@ -19,22 +19,22 @@
|
||||
machine.CONSOLE = src
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
|
||||
|
||||
if(!machine)
|
||||
return
|
||||
|
||||
|
||||
var/dat = machine.get_machine_data()
|
||||
|
||||
|
||||
var/datum/browser/popup = new(user, "processing", "Smelting Console", 300, 500)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(href_list["material"])
|
||||
@@ -45,33 +45,33 @@
|
||||
machine.selected_material = null
|
||||
machine.selected_alloy = href_list["alloy"]
|
||||
|
||||
if(href_list["set_on"])
|
||||
if(href_list["set_on"])
|
||||
machine.on = (href_list["set_on"] == "on")
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/processing_unit_console/Destroy()
|
||||
machine = null
|
||||
return ..()
|
||||
|
||||
|
||||
/**********************Mineral processing unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "furnace"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/CONSOLE = null
|
||||
/**********************Mineral processing unit**************************/
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit
|
||||
name = "furnace"
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "furnace"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var/obj/machinery/mineral/CONSOLE = null
|
||||
var/datum/material_container/materials
|
||||
var/on = FALSE
|
||||
var/selected_material = MAT_METAL
|
||||
var/selected_alloy = null
|
||||
var/datum/research/files
|
||||
|
||||
|
||||
/obj/machinery/mineral/processing_unit/Initialize()
|
||||
. = ..()
|
||||
proximity_monitor = new(src, 1)
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
return dat
|
||||
|
||||
/obj/machinery/mineral/processing_unit/process()
|
||||
/obj/machinery/mineral/processing_unit/process()
|
||||
if (on)
|
||||
if(selected_material)
|
||||
smelt_ore()
|
||||
@@ -144,26 +144,26 @@
|
||||
CONSOLE.updateUsrDialog()
|
||||
|
||||
|
||||
//THESE TWO ARE CODED FOR URIST TO USE WHEN HE GETS AROUND TO IT.
|
||||
//They were coded on 18 Feb 2012. If you're reading this in 2015, then firstly congratulations on the world not ending on 21 Dec 2012 and secondly, Urist is apparently VERY lazy. ~Errorage
|
||||
//Even in the dark year of 2016, where /tg/ is dead, Urist still hasn't finished this -Bawhoppennn
|
||||
/*if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_uranium >= 2 && ore_diamond >= 1)
|
||||
ore_uranium -= 2
|
||||
ore_diamond -= 1
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/adamantine)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_silver >= 1 && ore_plasma >= 3)
|
||||
ore_silver -= 1
|
||||
ore_plasma -= 3
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/mythril)
|
||||
else
|
||||
on = 0
|
||||
continue*/
|
||||
|
||||
//THESE TWO ARE CODED FOR URIST TO USE WHEN HE GETS AROUND TO IT.
|
||||
//They were coded on 18 Feb 2012. If you're reading this in 2015, then firstly congratulations on the world not ending on 21 Dec 2012 and secondly, Urist is apparently VERY lazy. ~Errorage
|
||||
//Even in the dark year of 2016, where /tg/ is dead, Urist still hasn't finished this -Bawhoppennn
|
||||
/*if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_uranium >= 2 && ore_diamond >= 1)
|
||||
ore_uranium -= 2
|
||||
ore_diamond -= 1
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/adamantine)
|
||||
else
|
||||
on = 0
|
||||
continue
|
||||
if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0)
|
||||
if (ore_silver >= 1 && ore_plasma >= 3)
|
||||
ore_silver -= 1
|
||||
ore_plasma -= 3
|
||||
generate_mineral(/obj/item/stack/sheet/mineral/mythril)
|
||||
else
|
||||
on = 0
|
||||
continue*/
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
|
||||
var/datum/material/mat = materials.materials[selected_material]
|
||||
if(mat)
|
||||
@@ -208,10 +208,10 @@
|
||||
build_amount = min(build_amount, round(smelter_mat.amount / M))
|
||||
|
||||
return build_amount
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/generate_mineral(P)
|
||||
var/O = new P(src)
|
||||
unload_mineral(O)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/proc/generate_mineral(P)
|
||||
var/O = new P(src)
|
||||
unload_mineral(O)
|
||||
|
||||
/obj/machinery/mineral/processing_unit/on_deconstruction()
|
||||
materials.retrieve_all()
|
||||
|
||||
Reference in New Issue
Block a user