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>
This commit is contained in:
LemonInTheDark
2023-11-09 14:44:24 +00:00
committed by GitHub
co-authored by John Willard
parent c6c1f3a578
commit 9696dd1a1d
155 changed files with 436 additions and 431 deletions
@@ -60,8 +60,8 @@
/datum/ai_controller/basic_controller/cockroach
blackboard = list(
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic(),
BB_PET_TARGETTING_DATUM = new /datum/targetting_datum/basic/not_friends,
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/not_friends,
)
ai_traits = STOP_MOVING_WHEN_PULLED
+2 -2
View File
@@ -78,8 +78,8 @@
/datum/ai_controller/basic_controller/crab
blackboard = list(
BB_ALWAYS_IGNORE_FACTION = TRUE,
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/of_size/ours_or_smaller,
BB_FLEE_TARGETTING_DATUM = new /datum/targetting_datum/basic,
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic/of_size/ours_or_smaller,
BB_FLEE_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
)
ai_traits = STOP_MOVING_WHEN_PULLED
+2 -2
View File
@@ -94,8 +94,8 @@
/datum/ai_controller/basic_controller/frog
blackboard = list(
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic(),
BB_PET_TARGETTING_DATUM = new /datum/targetting_datum/basic/not_friends
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/not_friends,
)
ai_movement = /datum/ai_movement/basic_avoidance
@@ -55,7 +55,7 @@
/datum/ai_controller/basic_controller/lizard
blackboard = list(
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/allow_items(),
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic/allow_items,
)
ai_traits = STOP_MOVING_WHEN_PULLED
@@ -379,7 +379,7 @@
blackboard = list( // Always cowardly
BB_CURRENT_HUNTING_TARGET = null, // cheese
BB_LOW_PRIORITY_HUNTING_TARGET = null, // cable
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic(), // Use this to find people to run away from
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic, // Use this to find people to run away from
BB_BASIC_MOB_FLEE_DISTANCE = 3,
)
@@ -411,8 +411,8 @@
/// AI controller for rats, slightly more complex than mice becuase they attack people
/datum/ai_controller/basic_controller/mouse/rat
blackboard = list(
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic,
BB_PET_TARGETTING_DATUM = new /datum/targetting_datum/basic/not_friends,
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
BB_PET_TARGETING_STRATEGY = /datum/targeting_strategy/basic/not_friends,
BB_BASIC_MOB_CURRENT_TARGET = null, // heathen
BB_CURRENT_HUNTING_TARGET = null, // cheese
BB_LOW_PRIORITY_HUNTING_TARGET = null, // cable
@@ -42,7 +42,7 @@
///Controller for space bats, has nothing unique, just retaliation.
/datum/ai_controller/basic_controller/space_bat
blackboard = list(
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic,
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
)
ai_traits = STOP_MOVING_WHEN_PULLED