mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Various fixes and QoL tweaks to labor camp (#18841)
* gulag QoL fixes * escape route, analyzer * stops people from spam calling the shuttle down * unifies access * moves ofitser, fixes point claim console * TGUI build * unifies point system for good * TGUI deps * tweak * sirryan review * hard ref removal * more changes * scope creep scope creep * sirryan!
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -5,11 +5,11 @@
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_keyboard = "security_key"
|
||||
icon_screen = "explosive"
|
||||
req_access = list(ACCESS_ARMORY)
|
||||
req_access = list(ACCESS_BRIG)
|
||||
circuit = /obj/item/circuitboard/prisoner
|
||||
|
||||
var/authenticated = FALSE // FALSE - No Access Denied, TRUE - Access allowed
|
||||
var/obj/item/card/id/prisoner/inserted_id
|
||||
var/inserted_id_uid
|
||||
|
||||
light_color = LIGHT_COLOR_DARKRED
|
||||
|
||||
@@ -21,13 +21,25 @@
|
||||
GLOB.prisoncomputer_list -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/prisoner/attackby(obj/item/O, mob/user, params)
|
||||
var/datum/ui_login/state = ui_login_get()
|
||||
if(state.logged_in)
|
||||
var/obj/item/card/id/prisoner/I = O
|
||||
if(istype(I) && user.drop_item())
|
||||
I.forceMove(src)
|
||||
inserted_id_uid = I.UID()
|
||||
return
|
||||
if(ui_login_attackby(O, user))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/prisoner/attack_ai(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/prisoner/attack_hand(mob/user)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
add_fingerprint(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/computer/prisoner/proc/check_implant(obj/item/implant/I)
|
||||
@@ -41,15 +53,16 @@
|
||||
/obj/machinery/computer/prisoner/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "PrisonerImplantManager", name, 475, 500, master_ui, state)
|
||||
ui = new(user, src, ui_key, "PrisonerImplantManager", name, 500, 500, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/prisoner/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
ui_login_data(data, user)
|
||||
var/obj/item/card/id/prisoner/inserted_id = locateUID(inserted_id_uid)
|
||||
data["prisonerInfo"] = list(
|
||||
"name" = inserted_id?.name,
|
||||
"points" = inserted_id?.points,
|
||||
"points" = inserted_id?.mining_points,
|
||||
"goal" = inserted_id?.goal,
|
||||
)
|
||||
|
||||
@@ -97,7 +110,7 @@
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
add_fingerprint(ui.user)
|
||||
|
||||
if(ui_act_modal(action, params, ui))
|
||||
return
|
||||
@@ -105,19 +118,18 @@
|
||||
return
|
||||
|
||||
var/mob/living/user = ui.user
|
||||
|
||||
|
||||
|
||||
var/obj/item/card/id/prisoner/inserted_id = locateUID(inserted_id_uid)
|
||||
switch(action)
|
||||
if("id_card")
|
||||
if(inserted_id)
|
||||
inserted_id.forceMove(loc)
|
||||
inserted_id = null
|
||||
if(!ui.user.put_in_hands(inserted_id))
|
||||
inserted_id.forceMove(get_turf(src))
|
||||
inserted_id_uid = null
|
||||
return
|
||||
var/obj/item/card/id/prisoner/I = user.get_active_hand()
|
||||
if(istype(I) && user.drop_item())
|
||||
I.forceMove(src)
|
||||
inserted_id = I
|
||||
inserted_id_uid = I.UID()
|
||||
else
|
||||
to_chat(user, "<span class='warning'>No valid ID.</span>")
|
||||
if("inject")
|
||||
@@ -127,8 +139,7 @@
|
||||
implant.activate(text2num(params["amount"]))
|
||||
if("reset_points")
|
||||
if(inserted_id)
|
||||
inserted_id.points = 0
|
||||
|
||||
inserted_id.mining_points = 0
|
||||
|
||||
/obj/machinery/computer/prisoner/proc/ui_act_modal(action, list/params, datum/tgui/ui)
|
||||
if(!ui_login_get().logged_in)
|
||||
@@ -137,6 +148,7 @@
|
||||
var/id = params["id"]
|
||||
var/mob/living/user = ui.user
|
||||
var/list/arguments = istext(params["arguments"]) ? json_decode(params["arguments"]) : params["arguments"]
|
||||
|
||||
switch(ui_modal_act(src, action, params))
|
||||
if(UI_MODAL_OPEN)
|
||||
switch(id)
|
||||
@@ -146,8 +158,7 @@
|
||||
))
|
||||
if("set_points")
|
||||
ui_modal_input(src, id, "Please enter the new point goal:", null, arguments)
|
||||
else
|
||||
return FALSE
|
||||
|
||||
if(UI_MODAL_ANSWER)
|
||||
var/answer = params["answer"]
|
||||
switch(id)
|
||||
@@ -163,11 +174,11 @@
|
||||
var/mob/living/carbon/implantee = implant.imp_in
|
||||
var/warning = copytext(sanitize(text2num(answer)), 1, MAX_MESSAGE_LEN)
|
||||
to_chat(implantee, "<span class='boldnotice'>Your skull vibrates violently as a loud announcement is broadcasted to you: '[warning]'</span>")
|
||||
|
||||
if("set_points")
|
||||
if(isnull(text2num(answer)))
|
||||
return
|
||||
inserted_id.goal = max(text2num(answer), 0)
|
||||
else
|
||||
return FALSE
|
||||
else
|
||||
return FALSE
|
||||
var/obj/item/card/id/prisoner/inserted_id = locateUID(inserted_id_uid)
|
||||
inserted_id?.goal = max(text2num(answer), 0)
|
||||
|
||||
return FALSE
|
||||
|
||||
@@ -657,10 +657,11 @@
|
||||
assignment = "Prisoner"
|
||||
registered_name = "Scum"
|
||||
var/goal = 0 //How far from freedom?
|
||||
var/points = 0
|
||||
|
||||
/obj/item/card/id/prisoner/attack_self(mob/user as mob)
|
||||
to_chat(usr, "You have accumulated [points] out of the [goal] points you need for freedom.")
|
||||
/obj/item/card/id/prisoner/examine(mob/user)
|
||||
. = ..()
|
||||
if(goal)
|
||||
. += "\nYou have accumulated [mining_points] out of the [goal] points assigned to gain freedom."
|
||||
|
||||
/obj/item/card/id/prisoner/one
|
||||
name = "Prisoner #13-001"
|
||||
|
||||
@@ -304,6 +304,39 @@
|
||||
new /obj/item/card/id/prisoner/random(src)
|
||||
new /obj/item/radio/headset(src)
|
||||
|
||||
/obj/structure/closet/secure_closet/brig/gulag
|
||||
name = "labor camp locker"
|
||||
desc = "A special locker designed to store prisoner belongings, allows access when prisoners meet their point quota."
|
||||
locked = FALSE
|
||||
var/registered_ID_UID
|
||||
|
||||
/obj/structure/closet/secure_closet/brig/gulag/allowed(mob/M)
|
||||
. = ..()
|
||||
if(.) //we were gonna let them do it anyway
|
||||
return TRUE
|
||||
|
||||
for(var/obj/item/card/id/prisoner/prisoner_id in M) //they might have a stash of them
|
||||
if(!prisoner_id.goal)
|
||||
continue //no goal? no interaction
|
||||
|
||||
if(locked && registered_ID_UID && !(prisoner_id.UID() == registered_ID_UID))
|
||||
continue //you don't own this!
|
||||
|
||||
if(!locked)
|
||||
registered_ID_UID = prisoner_id.UID()
|
||||
return TRUE //they are trying to lock it, so let them
|
||||
|
||||
if(prisoner_id.mining_points >= prisoner_id.goal)
|
||||
registered_ID_UID = null
|
||||
return TRUE //completed goal? do the interaction
|
||||
|
||||
return FALSE //if we didn't match above, no interaction for you
|
||||
|
||||
/obj/structure/closet/secure_closet/brig/gulag/examine(mob/user)
|
||||
. = ..()
|
||||
if(registered_ID_UID)
|
||||
var/obj/item/card/id/prisoner/prisoner_id = locateUID(registered_ID_UID)
|
||||
. += "\nOwned by [prisoner_id.registered_name]."
|
||||
|
||||
/obj/structure/closet/secure_closet/courtroom
|
||||
name = "courtroom locker"
|
||||
|
||||
@@ -6,10 +6,180 @@
|
||||
possible_destinations = "laborcamp_home;laborcamp_away"
|
||||
req_access = list(ACCESS_BRIG)
|
||||
|
||||
|
||||
/obj/machinery/computer/shuttle/labor/one_way
|
||||
name = "prisoner shuttle console"
|
||||
desc = "A one-way shuttle console, used to summon the shuttle to the labor camp."
|
||||
possible_destinations = "laborcamp_away"
|
||||
circuit = /obj/item/circuitboard/labor_shuttle/one_way
|
||||
req_access = list( )
|
||||
|
||||
/obj/machinery/computer/shuttle/labor/one_way/allowed(mob/M)
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
for(var/obj/item/card/id/prisoner/prisoner_id in M)
|
||||
if(!prisoner_id.goal)
|
||||
continue //no goal? no shuttle
|
||||
|
||||
if(prisoner_id.mining_points >= prisoner_id.goal)
|
||||
return TRUE //completed goal? call it
|
||||
|
||||
return FALSE //if we didn't match above, no shuttle call
|
||||
|
||||
/**********************Prisoners' Console**************************/
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console
|
||||
name = "prisoner shuttle controller"
|
||||
desc = "A console used by released prisoners to move the shuttle."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
var/machinedir = SOUTH
|
||||
var/inserted_id_uid
|
||||
var/obj/item/radio/intercom/announcer
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/Initialize()
|
||||
. = ..()
|
||||
announcer = new /obj/item/radio/intercom(null)
|
||||
announcer.config(list("Security" = 0))
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/Destroy()
|
||||
QDEL_NULL(announcer)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
if(inserted_id_uid)
|
||||
to_chat(user, "<span class='notice'>There's an ID inserted already.</span>")
|
||||
return
|
||||
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
|
||||
I.forceMove(src)
|
||||
inserted_id_uid = I.UID()
|
||||
to_chat(user, "<span class='notice'>You insert [I].</span>")
|
||||
SStgui.update_uis(src)
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/attack_ghost(mob/user)
|
||||
attack_hand(user)
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "PrisonerShuttleConsole", name, 315, 150, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/obj/item/card/id/prisoner/inserted_id = locateUID(inserted_id_uid)
|
||||
|
||||
data["emagged"] = emagged
|
||||
data["id_inserted"] = !isnull(inserted_id)
|
||||
if(inserted_id)
|
||||
data["id_name"] = inserted_id.registered_name
|
||||
data["id_points"] = inserted_id.mining_points
|
||||
data["id_goal"] = inserted_id.goal
|
||||
|
||||
data["can_go_home"] = check_auth()
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/ui_act(action, params, datum/tgui/ui)
|
||||
if(..())
|
||||
return
|
||||
var/obj/item/card/id/prisoner/inserted_id = locateUID(inserted_id_uid)
|
||||
switch(action)
|
||||
if("handle_id")
|
||||
if(inserted_id)
|
||||
if(!ui.user.put_in_hands(inserted_id))
|
||||
inserted_id.forceMove(get_turf(src))
|
||||
inserted_id_uid = null
|
||||
return TRUE
|
||||
|
||||
var/obj/item/I = ui.user.get_active_hand()
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
if(!ui.user.unEquip(I))
|
||||
return
|
||||
I.forceMove(src)
|
||||
inserted_id_uid = I.UID()
|
||||
|
||||
if("move_shuttle")
|
||||
if(!alone_in_area(get_area(src), ui.user))
|
||||
to_chat(ui.user, "<span class='warning'>Prisoners are only allowed to be released while alone.</span>")
|
||||
return TRUE
|
||||
|
||||
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE, ui.user))
|
||||
if(1)
|
||||
to_chat(ui.user, "<span class='notice'>Shuttle not found.</span>")
|
||||
if(2)
|
||||
to_chat(ui.user, "<span class='notice'>Shuttle already at station.</span>")
|
||||
if(3)
|
||||
to_chat(ui.user, "<span class='notice'>No permission to dock could be granted.</span>")
|
||||
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")
|
||||
sec_record_release(ui.user)
|
||||
to_chat(ui.user, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
|
||||
ui.user.create_log(MISC_LOG, "used [src] to call the laborcamp shuttle")
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/proc/sec_record_release(mob/living/carbon/human/target)
|
||||
var/target_name = target?.get_visible_name(TRUE)
|
||||
if(!target_name || target_name == "Unknown")
|
||||
return //Do you have the slightest idea how little that narrows it down?
|
||||
var/datum/data/record/R = find_record("name", target_name, GLOB.data_core.security)
|
||||
if(!(R?.fields["criminal"] in list(SEC_RECORD_STATUS_INCARCERATED)))
|
||||
return //stops cheese
|
||||
set_criminal_status(target, R, SEC_RECORD_STATUS_RELEASED, "Automatically released upon reaching labor points quota", "Labor Camp Controller", user_name = "Automated System")
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/proc/check_auth()
|
||||
if(emagged)
|
||||
return TRUE //Shuttle is emagged, let any ol' person through
|
||||
var/obj/item/card/id/prisoner/inserted_id = locateUID(inserted_id_uid)
|
||||
if(!inserted_id?.goal)
|
||||
return FALSE //ID not properly set up or not present, abort!
|
||||
return (inserted_id.mining_points >= inserted_id.goal) //Otherwise, only let them out if the prisoner's reached his quota.
|
||||
|
||||
/obj/machinery/mineral/labor_prisoner_shuttle_console/emag_act(mob/user)
|
||||
if(!emagged)
|
||||
emagged = TRUE
|
||||
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
|
||||
|
||||
/**********************Point Lookup Console**************************/
|
||||
/obj/machinery/mineral/labor_points_checker
|
||||
name = "points checking console"
|
||||
desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
user.examinate(src)
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/prisoner_id = I
|
||||
if(!prisoner_id.goal)
|
||||
to_chat(user, "<span class='warning'>Error: No point quota assigned by security, exiting.</span>")
|
||||
return
|
||||
to_chat(user, "<span class='notice'><b>ID: [prisoner_id.registered_name]</b></span>")
|
||||
to_chat(user, "<span class='notice'>Points Collected:[prisoner_id.mining_points]</span>")
|
||||
to_chat(user, "<span class='notice'>Point Quota: [prisoner_id.goal]</span>")
|
||||
to_chat(user, "<span class='notice'>Collect points by bringing ore to the labor camp ore redemption machine. Reach your quota to earn your release.</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/card/id))
|
||||
to_chat(user, "<span class='warning'>Error: Invalid ID</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
/**********************Prisoners' Console**************************/
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console
|
||||
name = "point claim console"
|
||||
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 = 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/obj/item/radio/intercom/announcer
|
||||
var/static/list/sheet_values
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/Initialize()
|
||||
. = ..()
|
||||
announcer = new /obj/item/radio/intercom(null)
|
||||
announcer.config(list("Security" = 0))
|
||||
|
||||
if(!sheet_values)
|
||||
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_values += list(list("ore" = initial(sheet.name), "value" = initial(sheet.point_value)))
|
||||
sheet_values = sortTim(sheet_values, /proc/cmp_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, "<span class='notice'>You insert [I].</span>")
|
||||
SStgui.update_uis(src)
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>There's an ID inserted already.</span>")
|
||||
return
|
||||
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/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "LaborClaimConsole", name, 315, 470, master_ui, 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
|
||||
data["id_inserted"] = inserted_id != null
|
||||
if(inserted_id)
|
||||
data["id_name"] = inserted_id.registered_name
|
||||
data["id_points"] = inserted_id.mining_points
|
||||
data["id_goal"] = inserted_id.goal
|
||||
if(check_auth())
|
||||
can_go_home = TRUE
|
||||
|
||||
if(stacking_machine)
|
||||
data["unclaimed_points"] = stacking_machine.points
|
||||
|
||||
data["ores"] = sheet_values
|
||||
data["can_go_home"] = can_go_home
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
switch(action)
|
||||
if("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("claim_points")
|
||||
if(!inserted_id)
|
||||
return
|
||||
inserted_id.mining_points += stacking_machine.points
|
||||
stacking_machine.points = 0
|
||||
to_chat(usr, "Points transferred.")
|
||||
if("move_shuttle")
|
||||
if(!alone_in_area(get_area(src), usr))
|
||||
to_chat(usr, "<span class='warning'>Prisoners are only allowed to be released while alone.</span>")
|
||||
else
|
||||
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE, usr))
|
||||
if(1)
|
||||
to_chat(usr, "<span class='notice'>Shuttle not found.</span>")
|
||||
if(2)
|
||||
to_chat(usr, "<span class='notice'>Shuttle already at station.</span>")
|
||||
if(3)
|
||||
to_chat(usr, "<span class='notice'>No permission to dock could be granted.</span>")
|
||||
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, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
|
||||
usr.create_log(MISC_LOG, "used [src] to call the laborcamp shuttle")
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/proc/check_auth()
|
||||
if(emagged)
|
||||
return TRUE //Shuttle is emagged, let any ol' person through
|
||||
return (istype(inserted_id) && inserted_id.mining_points >= inserted_id.goal) //Otherwise, only let them out if the prisoner's reached his quota.
|
||||
|
||||
/obj/machinery/mineral/labor_claim_console/emag_act(mob/user)
|
||||
if(!(emagged))
|
||||
emagged = TRUE
|
||||
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
|
||||
|
||||
|
||||
/**********************Prisoner Collection Unit**************************/
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker
|
||||
damage_deflection = 21
|
||||
var/points = 0 //The unclaimed value of ore stacked.
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/process_sheet(obj/item/stack/sheet/inp)
|
||||
points += inp.point_value * inp.amount
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/stacking_machine/laborstacker/attackby(obj/item/I, mob/living/user)
|
||||
if(istype(I, /obj/item/stack/sheet) && user.canUnEquip(I))
|
||||
var/obj/item/stack/sheet/inp = I
|
||||
points += inp.point_value * inp.amount
|
||||
return
|
||||
return ..()
|
||||
|
||||
/**********************Point Lookup Console**************************/
|
||||
/obj/machinery/mineral/labor_points_checker
|
||||
name = "points checking console"
|
||||
desc = "A console used by prisoners to check the progress on their quotas. Simply swipe a prisoner ID."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "console"
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attack_hand(mob/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
user.examinate(src)
|
||||
|
||||
/obj/machinery/mineral/labor_points_checker/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/card/id))
|
||||
if(istype(I, /obj/item/card/id/prisoner))
|
||||
var/obj/item/card/id/prisoner/prisoner_id = I
|
||||
to_chat(user, "<span class='notice'><B>ID: [prisoner_id.registered_name]</B></span>")
|
||||
to_chat(user, "<span class='notice'>Points Collected:[prisoner_id.mining_points]</span>")
|
||||
to_chat(user, "<span class='notice'>Point Quota: [prisoner_id.goal]</span>")
|
||||
to_chat(user, "<span class='notice'>Collect points by bringing smelted minerals to the Labor Shuttle stacking machine. Reach your quota to earn your release.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Error: Invalid ID</span>")
|
||||
return
|
||||
return ..()
|
||||
@@ -340,7 +340,8 @@
|
||||
EQUIPMENT("Cards", /obj/item/deck/cards, 150),
|
||||
EQUIPMENT("Guitar", /obj/item/instrument/guitar, 750),
|
||||
EQUIPMENT("Synthesizer", /obj/item/instrument/piano_synth, 1500),
|
||||
EQUIPMENT("Diamond Pickaxe", /obj/item/pickaxe/diamond, 2000)
|
||||
EQUIPMENT("Diamond Pickaxe", /obj/item/pickaxe/diamond, 2000),
|
||||
EQUIPMENT("Analyzer", /obj/item/analyzer, 50)
|
||||
)
|
||||
|
||||
/**********************Mining Equipment Datum**************************/
|
||||
|
||||
@@ -1828,7 +1828,6 @@
|
||||
#include "code\modules\mining\equipment\vendor_items.dm"
|
||||
#include "code\modules\mining\equipment\wormhole_jaunter.dm"
|
||||
#include "code\modules\mining\laborcamp\laborshuttle.dm"
|
||||
#include "code\modules\mining\laborcamp\laborstacker.dm"
|
||||
#include "code\modules\mining\lavaland\ash_flora.dm"
|
||||
#include "code\modules\mining\lavaland\necropolis_chests.dm"
|
||||
#include "code\modules\mining\lavaland\loot\ancient_loot.dm"
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { useBackend } from '../backend';
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
ProgressBar,
|
||||
LabeledList,
|
||||
Section,
|
||||
Table,
|
||||
} from '../components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const LaborClaimConsole = (props, context) => {
|
||||
return (
|
||||
<Window>
|
||||
<Window.Content>
|
||||
<ShuttleControlSection />
|
||||
<MaterialValuesSection />
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
|
||||
const ShuttleControlSection = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const {
|
||||
can_go_home,
|
||||
emagged,
|
||||
id_inserted,
|
||||
id_name,
|
||||
id_points,
|
||||
id_goal,
|
||||
unclaimed_points,
|
||||
} = data;
|
||||
const bad_progress = emagged ? 0 : 1;
|
||||
const completionStatus = emagged
|
||||
? 'ERR0R'
|
||||
: can_go_home
|
||||
? 'Completed!'
|
||||
: 'Insufficient';
|
||||
return (
|
||||
<Section>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Status">
|
||||
{(!!id_inserted && (
|
||||
<ProgressBar
|
||||
value={id_points / id_goal}
|
||||
ranges={{
|
||||
good: [bad_progress, Infinity],
|
||||
bad: [-Infinity, bad_progress],
|
||||
}}
|
||||
>
|
||||
{id_points + ' / ' + id_goal + ' ' + completionStatus}
|
||||
</ProgressBar>
|
||||
)) ||
|
||||
(!!emagged && 'ERR0R COMPLETED?!@') ||
|
||||
'No ID inserted'}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Shuttle controls">
|
||||
<Button
|
||||
fluid
|
||||
content="Move shuttle"
|
||||
disabled={!can_go_home}
|
||||
onClick={() => act('move_shuttle')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Unclaimed points">
|
||||
<Button
|
||||
fluid
|
||||
content={'Claim points (' + unclaimed_points + ')'}
|
||||
disabled={!id_inserted || !unclaimed_points}
|
||||
onClick={() => act('claim_points')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Inserted ID">
|
||||
<Button
|
||||
fluid
|
||||
content={id_inserted ? id_name : '-------------'}
|
||||
onClick={() => act('handle_id')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
|
||||
const MaterialValuesSection = (props, context) => {
|
||||
const { data } = useBackend(context);
|
||||
const { ores } = data;
|
||||
return (
|
||||
<Section title="Material values">
|
||||
<Table>
|
||||
<Table.Row header>
|
||||
<Table.Cell>Material</Table.Cell>
|
||||
<Table.Cell collapsing textAlign="right">
|
||||
Value
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
{ores.map((ore) => (
|
||||
<Table.Row key={ore.ore}>
|
||||
<Table.Cell>{toTitleCase(ore.ore)}</Table.Cell>
|
||||
<Table.Cell collapsing textAlign="right">
|
||||
<Box color="label" inline>
|
||||
{ore.value}
|
||||
</Box>
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
))}
|
||||
</Table>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -33,7 +33,7 @@ export const PrisonerImplantManager = (props, context) => {
|
||||
<ComplexModal />
|
||||
<Window.Content>
|
||||
<LoginInfo />
|
||||
<Section title="Prisoner Implant Manager System" height={10}>
|
||||
<Section title="Prisoner Points Manager System">
|
||||
<LabeledList>
|
||||
<LabeledListItem label="Prisoner">
|
||||
<Button
|
||||
@@ -46,23 +46,29 @@ export const PrisonerImplantManager = (props, context) => {
|
||||
</LabeledListItem>
|
||||
<LabeledListItem label="Points">
|
||||
{prisonerInfo.points !== null ? prisonerInfo.points : "-/-"}
|
||||
{prisonerInfo.goal !== null &&
|
||||
<Button ml={2}
|
||||
icon="minus-square"
|
||||
disable={!prisonerInfo.points}
|
||||
content="reset"
|
||||
onClick={() => act('reset_points')}
|
||||
/>
|
||||
}
|
||||
<Button ml={2}
|
||||
icon="minus-square"
|
||||
disabled={prisonerInfo.points === null}
|
||||
content="Reset"
|
||||
onClick={() => act('reset_points')}
|
||||
/>
|
||||
</LabeledListItem>
|
||||
<LabeledListItem label="Point Goal">
|
||||
<Button
|
||||
{prisonerInfo.goal !== null ? prisonerInfo.goal : "-/-"}
|
||||
<Button ml={2}
|
||||
icon="pen"
|
||||
disabled={prisonerInfo.goal === null}
|
||||
content={prisonerInfo.goal !== null ? prisonerInfo.goal : "-/-"}
|
||||
content="Edit"
|
||||
onClick={() => modalOpen(context, 'set_points')}
|
||||
/>
|
||||
|
||||
</LabeledListItem>
|
||||
<LabeledListItem>
|
||||
<box hidden={prisonerInfo.goal === null}>
|
||||
1 minute of prison time should roughly equate to 150 points.<br /><br />
|
||||
Sentences should not exceed 5000 points.<br /><br />
|
||||
Permanent prisoners should not be given a point goal.<br /><br />
|
||||
Prisoners who meet their point goal will be able to automatically access their locker and return to the station using the shuttle.
|
||||
</box>
|
||||
</LabeledListItem>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import { useBackend } from '../backend';
|
||||
import {
|
||||
Button,
|
||||
ProgressBar,
|
||||
LabeledList,
|
||||
Section,
|
||||
} from '../components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const PrisonerShuttleConsole = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const {
|
||||
can_go_home,
|
||||
emagged,
|
||||
id_inserted,
|
||||
id_name,
|
||||
id_points,
|
||||
id_goal,
|
||||
} = data;
|
||||
const bad_progress = emagged ? 0 : 1;
|
||||
let completionStatus = can_go_home ? 'Completed!' : 'Insufficient';
|
||||
if (emagged) {
|
||||
completionStatus = 'ERR0R'
|
||||
}
|
||||
let statusBlock = 'No ID inserted'
|
||||
if (id_inserted) {
|
||||
statusBlock = (
|
||||
<ProgressBar
|
||||
value={id_points / id_goal}
|
||||
ranges={{
|
||||
good: [bad_progress, Infinity],
|
||||
bad: [-Infinity, bad_progress],
|
||||
}}>
|
||||
{id_points + ' / ' + id_goal + ' ' + completionStatus}
|
||||
</ProgressBar>)
|
||||
}
|
||||
else if (emagged) {
|
||||
statusBlock = 'ERR0R COMPLETED?!@'
|
||||
}
|
||||
return (
|
||||
<Window>
|
||||
<Window.Content>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Status">
|
||||
{statusBlock}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Shuttle controls">
|
||||
<Button
|
||||
fluid
|
||||
content="Move shuttle"
|
||||
disabled={!can_go_home}
|
||||
onClick={() => act('move_shuttle')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Inserted ID">
|
||||
<Button
|
||||
fluid
|
||||
content={id_inserted ? id_name : '-------------'}
|
||||
onClick={() => act('handle_id')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user