mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-23 08:31:57 +00:00
* Initial * Cleared duplicates * More work, get rid of log_error * more * log_debug() to macro LOG_DEBUG * More work * More * Guh * Maybe better? * More work * gah * Dear lord * *inserts swears here* * gdi * More work * More * dear lord * fsdfsdafs * rsdaf * sadfasf * sdafsad * fgsd * small fuckup fix * jfsd * sdafasf * gdi * sdfa * sfdafgds * sdafasdvf * sdfasdfg * sdfsga * asdf * dsfasfsagf * ihibhbjh * fsadf * adfas * sdafsad * sdfasd * fsda * vhb * asf * for arrow * removed source file-line logging, added header for tgui
75 lines
1.5 KiB
Plaintext
75 lines
1.5 KiB
Plaintext
/var/datum/controller/subsystem/mob_ai/SSmob_ai
|
|
|
|
/datum/controller/subsystem/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/New()
|
|
NEW_SS_GLOBAL(SSmob_ai)
|
|
|
|
/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()
|