Files
Bubberstation/code/modules/events/electrical_storm.dm
SkyratBot 98428cdfb5 [MIRROR] Replaces a portion of C-style for loops with the more commonplace for loops, which are faster. [MDB IGNORE] (#9298)
* Replaces a portion of C-style for loops with the more commonplace for loops, which are faster.

* Update code/modules/projectiles/boxes_magazines/_box_magazine.dm

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
2021-11-08 10:50:29 -05:00

34 lines
948 B
Plaintext

/datum/round_event_control/electrical_storm
name = "Electrical Storm"
typepath = /datum/round_event/electrical_storm
earliest_start = 10 MINUTES
min_players = 5
weight = 20
alert_observers = FALSE
/datum/round_event/electrical_storm
var/lightsoutAmount = 1
var/lightsoutRange = 25
announceWhen = 1
/datum/round_event/electrical_storm/announce(fake)
priority_announce("An electrical storm has been detected in your area, please repair potential electronic overloads.", "Electrical Storm Alert", ANNOUNCER_ELECTRICALSTORM) //SKYRAT EDIT CHANGE
/datum/round_event/electrical_storm/start()
var/list/epicentreList = list()
for(var/i in 1 to lightsoutAmount)
var/turf/T = find_safe_turf()
if(istype(T))
epicentreList += T
if(!epicentreList.len)
return
for(var/centre in epicentreList)
for(var/a in GLOB.apcs_list)
var/obj/machinery/power/apc/A = a
if(get_dist(centre, A) <= lightsoutRange)
A.overload_lighting()