Files
Bubberstation/code/modules/events/gravity_generator_blackout.dm
SkyratBot 0a03e8a2a7 [MIRROR] Machine list is now stored in SSmachines | Remove excessive use of global lists for specific machine types [MDB IGNORE] (#22481)
* Machine list is now stored in SSmachines | Remove excessive use of global lists for specific machine types

* Resolve merge conflicts

* Modular adjustments

* destroy this double return on destroy

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: Giz <vinylspiders@gmail.com>
2023-07-15 22:51:23 -04:00

35 lines
1.3 KiB
Plaintext

/datum/round_event_control/gravity_generator_blackout
name = "Gravity Generator Blackout"
typepath = /datum/round_event/gravity_generator_blackout
weight = 30
category = EVENT_CATEGORY_ENGINEERING
description = "Turns off the gravity generator."
min_wizard_trigger_potency = 0
max_wizard_trigger_potency = 4
/datum/round_event_control/gravity_generator_blackout/can_spawn_event(players_amt, allow_magic = FALSE)
. = ..()
if(!.)
return .
var/station_generator_exists = FALSE
for(var/obj/machinery/gravity_generator/main/the_generator as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/gravity_generator/main))
if(is_station_level(the_generator.z))
station_generator_exists = TRUE
if(!station_generator_exists)
return FALSE
/datum/round_event/gravity_generator_blackout
announce_when = 1
start_when = 1
announce_chance = 33
/datum/round_event/gravity_generator_blackout/announce(fake)
priority_announce("Gravnospheric anomalies detected near [station_name()]. Manual reset of generators is required.", "Anomaly Alert", ANNOUNCER_GRANOMALIES)
/datum/round_event/gravity_generator_blackout/start()
for(var/obj/machinery/gravity_generator/main/the_generator as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/gravity_generator/main))
if(is_station_level(the_generator.z))
the_generator.blackout()