Merge pull request #9077 from Sishen1542/id-boingo

No ID insertion for everything except the hop console
This commit is contained in:
kevinz000
2019-09-10 22:04:48 -07:00
committed by GitHub
25 changed files with 728 additions and 615 deletions

View File

@@ -10,12 +10,10 @@ GLOBAL_LIST(labor_sheet_values)
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/Radio //needed to send messages to sec radio
/obj/machinery/mineral/labor_claim_console/Initialize()
. = ..()
Radio = new/obj/item/radio(src)
@@ -34,18 +32,6 @@ GLOBAL_LIST(labor_sheet_values)
/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.transferItemToLoc(I, src))
return
inserted_id = I
to_chat(user, "<span class='notice'>You insert [I].</span>")
return
else
to_chat(user, "<span class='notice'>There's an ID inserted already.</span>")
return ..()
/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)
@@ -58,14 +44,20 @@ GLOBAL_LIST(labor_sheet_values)
var/can_go_home = FALSE
data["emagged"] = (obj_flags & EMAGGED) ? 1 : 0
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())
if(obj_flags & EMAGGED)
can_go_home = TRUE
data["status_info"] = "No Prisoner ID detected."
var/obj/item/card/id/I = user.get_idcard(TRUE)
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/P = I
data["id_points"] = P.points
if(P.points >= P.goal)
can_go_home = TRUE
data["status_info"] = "Goal met!"
else
data["status_info"] = "You are [(P.goal - P.points)] points away."
if(stacking_machine)
data["unclaimed_points"] = stacking_machine.points
@@ -78,29 +70,19 @@ GLOBAL_LIST(labor_sheet_values)
if(..())
return
switch(action)
if("handle_id")
if(inserted_id)
if(!usr.get_active_held_item())
usr.put_in_hands(inserted_id)
inserted_id = null
else
inserted_id.forceMove(get_turf(src))
inserted_id = null
else
var/obj/item/I = usr.get_active_held_item()
if(istype(I, /obj/item/card/id/prisoner))
if(!usr.transferItemToLoc(I, src))
return
inserted_id = I
if("claim_points")
inserted_id.points += stacking_machine.points
stacking_machine.points = 0
to_chat(usr, "Points transferred.")
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
if(istype(I, /obj/item/card/id/prisoner))
var/obj/item/card/id/prisoner/P = I
P.points += stacking_machine.points
stacking_machine.points = 0
to_chat(usr, "<span class='notice'>Points transferred.</span>")
else
to_chat(usr, "<span class='notice'>No valid id for point transfer detected.</span>")
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 if(!check_auth())
to_chat(usr, "<span class='warning'>Prisoners are only allowed to be released when they reach their point goal.</span>")
else
switch(SSshuttle.moveShuttle("laborcamp", "laborcamp_home", TRUE))
if(1)
@@ -112,14 +94,9 @@ GLOBAL_LIST(labor_sheet_values)
else
if(!(obj_flags & EMAGGED))
Radio.set_frequency(FREQ_SECURITY)
Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
Radio.talk_into(src, "A prisoner has returned to the station. Minerals and Prisoner ID card ready for retrieval.", FREQ_SECURITY)
to_chat(usr, "<span class='notice'>Shuttle received message and will be sent shortly.</span>")
/obj/machinery/mineral/labor_claim_console/proc/check_auth()
if(obj_flags & EMAGGED)
return 1 //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)
@@ -135,10 +112,8 @@ GLOBAL_LIST(labor_sheet_values)
to_chat(user, "<span class='warning'>PZZTTPFFFT</span>")
return TRUE
/**********************Prisoner Collection Unit**************************/
/obj/machinery/mineral/stacking_machine/laborstacker
force_connect = TRUE
var/points = 0 //The unclaimed value of ore stacked.
@@ -154,6 +129,7 @@ GLOBAL_LIST(labor_sheet_values)
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."