Files
S.P.L.U.R.T-Station-13/code/modules/events/prison_break.dm
deathride58 2f9e3e403d Hard upstream sync (#6951)
* maps - none of our changes included yet i'll get them in after i finish up the rest of the sync

* sync part 1 - underscore folders in code

* controllers folder

* datums folder

* game folder

* cmon, work

* modules - admin to awaymissions

* cargo to events

* fields to lighting

* mapping > ruins

* rest of the code folder

* rest of the folders in the root directory

* DME

* fixes compiling errors. it compiles so it works

* readds map changes

* fixes dogborg module select

* fixes typo in moduleselect_alternate_icon filepath
2018-05-31 16:03:18 -07:00

70 lines
2.5 KiB
Plaintext

/datum/round_event_control/grey_tide
name = "Grey Tide"
typepath = /datum/round_event/grey_tide
max_occurrences = 2
min_players = 5
/datum/round_event/grey_tide
announceWhen = 50
endWhen = 20
var/list/area/areasToOpen = list()
var/list/potential_areas = list(/area/bridge,
/area/engine,
/area/medical,
/area/security,
/area/quartermaster,
/area/science)
var/severity = 1
/datum/round_event/grey_tide/setup()
announceWhen = rand(50, 60)
endWhen = rand(20, 30)
severity = rand(1,3)
for(var/i in 1 to severity)
var/picked_area = pick_n_take(potential_areas)
for(var/area/A in world)
if(istype(A, picked_area))
areasToOpen += A
/datum/round_event/grey_tide/announce(fake)
if(areasToOpen && areasToOpen.len > 0)
if(prob(50))
priority_announce("Gr3y.T1d3 virus detected in [station_name()] door subroutines. Severity level of [severity]. Recommend station AI involvement.", "Security Alert")
else
priority_announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/ai/commandreport.ogg') // CITADEL EDIT metabreak
for(var/obj/machinery/computer/communications/C in GLOB.machines)
if(!(C.stat & (BROKEN|NOPOWER)) && is_station_level(C.z))
var/obj/item/paper/P = new(C.loc)
P.name = "Gr3y.T1d3 virus"
P.info = "Gr3y.T1d3 virus detected in [station_name()] door subroutines. Severity level of [severity]. Recommend station AI involvement."
P.update_icon()
else
log_world("ERROR: Could not initate grey-tide. No areas in the list!")
kill()
/datum/round_event/grey_tide/start()
for(var/area/A in areasToOpen)
for(var/obj/machinery/light/L in A)
L.flicker(10)
/datum/round_event/grey_tide/end()
for(var/area/A in areasToOpen)
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))
var/obj/structure/closet/secure_closet/temp = O
temp.locked = FALSE
temp.update_icon()
else if(istype(O, /obj/machinery/door/airlock))
var/obj/machinery/door/airlock/temp = O
if(temp.critical_machine) //Skip doors in critical positions, such as the SM chamber.
continue
temp.prison_open()
else if(istype(O, /obj/machinery/door_timer))
var/obj/machinery/door_timer/temp = O
temp.timer_end(forced = TRUE)