Files
Aurora.3/code/controllers/subsystems/mob_ai.dm
Matt Atlas baeb7c6afd Updates subsystem definitions to new standards. (#17470)
* My heart is dragging me down into...

...oblivion!

* drifting closer to the edge but she won't have me

* ever round me we are dead before we meet her

* for the last time

* wake up in sweat

* n

* fff

* uff

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
2023-10-01 14:24:40 +00:00

70 lines
1.4 KiB
Plaintext

SUBSYSTEM_DEF(mob_ai)
name = "Mobs - AI"
flags = SS_NO_INIT
priority = SS_PRIORITY_MOB
runlevels = RUNLEVELS_PLAYING
var/list/processing = list()
var/list/currentrun = list()
var/list/slept = list()
/datum/controller/subsystem/mob_ai/stat_entry(msg)
msg = "P:[processing.len]"
return ..()
/datum/controller/subsystem/mob_ai/fire(resumed = FALSE)
if (!resumed)
src.currentrun = processing.Copy()
var/list/currentrun = src.currentrun
while (currentrun.len)
var/mob/M = currentrun[currentrun.len]
currentrun.len--
if (QDELETED(M))
processing -= M
if (MC_TICK_CHECK)
return
continue
if (M.ckey)
// cliented mobs are not allowed to think
LOG_DEBUG("SSmob_ai: Type '[M.type]' was still thinking despite having a client!")
MOB_STOP_THINKING(M)
if (MC_TICK_CHECK)
return
continue
var/time = world.time
if (!M.frozen && !M.stat)
M.think()
if (time != world.time && !slept[M.type])
slept[M.type] = TRUE
var/diff = world.time - time
LOG_DEBUG("SSmob_ai: Type '[M.type]' slept for [diff] ds in think()! Suppressing further warnings.")
if (MC_TICK_CHECK)
return
/mob
var/tmp/thinking_enabled = FALSE
/mob/proc/think()
return
/mob/proc/on_think_disabled()
walk_to(src, 0)
/mob/proc/on_think_enabled()
return
/datum/controller/subsystem/mob_ai/ExplosionStart()
suspend()
/datum/controller/subsystem/mob_ai/ExplosionEnd()
wake()