mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
29 lines
917 B
Plaintext
29 lines
917 B
Plaintext
/datum/event/electrical_storm
|
|
var/lightsoutAmount = 1
|
|
var/lightsoutRange = 25
|
|
|
|
|
|
/datum/event/electrical_storm/announce()
|
|
command_announcement.Announce("An electrical issue has been detected in your area, please repair potential electronic overloads.", "Electrical Alert")
|
|
|
|
|
|
/datum/event/electrical_storm/start()
|
|
var/list/epicentreList = list()
|
|
|
|
for(var/i=1, i <= lightsoutAmount, i++)
|
|
var/list/possibleEpicentres = list()
|
|
for(var/obj/effect/landmark/newEpicentre in landmarks_list)
|
|
if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList))
|
|
possibleEpicentres += newEpicentre
|
|
if(possibleEpicentres.len)
|
|
epicentreList += pick(possibleEpicentres)
|
|
else
|
|
break
|
|
|
|
if(!epicentreList.len)
|
|
return
|
|
|
|
for(var/obj/effect/landmark/epicentre in epicentreList)
|
|
for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange))
|
|
apc.overload_lighting()
|