Tramstation Perma Genpop (#62966)

This commit is contained in:
MMMiracles
2021-11-27 10:38:54 -07:00
committed by GitHub
parent 46d0a17e7a
commit 6f2382d722
6 changed files with 11616 additions and 11047 deletions
+43
View File
@@ -965,6 +965,49 @@
var/goal = 0
/// Number of gulag points earned.
var/points = 0
/// If the card has a timer set on it for temporary stay.
var/timed = FALSE
/// Time to assign to the card when they pass through the security gate.
var/time_to_assign
/// Time left on a card till they can leave.
var/time_left = 0
/obj/item/card/id/advanced/prisoner/attackby(obj/item/card/id/C, mob/user)
..()
var/list/id_access = C.GetAccess()
if(ACCESS_BRIG in id_access)
if(timed)
timed = FALSE
time_to_assign = initial(time_to_assign)
registered_name = initial(registered_name)
STOP_PROCESSING(SSobj, src)
to_chat(user, "Restating prisoner ID to default parameters.")
return
time_to_assign = input(user,"Set sentence time in seconds.","Set sentence time in seconds.",0) as num|null
if(isnull(time_to_assign) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
to_chat(user, "You set the sentence time to [time_to_assign] seconds.")
timed = TRUE
/obj/item/card/id/advanced/prisoner/proc/start_timer()
say("Sentence started, welcome to the corporate rehabilitation center!")
START_PROCESSING(SSobj, src)
/obj/item/card/id/advanced/prisoner/examine(mob/user)
. = ..()
if(timed)
if(time_left <= 0)
. += span_notice("The digital timer on the card has zero seconds remaining. You leave a changed man, but a free man nonetheless.")
else
. += span_notice("The digital timer on the card has [time_left] seconds remaining. Don't do the crime if you can't do the time.")
/obj/item/card/id/advanced/prisoner/process(delta_time)
if(!timed)
return
time_left -= delta_time
if(time_left <= 0)
say("Sentence time has been served. Thank you for your cooperation in our corporate rehabilitation program!")
STOP_PROCESSING(SSobj, src)
/obj/item/card/id/advanced/prisoner/attack_self(mob/user)
to_chat(usr, span_notice("You have accumulated [points] out of the [goal] points you need for freedom."))