Files
Bubberstation/code/controllers/subsystem/idlenpcpool.dm
vuonojenmustaturska a927f2a64c expand simple_animals/hostile/aistatus into a simple_animals-wide system for putting mobs into idling mode (#31778)
* 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
2017-10-19 11:57:10 +02:00

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