Adds ability to auto-follow debris for meteor events (#20917)

* general outline

* Works pretty well at this point?

* Fixes up some other smaller things

* Improve documentation

* Removes some unused code

* Removes a stray comment too

* minor reorganization

* thanks gdn

* qdel null

* Remove unused proc

* Remove some other unused functionality

* sirryan review

* merges
This commit is contained in:
Luc
2023-06-03 15:51:06 -07:00
committed by GitHub
parent ceae5cc15d
commit ad6a481cd6
3 changed files with 171 additions and 0 deletions
+12
View File
@@ -3,8 +3,14 @@
endWhen = 7
var/next_meteor = 6
var/waves = 1
var/obj/screen/alert/augury/meteor/screen_alert
/datum/event/meteor_wave/setup()
for(var/mob/dead/observer/O in GLOB.dead_mob_list)
var/obj/screen/alert/augury/meteor/A = O.throw_alert("\ref[src]_augury", /obj/screen/alert/augury/meteor)
if(A)
screen_alert = A
waves = severity * rand(1,3)
/datum/event/meteor_wave/announce()
@@ -16,6 +22,9 @@
//meteor showers are lighter and more common,
/datum/event/meteor_wave/tick()
// keep observers updated with the alert
for(var/mob/dead/observer/O in GLOB.dead_mob_list)
O.throw_alert("\ref[src]_augury", /obj/screen/alert/augury/meteor)
if(waves && activeFor >= next_meteor)
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(spawn_meteors), get_meteor_count(), get_meteors())
next_meteor += rand(15, 30) / severity
@@ -23,6 +32,9 @@
endWhen = (waves ? next_meteor + 1 : activeFor + 15)
/datum/event/meteor_wave/end()
for(var/mob/M in GLOB.dead_mob_list)
M.clear_alert("\ref[src]_augury")
QDEL_NULL(screen_alert)
switch(severity)
if(EVENT_LEVEL_MAJOR)
GLOB.minor_announcement.Announce("The station has cleared the meteor storm.", "Meteor Alert")