mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-31 20:11:56 +00:00
* Initial commit * Time is a circus * Send in the clowns * i broke something * Revert "i broke something" This reverts commit 5a29c40d131b39effe9ebcb6c8c1883693baf07f. * I think it works? * cleanup * define reminders * Fixes tendrils and such * sentience_act now moves the mob to AI_OFF state
35 lines
866 B
Plaintext
35 lines
866 B
Plaintext
SUBSYSTEM_DEF(idlenpcpool)
|
|
name = "Idling NPC Pool"
|
|
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
|
priority = 10
|
|
wait = 60
|
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
|
|
|
var/list/currentrun = list()
|
|
|
|
/datum/controller/subsystem/idlenpcpool/stat_entry()
|
|
var/list/idlelist = GLOB.simple_animals[AI_IDLE]
|
|
..("IdleNPCS:[idlelist.len]")
|
|
|
|
/datum/controller/subsystem/idlenpcpool/fire(resumed = FALSE)
|
|
|
|
if (!resumed)
|
|
var/list/idlelist = GLOB.simple_animals[AI_IDLE]
|
|
src.currentrun = idlelist.Copy()
|
|
|
|
//cache for sanic speed (lists are references anyways)
|
|
var/list/currentrun = src.currentrun
|
|
|
|
|
|
while(currentrun.len)
|
|
var/mob/living/simple_animal/SA = currentrun[currentrun.len]
|
|
--currentrun.len
|
|
|
|
if(!SA.ckey)
|
|
if(SA.stat != DEAD)
|
|
SA.handle_automated_movement()
|
|
if(SA.stat != DEAD)
|
|
SA.consider_wakeup()
|
|
if (MC_TICK_CHECK)
|
|
return
|