mirror of
https://github.com/Skyrat-SS13/Skyrat-tg.git
synced 2026-07-15 01:43:46 +01:00
bbd547ec95
* Targeting Datums Renamed (and global) (#79513)
## About The Pull Request
[Implements the backend required to make targeting datums
global](https://github.com/tgstation/tgstation/commit/6901ead12e419530b7f646ea21094d4432d7385e)
It's inconsistent with the rest of basic ai for these to have a high
degree of state, plus like, such a waste yaknow?
[Implements
GET_TARGETING_STRATEGY](https://github.com/tgstation/tgstation/commit/d79c29134d03424a9f8bacd64c08cb41775fe8c0)
Regexes used:
new.*(/datum/targetting_datum[^,(]*)\(*\)* -> GET_TARGETING_STRATEGY($1)
Renamed all instances of targetting to targeting (also targetting datum
-> targeting strategy)
I've used GET_TARGETING_STRATEGY at the source where the keys are
actually used, rather then in the listing. This works out just fine.
## Why It's Good For The Game
Not a misspelled name through the whole codebase, very slightly less
memory load for basically no downside (slight cpu cost maybe but not a
significant one.
---------
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
* Targeting Datums Renamed (and global)
* Update dogs.dm
* Modular
* Modular
* Modular
* Merge skew?
* Revert "Merge skew?"
This reverts commit 0889389ab5.
---------
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@ users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
30 lines
1.4 KiB
Plaintext
30 lines
1.4 KiB
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
|
|
///List of all targeting_strategy singletons, key is the typepath while assigned value is a newly created instance of the typepath. See SetupAIBehaviors()
|
|
var/list/targeting_strategies
|
|
|
|
/datum/controller/subsystem/processing/ai_behaviors/Initialize()
|
|
SetupAIBehaviors()
|
|
SetupTargetingStrats()
|
|
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
|
|
|
|
/datum/controller/subsystem/processing/ai_behaviors/proc/SetupTargetingStrats()
|
|
targeting_strategies = list()
|
|
for(var/target_type in subtypesof(/datum/targeting_strategy))
|
|
var/datum/targeting_strategy/target_start = new target_type
|
|
targeting_strategies[target_type] = target_start
|