mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
Adds a subsystem for ai movement (#57111)
* done * straight walk * movement * yep * removes unused macro * done * Update ai_movement.dm
This commit is contained in:
@@ -4,6 +4,7 @@ PROCESSING_SUBSYSTEM_DEF(ai_controllers)
|
||||
flags = SS_POST_FIRE_TIMING|SS_BACKGROUND
|
||||
priority = FIRE_PRIORITY_NPC
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
init_order = INIT_ORDER_AI_CONTROLLERS
|
||||
wait = 8 //Uses the value of CLICK_CD_MELEE because that seemed like a nice standard for the speed of AI behavior
|
||||
|
||||
///an assoc list of all ai_behaviors by type, to
|
||||
|
||||
21
code/controllers/subsystem/processing/ai_movement.dm
Normal file
21
code/controllers/subsystem/processing/ai_movement.dm
Normal file
@@ -0,0 +1,21 @@
|
||||
/// The subsystem used to tick [/datum/ai_movement] instances. Handling the movement of individual AI instances
|
||||
PROCESSING_SUBSYSTEM_DEF(ai_movement)
|
||||
name = "AI movement"
|
||||
flags = SS_KEEP_TIMING|SS_BACKGROUND
|
||||
priority = FIRE_PRIORITY_NPC_MOVEMENT
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
init_order = INIT_ORDER_AI_MOVEMENT
|
||||
wait = 1
|
||||
|
||||
///an assoc list of all ai_movement types. Assoc type to instance
|
||||
var/list/movement_types
|
||||
|
||||
/datum/controller/subsystem/processing/ai_movement/Initialize(timeofday)
|
||||
SetupAIMovementInstances()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/processing/ai_movement/proc/SetupAIMovementInstances()
|
||||
movement_types = list()
|
||||
for(var/key as anything in subtypesof(/datum/ai_movement))
|
||||
var/datum/ai_movement/ai_movement = new key
|
||||
movement_types[key] = ai_movement
|
||||
Reference in New Issue
Block a user