mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-18 05:32:58 +00:00
* Clean up subsystem Initialize(), require an explicit result returned, give a formal way to fail (for SSlua) * [PR for MIRROR PR] Changes for 16248 (#16277) * Merge skyrat changes, update SR SS's, and remove lobby_eye * Apply suggestions from code review Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> * Update modular_skyrat/modules/autotransfer/code/autotransfer.dm Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> * restore lobby_cam for now Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Co-authored-by: Tastyfish <crazychris32@gmail.com> Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
21 lines
938 B
Plaintext
21 lines
938 B
Plaintext
/// The subsystem used to tick [/datum/ai_behavior] instances. Handling the individual actions an AI can take like punching someone in the fucking NUTS
|
|
PROCESSING_SUBSYSTEM_DEF(ai_behaviors)
|
|
name = "AI Behavior Ticker"
|
|
flags = SS_POST_FIRE_TIMING|SS_BACKGROUND
|
|
priority = FIRE_PRIORITY_NPC_ACTIONS
|
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
|
init_order = INIT_ORDER_AI_CONTROLLERS
|
|
wait = 1
|
|
///List of all ai_behavior singletons, key is the typepath while assigned value is a newly created instance of the typepath. See SetupAIBehaviors()
|
|
var/list/ai_behaviors
|
|
|
|
/datum/controller/subsystem/processing/ai_behaviors/Initialize()
|
|
SetupAIBehaviors()
|
|
return SS_INIT_SUCCESS
|
|
|
|
/datum/controller/subsystem/processing/ai_behaviors/proc/SetupAIBehaviors()
|
|
ai_behaviors = list()
|
|
for(var/behavior_type in subtypesof(/datum/ai_behavior))
|
|
var/datum/ai_behavior/ai_behavior = new behavior_type
|
|
ai_behaviors[behavior_type] = ai_behavior
|