Implements the Mining Equipment Vendor

Adds the Mining Equipment Vendor machine, which sells lots of items for points earned by mining.
Enhanced the ore processor to give points for processed ore.
Added some miscellaneous items such as hyposprays for miners.
Switched mining machines to use the nice new icons.
This commit is contained in:
Leshana
2018-04-24 01:36:21 -04:00
parent d1cfda7048
commit c09412c33e
11 changed files with 329 additions and 10 deletions

View File

@@ -6,11 +6,12 @@
/obj/machinery/mineral/processing_unit_console
name = "production machine console"
icon = 'icons/obj/machines/mining_machines.dmi'
icon = 'icons/obj/machines/mining_machines_vr.dmi' // VOREStation Edit
icon_state = "console"
density = TRUE
anchored = TRUE
var/obj/item/weapon/card/id/inserted_id // VOREStation Edit - Inserted Id card
var/obj/machinery/mineral/processing_unit/machine = null
var/show_all_ores = FALSE
@@ -23,6 +24,24 @@
log_debug("Ore processing machine console at [src.x], [src.y], [src.z] could not find its machine!")
qdel(src)
// VOREStation Add Start
/obj/machinery/mineral/processing_unit_console/Destroy()
if(inserted_id)
inserted_id.forceMove(loc) //Prevents deconstructing from deleting whatever ID was inside it.
. = ..()
/obj/machinery/mineral/processing_unit_console/attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/card/id))
if(!powered())
return
if(!inserted_id && user.unEquip(I))
I.forceMove(src)
inserted_id = I
interact(user)
return
..()
// VOREStation Add End
/obj/machinery/mineral/processing_unit_console/attack_hand(mob/user)
if(..())
return
@@ -39,6 +58,14 @@
user.set_machine(src)
var/dat = "<h1>Ore processor console</h1>"
// VOREStation Add Start
dat += "Current unclaimed points: [machine.points]<br>"
if(istype(inserted_id))
dat += "You have [inserted_id.mining_points] mining points collected. <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br>"
dat += "<A href='?src=\ref[src];choice=claim'>Claim points.</A><br>"
else
dat += "No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>"
// VOREStation Add End
dat += "<hr><table>"
@@ -96,6 +123,29 @@
show_all_ores = !show_all_ores
// VOREStation Add Start
if(href_list["choice"])
if(istype(inserted_id))
if(href_list["choice"] == "eject")
usr.put_in_hands(inserted_id)
inserted_id = null
if(href_list["choice"] == "claim")
if(access_mining_station in inserted_id.access)
inserted_id.mining_points += machine.points
machine.points = 0
else
to_chat(usr, "<span class='warning'>Required access not found.</span>")
else if(href_list["choice"] == "insert")
var/obj/item/weapon/card/id/I = usr.get_active_hand()
if(istype(I))
if(!usr.drop_item())
return 1
I.forceMove(src)
inserted_id = I
else
to_chat(usr, "<span class='warning'>No valid ID.</span>")
// VOREStation Add End
src.updateUsrDialog()
return
@@ -104,7 +154,7 @@
/obj/machinery/mineral/processing_unit
name = "material processor" //This isn't actually a goddamn furnace, we're in space and it's processing platinum and flammable phoron...
icon = 'icons/obj/machines/mining_machines.dmi'
icon = 'icons/obj/machines/mining_machines_vr.dmi' // VOREStation Edit
icon_state = "furnace"
density = TRUE
anchored = TRUE
@@ -117,6 +167,20 @@
var/list/ores_stored[0]
var/static/list/alloy_data
var/active = FALSE
// VOREStation Add Start
var/points = 0
var/static/list/ore_values = list(
"sand" = 1,
"hematite" = 1,
"carbon" = 1,
"phoron" = 15,
"silver" = 16,
"gold" = 18,
"uranium" = 30,
"diamond" = 50,
"platinum" = 40,
"mhydrogen" = 40)
// VOREStation Add End
/obj/machinery/mineral/processing_unit/New()
..()
@@ -147,8 +211,8 @@
return
/obj/machinery/mineral/processing_unit/process()
if (!src.output || !src.input) return
if(!src.output || !src.input) return
if(panel_open || !powered()) return // VOREStation Edit - Don't work when unpowered
var/list/tick_alloys = list()
@@ -158,6 +222,7 @@
if(!O) break
if(!isnull(ores_stored[O.material]))
ores_stored[O.material]++
points += ore_values[O.material] // VOREStation Edit - Give Points!
qdel(O)