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
This commit is contained in:
vuonojenmustaturska
2017-10-19 12:57:10 +03:00
committed by CitadelStationBot
parent 98a583b249
commit 360d883879
12 changed files with 96 additions and 18 deletions
+34
View File
@@ -0,0 +1,34 @@
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
+2 -1
View File
@@ -37,7 +37,8 @@ SUBSYSTEM_DEF(npcpool)
// 5. Do all assignments: goes through the delegated/coordianted bots and assigns the right variables/tasks to them.
if (!resumed)
src.currentrun = GLOB.simple_animals.Copy()
var/list/activelist = GLOB.simple_animals[AI_ON]
src.currentrun = activelist.Copy()
stage = PROCESSING_SIMPLES
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun