Files
Aurora.3/code/modules/weather/weather_mob_tracking.dm
Matt Atlas 57067892d8 Ports the weather system from Nebula. (#18706)
* part 1

* compiles?

* IT WORKS

* vis contents

* fixes

* umbrelloid

* umbrella 2

* dsasdd

* stuff

* lmao

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
2024-03-24 14:05:00 +00:00

24 lines
1.0 KiB
Plaintext

GLOBAL_LIST_EMPTY(current_mob_ambience)
/obj/abstract/weather_system
// Weakref lists used to track mobs within our weather
// system; alternative to keeping big lists of actual mobs or
// having mobs constantly poked by weather systems.
var/tmp/list/mobs_on_cooldown = list() // Has this mob recently been messed with by the weather?
var/tmp/list/mob_shown_weather = list() // Has this mob been sent the summary message about the current weather?
var/tmp/list/mob_shown_wind = list() // Has this mob been sent the summary message about the current wind?
// 'cooldown' in this context refers to weather effects like hail damage or being shown cosmetic messages.
/obj/abstract/weather_system/proc/set_cooldown(var/mob/living/M, var/delay = 5 SECONDS)
var/mobref = WEAKREF(M)
if(!(mobref in mobs_on_cooldown))
mobs_on_cooldown[mobref] = TRUE
addtimer(CALLBACK(src, PROC_REF(clear_cooldown), mobref), delay)
return TRUE
return FALSE
/obj/abstract/weather_system/proc/clear_cooldown(var/mobref)
mobs_on_cooldown -= mobref