Files
Bubberstation/code/modules/events/electrical_storm.dm
SkyratBot ec09510459 Bools and returns super-pr (#53221) (#565)
Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns
Edit: Most left out ones are in mecha which should be done in mecha refactor already
Oh my look how clean it is

Co-authored-by: TiviPlus <TiviPlus>
Co-authored-by: Couls <coul422@gmail.com>

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Couls <coul422@gmail.com>
2020-08-30 05:12:59 +02:00

34 lines
905 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")
/datum/round_event/electrical_storm/start()
var/list/epicentreList = list()
for(var/i=1, i <= lightsoutAmount, i++)
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()