Files
Bubberstation/code/modules/events/prison_break.dm
carnie 6a98fc89d0 >datum/event and datum/event_control were renamed to datum/round_event and datum/round_event_control. This is because datum/event was already used by a different/more-general event queue system (used primarily on mechas)
Removed overriding of event values via feeding in an associative list into datum/round_event/New(). Instead you can do basic initializations (i.e. feed it constants) by doing new /datum/round_event{variablename=5;}(). This method is handled well by the compiler (it's the same method the maps use), so it will detect unrecognized variablenames etc.
More complex initializations for post setup() stuff can be done by accessing variables directly Event.variablename = whatever;
round_events now have a processing variable, which effectively pauses them.
2013-04-08 07:42:46 +01:00

52 lines
1.7 KiB
Plaintext

/datum/round_event_control/prison_break
name = "Prison Break"
typepath = /datum/round_event/prison_break
max_occurrences = 2
/datum/round_event/prison_break
announceWhen = 50
endWhen = 20
var/list/area/prisonAreas = list()
/datum/round_event/prison_break/setup()
announceWhen = rand(50, 60)
endWhen = rand(20, 30)
for(var/area/security/A in world)
if(istype(A, /area/security/prison) || istype(A, /area/security/brig))
prisonAreas += A
/datum/round_event/prison_break/announce()
if(prisonAreas && prisonAreas.len > 0)
command_alert("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
else
world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area."
kill()
/datum/round_event/prison_break/start()
for(var/area/A in prisonAreas)
for(var/obj/machinery/light/L in A)
L.flicker(10)
/datum/round_event/prison_break/end()
for(var/area/A in prisonAreas)
for(var/obj/O in A)
if(istype(O,/obj/machinery/power/apc))
var/obj/machinery/power/apc/temp = O
temp.overload_lighting()
else if(istype(O,/obj/structure/closet/secure_closet/brig))
var/obj/structure/closet/secure_closet/brig/temp = O
temp.locked = 0
temp.icon_state = temp.icon_closed
else if(istype(O,/obj/machinery/door/airlock/security))
var/obj/machinery/door/airlock/security/temp = O
temp.prison_open()
else if(istype(O,/obj/machinery/door/airlock/glass_security))
var/obj/machinery/door/airlock/glass_security/temp = O
temp.prison_open()
else if(istype(O,/obj/machinery/door_timer))
var/obj/machinery/door_timer/temp = O
temp.releasetime = 1