Files
VOREStation/code/modules/gamemaster/event2/events/everyone/gravity.dm
T
Ryumi 94deb1ab18 Fixes gravity surge event affecting capsule shelters on maps without gravity generators (#18742)
* Fixes survival pods being affected by gravity events in some cases

* applies to admeme event as well!

* perhaps this is better logic actually

* Wait, it's probably a lot better to do this with flags...

* Whoops, thought I saved this change!
2025-11-11 21:45:05 +01:00

35 lines
1.2 KiB
Plaintext

/datum/event2/meta/gravity
name = "gravity failure"
departments = list(DEPARTMENT_EVERYONE)
chaos = 20
chaotic_threshold = EVENT_CHAOS_THRESHOLD_LOW_IMPACT
reusable = TRUE
event_type = /datum/event2/event/gravity
/datum/event2/meta/gravity/get_weight()
return (20 + (GLOB.metric.count_people_in_department(DEPARTMENT_EVERYONE) * 5)) / (times_ran + 1)
/datum/event2/event/gravity
length_lower_bound = 4 MINUTES
length_upper_bound = 8 MINUTES
/datum/event2/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/event2/event/gravity/start()
for(var/area/A in world)
if(!(A.flags & AREA_ALWAYS_HAS_GRAVITY) && A.z in get_location_z_levels(space_only = TRUE))
A.gravitychange(FALSE)
/datum/event2/event/gravity/end()
for(var/area/A in world)
if(!(A.flags & AREA_ALWAYS_HAS_GRAVITY) && A.z in get_location_z_levels(space_only = TRUE))
A.gravitychange(TRUE)
command_announcement.Announce("Gravity generators are again functioning within normal parameters. Sorry for any inconvenience.", "Gravity Restored")