mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
/datum/event/gravity
|
|
announceWhen = 5
|
|
var/list/zLevels
|
|
|
|
/datum/event/gravity/setup()
|
|
endWhen = rand(15, 60)
|
|
// Setup which levels we will disrupt gravit on.
|
|
zLevels = using_map.station_levels.Copy()
|
|
for(var/datum/planet/P in SSplanets.planets)
|
|
zLevels -= P.expected_z_levels
|
|
|
|
/datum/event/gravity/announce()
|
|
command_announcement.Announce("Feedback surge detected in mass-distributions systems. Artificial gravity has been disabled whilst the system \
|
|
reinitializes. Please stand by while the gravity system reinitializes.", "Gravity Failure")
|
|
|
|
/datum/event/gravity/start()
|
|
gravity_is_on = 0
|
|
for(var/area/A in all_areas)
|
|
if(A.z in zLevels)
|
|
A.gravitychange(gravity_is_on, A)
|
|
|
|
/datum/event/gravity/end()
|
|
if(!gravity_is_on)
|
|
gravity_is_on = 1
|
|
|
|
for(var/area/A in all_areas)
|
|
if(A.z in zLevels)
|
|
A.gravitychange(gravity_is_on, A)
|
|
|
|
command_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.", "Gravity Restored")
|