mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-27 10:41:42 +00:00
33 lines
1021 B
Plaintext
33 lines
1021 B
Plaintext
SUBSYSTEM_DEF(npcpool)
|
|
name = "NPC Pool"
|
|
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
|
priority = FIRE_PRIORITY_NPC
|
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
|
|
|
var/list/currentrun = list()
|
|
|
|
/datum/controller/subsystem/npcpool/stat_entry()
|
|
var/list/activelist = GLOB.simple_animals[AI_ON]
|
|
..("SimpleAnimals:[activelist.len]")
|
|
|
|
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)
|
|
|
|
if(!resumed)
|
|
var/list/activelist = GLOB.simple_animals[AI_ON]
|
|
src.currentrun = activelist.Copy()
|
|
|
|
var/list/currentrun = src.currentrun
|
|
|
|
while(currentrun.len)
|
|
var/mob/living/simple_animal/SA = currentrun[currentrun.len]
|
|
--currentrun.len
|
|
|
|
if(!SA.ckey && !SA.notransform)
|
|
if(SA.stat != DEAD)
|
|
SA.handle_automated_movement()
|
|
if(SA.stat != DEAD)
|
|
SA.handle_automated_action()
|
|
if(SA.stat != DEAD)
|
|
SA.handle_automated_speech()
|
|
if(MC_TICK_CHECK)
|
|
return |