mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 07:38:05 +01:00
Tramstation Perma Genpop (#62966)
This commit is contained in:
+11465
-11047
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,82 @@
|
||||
#define SPAM_CD 3 SECONDS
|
||||
|
||||
/obj/machinery/prisongate
|
||||
name = "prison gate scanner"
|
||||
desc = "A hardlight gate with an ID scanner attached to the side. Good at deterring even the most persistent temporarily embarrassed employee."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "prisongate_on"
|
||||
/// roughly the same health/armor as an airlock
|
||||
max_integrity = 450
|
||||
armor = list(MELEE = 30, BULLET = 30, LASER = 20, ENERGY = 20, BOMB = 10, BIO = 100, FIRE = 80, ACID = 70)
|
||||
use_power = IDLE_POWER_USE
|
||||
power_channel = AREA_USAGE_EQUIP
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 30
|
||||
anchored = TRUE
|
||||
/// dictates whether the gate barrier is up or not
|
||||
var/gate_active = TRUE
|
||||
COOLDOWN_DECLARE(spam_cooldown_time)
|
||||
|
||||
/obj/machinery/prisongate/power_change()
|
||||
. = ..()
|
||||
if(!powered())
|
||||
visible_message(span_notice("[src] momentarily flickers before the hardlight barrier loses cohesion and dissipates into thin air!"))
|
||||
gate_active = FALSE
|
||||
flick("prisongate_turningoff", src)
|
||||
icon_state = "prisongate_off"
|
||||
else
|
||||
gate_active = TRUE
|
||||
visible_message(span_notice("[src] whirrs back to life as its hardlight barrier fills the space between it."))
|
||||
flick("prisongate_turningon", src)
|
||||
icon_state = "prisongate_on"
|
||||
|
||||
/obj/machinery/prisongate/CanAllowThrough(atom/movable/gate_toucher, border_dir)
|
||||
. = ..()
|
||||
if(!iscarbon(gate_toucher))
|
||||
if(!isstructure(gate_toucher))
|
||||
return TRUE
|
||||
var/obj/structure/cargobay = gate_toucher
|
||||
for(var/mob/living/stowaway in cargobay.contents) //nice try bub
|
||||
if(COOLDOWN_FINISHED(src, spam_cooldown_time))
|
||||
say("Stowaway detected in internal contents. Access denied.")
|
||||
playsound(src, 'sound/machines/buzz-two.ogg', 50, FALSE)
|
||||
COOLDOWN_START(src, spam_cooldown_time, SPAM_CD)
|
||||
return FALSE
|
||||
return TRUE
|
||||
var/mob/living/carbon/the_toucher = gate_toucher
|
||||
if(gate_active == FALSE)
|
||||
return TRUE
|
||||
for(var/obj/item/card/id/regular_id in the_toucher.get_all_contents())
|
||||
var/list/id_access = regular_id.GetAccess()
|
||||
if(ACCESS_BRIG in id_access)
|
||||
if(COOLDOWN_FINISHED(src, spam_cooldown_time))
|
||||
say("Brig clearance detected. Access granted.")
|
||||
playsound(src, 'sound/machines/chime.ogg', 50, FALSE)
|
||||
COOLDOWN_START(src, spam_cooldown_time, SPAM_CD)
|
||||
return TRUE
|
||||
for(var/obj/item/card/id/advanced/prisoner/prison_id in the_toucher.get_all_contents())
|
||||
if(!prison_id.timed)
|
||||
continue
|
||||
if(prison_id.time_to_assign)
|
||||
say("Prison ID with active sentence detected. Please enjoy your stay in our corporate rehabilitation center, [prison_id.registered_name]!")
|
||||
playsound(src, 'sound/machines/chime.ogg', 50, FALSE)
|
||||
prison_id.time_left = prison_id.time_to_assign
|
||||
prison_id.time_to_assign = initial(prison_id.time_to_assign)
|
||||
prison_id.start_timer()
|
||||
return TRUE
|
||||
if(prison_id.time_left <= 0)
|
||||
say("Prison ID with served sentence detected. Access granted.")
|
||||
prison_id.timed = FALSE //disables the id check from earlier so you can't just throw it back into perma for mass escapes
|
||||
playsound(src, 'sound/machines/chime.ogg', 50, FALSE)
|
||||
return TRUE
|
||||
if(COOLDOWN_FINISHED(src, spam_cooldown_time))
|
||||
say("Prison ID with ongoing sentence detected. Access denied.")
|
||||
playsound(src, 'sound/machines/buzz-two.ogg', 50, FALSE)
|
||||
COOLDOWN_START(src, spam_cooldown_time, SPAM_CD)
|
||||
return FALSE
|
||||
if(COOLDOWN_FINISHED(src, spam_cooldown_time))
|
||||
to_chat(the_toucher, span_warning("You try to push through the hardlight barrier with little effect."))
|
||||
COOLDOWN_START(src, spam_cooldown_time, SPAM_CD)
|
||||
return FALSE
|
||||
|
||||
#undef SPAM_CD
|
||||
@@ -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."))
|
||||
|
||||
@@ -180,6 +180,31 @@
|
||||
anchored = TRUE
|
||||
var/id = null
|
||||
|
||||
/obj/structure/closet/secure_closet/brig/genpop
|
||||
name = "genpop storage locker"
|
||||
desc = "Used for storing the belongings of genpop's tourists visiting the locals."
|
||||
/// reference to the ID linked to the locker, done by swiping a prisoner ID on it
|
||||
var/datum/weakref/assigned_id = null
|
||||
|
||||
/obj/structure/closet/secure_closet/brig/genpop/attackby(obj/item/card/id/advanced/prisoner/C, mob/user)
|
||||
..()
|
||||
if(!assigned_id && istype(C, /obj/item/card/id/advanced/prisoner))
|
||||
assigned_id = WEAKREF(C)
|
||||
name = "genpop storage locker - [C.registered_name]"
|
||||
say("Prisoner ID linked to locker.")
|
||||
return
|
||||
if(C == assigned_id)
|
||||
locked = FALSE
|
||||
assigned_id = initial(assigned_id)
|
||||
name = initial(name)
|
||||
say("Linked prisoner ID detected. Unlocking locker and resetting ID.")
|
||||
update_appearance()
|
||||
|
||||
/obj/structure/closet/secure_closet/brig/genpop/examine(mob/user)
|
||||
. = ..()
|
||||
if(assigned_id)
|
||||
. += span_notice("The digital display on the locker shows it is currently owned by [assigned_id].")
|
||||
|
||||
/obj/structure/closet/secure_closet/evidence
|
||||
anchored = TRUE
|
||||
name = "Secure Evidence Closet"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 107 KiB |
@@ -1128,6 +1128,7 @@
|
||||
#include "code\game\machinery\navbeacon.dm"
|
||||
#include "code\game\machinery\newscaster.dm"
|
||||
#include "code\game\machinery\PDApainter.dm"
|
||||
#include "code\game\machinery\prisongate.dm"
|
||||
#include "code\game\machinery\prisonlabor.dm"
|
||||
#include "code\game\machinery\quantum_pad.dm"
|
||||
#include "code\game\machinery\recharger.dm"
|
||||
|
||||
Reference in New Issue
Block a user