From 3acbf6470fda25377b0c466f3af5613629be54d2 Mon Sep 17 00:00:00 2001 From: Migratingcocofruit Date: Fri, 22 Aug 2025 19:43:29 +0300 Subject: [PATCH] fixes meteor event not removing the alert, and makes it announce a bit later --- code/modules/events/meteors_event.dm | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/code/modules/events/meteors_event.dm b/code/modules/events/meteors_event.dm index 825b41952d0..f30b8a96ade 100644 --- a/code/modules/events/meteors_event.dm +++ b/code/modules/events/meteors_event.dm @@ -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)