fixes meteor event not removing the alert, and makes it announce a bit later

This commit is contained in:
Migratingcocofruit
2025-08-22 19:43:29 +03:00
parent 2f410443a2
commit 3acbf6470f
+14 -5
View File
@@ -9,6 +9,8 @@
var/next_meteor = 6
var/waves = 1
var/atom/movable/screen/alert/augury/meteor/screen_alert
/// The time at which we clear the storm. This is set during the event run so we initialize it to an unreachable value
var/clear_time = -1
/datum/event/meteor_wave/setup()
for(var/mob/dead/observer/O in GLOB.dead_mob_list)
@@ -27,18 +29,25 @@
//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", /atom/movable/screen/alert/augury/meteor)
if(screen_alert)
for(var/mob/dead/observer/O in GLOB.dead_mob_list)
O.throw_alert("\ref[src]_augury", /atom/movable/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
waves--
if(!waves && noAutoEnd) // We set the end timer when we clear the storm so we can just check that so we don't keep announcing
// When the storm is done we set a timer for the event end instead of finishing it.
// This is so it still incurs a cost for the event system for a while.
if(!waves && noAutoEnd)
// Set a 15 cycle(30 second) timer before we announce clearing the storm.
// This is to give the last meteor enough time to finish moving
clear_time = activeFor + 15
endWhen = activeFor + 700
noAutoEnd = FALSE
if(activeFor == clear_time)
announce_clear()
/datum/event/meteor_wave/proc/announce_clear()
endWhen = activeFor + 900
noAutoEnd = FALSE
for(var/mob/M in GLOB.dead_mob_list)
M.clear_alert("\ref[src]_augury")
QDEL_NULL(screen_alert)