diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm
index dfb756d8c25..def012e2663 100644
--- a/code/game/objects/items/stacks/sheets/glass.dm
+++ b/code/game/objects/items/stacks/sheets/glass.dm
@@ -32,6 +32,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
created_window = /obj/structure/window/basic
full_window = /obj/structure/window/full/basic
merge_type = /obj/item/stack/sheet/glass
+ point_value = 1
/obj/item/stack/sheet/glass/fifty
amount = 50
@@ -90,6 +91,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \
created_window = /obj/structure/window/reinforced
full_window = /obj/structure/window/full/reinforced
merge_type = /obj/item/stack/sheet/rglass
+ point_value = 4
/obj/item/stack/sheet/rglass/cyborg
materials = list()
@@ -113,6 +115,7 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \
origin_tech = "plasmatech=2;materials=2"
created_window = /obj/structure/window/plasmabasic
full_window = /obj/structure/window/full/plasmabasic
+ point_value = 19
/obj/item/stack/sheet/plasmaglass/New(loc, amount)
recipes = GLOB.pglass_recipes
@@ -154,6 +157,7 @@ GLOBAL_LIST_INIT(prglass_recipes, list ( \
created_window = /obj/structure/window/plasmareinforced
full_window = /obj/structure/window/full/plasmareinforced
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0)
+ point_value = 23
/obj/item/stack/sheet/plasmarglass/New(loc, amount)
recipes = GLOB.prglass_recipes
diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm
index 72c0bef16ff..8c60bcefa11 100644
--- a/code/game/objects/items/stacks/sheets/mineral.dm
+++ b/code/game/objects/items/stacks/sheets/mineral.dm
@@ -144,6 +144,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
origin_tech = "materials=6"
sheettype = "diamond"
materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT)
+ point_value = 25
/obj/item/stack/sheet/mineral/diamond/New()
..()
@@ -156,6 +157,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
origin_tech = "materials=5"
sheettype = "uranium"
materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT)
+ point_value = 20
/obj/item/stack/sheet/mineral/uranium/New()
..()
@@ -170,6 +172,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT)
burn_state = FLAMMABLE
burntime = 5
+ point_value = 20
/obj/item/stack/sheet/mineral/plasma/New()
..()
@@ -196,6 +199,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
origin_tech = "materials=4"
sheettype = "gold"
materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT)
+ point_value = 20
/obj/item/stack/sheet/mineral/gold/New()
..()
@@ -208,6 +212,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
origin_tech = "materials=4"
sheettype = "silver"
materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT)
+ point_value = 20
/obj/item/stack/sheet/mineral/silver/New()
..()
@@ -220,6 +225,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
origin_tech = "materials=4"
sheettype = "bananium"
materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT)
+ point_value = 50
/obj/item/stack/sheet/mineral/bananium/New(loc, amount=null)
..()
@@ -233,6 +239,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
sheettype = "tranquillite"
materials = list(MAT_TRANQUILLITE=MINERAL_MATERIAL_AMOUNT)
wall_allowed = FALSE //no tranquilite walls in code
+ point_value = 50
/obj/item/stack/sheet/mineral/tranquillite/New(loc, amount=null)
..()
@@ -253,6 +260,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list(
throw_range = 3
sheettype = "titanium"
materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT)
+ point_value = 20
var/global/list/datum/stack_recipe/titanium_recipes = list (
new/datum/stack_recipe("titanium tile", /obj/item/stack/tile/mineral/titanium, 1, 4, 20),
@@ -282,6 +290,7 @@ var/global/list/datum/stack_recipe/titanium_recipes = list (
throw_range = 3
sheettype = "plastitanium"
materials = list(MAT_TITANIUM=2000, MAT_PLASMA=2000)
+ point_value = 45
var/global/list/datum/stack_recipe/plastitanium_recipes = list (
new/datum/stack_recipe("plas-titanium tile", /obj/item/stack/tile/mineral/plastitanium, 1, 4, 20),
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index 94f195e9c20..c32a65f3def 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -105,6 +105,7 @@ var/global/list/datum/stack_recipe/metal_recipes = list(
flags = CONDUCT
origin_tech = "materials=1"
merge_type = /obj/item/stack/sheet/metal
+ point_value = 2
/obj/item/stack/sheet/metal/cyborg
materials = list()
@@ -151,6 +152,7 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list(
flags = CONDUCT
origin_tech = "materials=2"
merge_type = /obj/item/stack/sheet/plasteel
+ point_value = 23
/obj/item/stack/sheet/plasteel/New(var/loc, var/amount=null)
recipes = plasteel_recipes
diff --git a/code/game/objects/items/stacks/sheets/sheets.dm b/code/game/objects/items/stacks/sheets/sheets.dm
index 100704ed658..13774b0db4b 100644
--- a/code/game/objects/items/stacks/sheets/sheets.dm
+++ b/code/game/objects/items/stacks/sheets/sheets.dm
@@ -9,22 +9,10 @@
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "smashed")
var/perunit = MINERAL_MATERIAL_AMOUNT
var/sheettype = null //this is used for girders in the creation of walls/false walls
+ var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity.
+
var/created_window = null //apparently glass sheets don't share a base type for glass specifically, so each had to define these vars individually
var/full_window = null //moving the var declaration to here so this can be checked cleaner until someone is willing to make them share a base type properly
usesound = 'sound/items/deconstruct.ogg'
toolspeed = 1
var/wall_allowed = TRUE //determines if sheet can be used in wall construction or not.
-
-
-// Since the sheetsnatcher was consolidated into weapon/storage/bag we now use
-// item/attackby() properly, making this unnecessary
-
-/*/obj/item/stack/sheet/attackby(obj/item/W as obj, mob/user as mob, params)
- if(istype(W, /obj/item/storage/bag/sheetsnatcher))
- var/obj/item/storage/bag/sheetsnatcher/S = W
- if(!S.mode)
- S.add(src,user)
- else
- for(var/obj/item/stack/sheet/stack in locate(src.x,src.y,src.z))
- S.add(stack,user)
- ..()*/
diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm
index d3e22e5bca2..fb2b915f146 100644
--- a/code/modules/mining/laborcamp/laborstacker.dm
+++ b/code/modules/mining/laborcamp/laborstacker.dm
@@ -1,3 +1,5 @@
+GLOBAL_LIST(labor_sheet_values)
+
/**********************Prisoners' Console**************************/
/obj/machinery/mineral/labor_claim_console
@@ -5,153 +7,153 @@
desc = "A stacking console with an electromagnetic writer, used to track ore mined by prisoners."
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
- density = 0
- anchored = 1
- var/obj/machinery/mineral/stacking_machine/laborstacker/machine = null
+ density = FALSE
+ var/obj/machinery/mineral/stacking_machine/laborstacker/stacking_machine = null
var/machinedir = SOUTH
var/obj/item/card/id/prisoner/inserted_id
var/obj/machinery/door/airlock/release_door
var/door_tag = "prisonshuttle"
- var/use_release_door = 0
var/obj/item/radio/intercom/announcer
-
-/obj/machinery/mineral/labor_claim_console/New()
- ..()
+/obj/machinery/mineral/labor_claim_console/Initialize()
+ . = ..()
announcer = new /obj/item/radio/intercom(null)
announcer.config(list("Security" = 0))
+ locate_stacking_machine()
- spawn(7)
- src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
- var/t
- for(var/obj/machinery/door/airlock/d in range(5,src))
- t = d.id_tag
- if(t == src.door_tag)
- src.release_door = d
- if(machine && (release_door || !use_release_door))
- machine.CONSOLE = src
+ if(!GLOB.labor_sheet_values)
+ var/sheet_list = list()
+ for(var/sheet_type in subtypesof(/obj/item/stack/sheet))
+ var/obj/item/stack/sheet/sheet = sheet_type
+ if(!initial(sheet.point_value) || (initial(sheet.merge_type) && initial(sheet.merge_type) != sheet_type)) //ignore no-value sheets and x/fifty subtypes
+ continue
+ sheet_list += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value)))
+ GLOB.labor_sheet_values = sheet_list
+
+/obj/machinery/mineral/labor_claim_console/Destroy()
+ . = ..()
+ QDEL_NULL(announcer)
+
+/proc/cmp_sheet_list(list/a, list/b)
+ return a["value"] - b["value"]
+
+/obj/machinery/mineral/labor_claim_console/attackby(obj/item/I, mob/user, params)
+ if(istype(I, /obj/item/card/id/prisoner))
+ if(!inserted_id)
+ if(!user.unEquip(I))
+ return
+ I.forceMove(src)
+ inserted_id = I
+ to_chat(user, "You insert [I].")
+ SSnanoui.update_uis(src)
+ return
else
- qdel(src)
+ to_chat(user, "There's an ID inserted already.")
+ return ..()
+
+/obj/machinery/mineral/labor_claim_console/attack_hand(mob/user)
+ ui_interact(user)
+
+/obj/machinery/mineral/labor_claim_console/attack_ghost(mob/user)
+ attack_hand(user)
+
+/obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = default_state)
+ ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
+ if(!ui)
+ ui = new(user, src, ui_key, "labor_claim_console.tmpl", name, 450, 625, state)
+ ui.open()
+
+/obj/machinery/mineral/labor_claim_console/ui_data(mob/user)
+ var/list/data = list()
+ var/can_go_home = FALSE
+
+ data["emagged"] = (emagged) ? TRUE : FALSE
+ if(inserted_id)
+ data["id"] = inserted_id
+ data["id_name"] = inserted_id.registered_name
+ data["points"] = inserted_id.points
+ data["goal"] = inserted_id.goal
+ if(check_auth())
+ can_go_home = TRUE
+
+ if(stacking_machine)
+ data["unclaimed_points"] = stacking_machine.points
+
+ data["ores"] = GLOB.labor_sheet_values
+ data["can_go_home"] = can_go_home
+
+ return data
+
+/obj/machinery/mineral/labor_claim_console/Topic(href, href_list)
+ if(..())
+ return TRUE
+
+ if(href_list["handle_id"])
+ if(inserted_id)
+ if(!usr.put_in_hands(inserted_id))
+ inserted_id.forceMove(get_turf(src))
+ inserted_id = null
+ else
+ var/obj/item/I = usr.get_active_hand()
+ if(istype(I, /obj/item/card/id/prisoner))
+ if(!usr.unEquip(I))
+ return
+ I.forceMove(src)
+ inserted_id = I
+ if(href_list["claim_points"])
+ inserted_id.points += stacking_machine.points
+ stacking_machine.points = 0
+ to_chat(usr, "Points transferred.")
+ if(href_list["move_shuttle"])
+ if(!alone_in_area(get_area(src), usr))
+ to_chat(usr, "Prisoners are only allowed to be released while alone.")
+ else
+ switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
+ if(1)
+ to_chat(usr, "Shuttle not found.")
+ if(2)
+ to_chat(usr, "Shuttle already at station.")
+ if(3)
+ to_chat(usr, "No permission to dock could be granted.")
+ else
+ if(!(emagged))
+ var/message = "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval."
+ announcer.autosay(message, "Labor Camp Controller", "Security")
+ to_chat(usr, "Shuttle received message and will be sent shortly.")
+
+ return TRUE
/obj/machinery/mineral/labor_claim_console/proc/check_auth()
- if(emagged) return 1 //Shuttle is emagged, let any ol' person through
+ if(emagged)
+ return TRUE //Shuttle is emagged, let any ol' person through
return (istype(inserted_id) && inserted_id.points >= inserted_id.goal) //Otherwise, only let them out if the prisoner's reached his quota.
+/obj/machinery/mineral/labor_claim_console/proc/locate_stacking_machine()
+ stacking_machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
+ if(stacking_machine)
+ stacking_machine.CONSOLE = src
+ else
+ qdel(src)
-/obj/machinery/mineral/labor_claim_console/attack_hand(user as mob)
- var/dat
- dat += text("Point Claim Console
")
- if(emagged) //Shit's broken
- dat += text("QUt0A In%aL*D
")
- else if(istype(inserted_id)) //There's an ID in there.
- dat += text("ID: [inserted_id.registered_name] Eject ID.
")
- dat += text("Points Collected:[inserted_id.points]
")
- dat += text("Point Quota: [inserted_id.goal] - Reach your quota to earn your release
")
- dat += text("Unclaimed Collection Points: [machine.points]. Claim points.
")
- else //No ID in sight. Complain about it.
- dat += text("No ID inserted. Insert ID.
")
- if(check_auth())
- dat += text("Proceed to station.
")
- if(use_release_door)
- dat += text("Open release door.
")
- if(machine)
- dat += text("
| [capitalize(ore)] | [value] |