mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 06:00:16 +01:00
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:
co-authored by
John Willard
parent
c6c1f3a578
commit
9696dd1a1d
@@ -68,7 +68,7 @@
|
||||
heal_time = 0,\
|
||||
valid_targets_typecache = typecacheof(list(/mob/living/basic/construct, /mob/living/basic/shade)),\
|
||||
valid_biotypes = MOB_MINERAL | MOB_SPIRIT,\
|
||||
self_targetting = can_repair_self ? HEALING_TOUCH_ANYONE : HEALING_TOUCH_NOT_SELF,\
|
||||
self_targeting = can_repair_self ? HEALING_TOUCH_ANYONE : HEALING_TOUCH_NOT_SELF,\
|
||||
action_text = "%SOURCE% begins repairing %TARGET%'s dents.",\
|
||||
complete_text = "%TARGET%'s dents are repaired.",\
|
||||
show_health = TRUE,\
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
*/
|
||||
/datum/ai_controller/basic_controller/artificer
|
||||
blackboard = list(
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic/same_faction/construct,
|
||||
BB_FLEE_TARGETTING_DATUM = new /datum/targetting_datum/basic,
|
||||
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic/same_faction/construct,
|
||||
BB_FLEE_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
|
||||
BB_TARGET_WOUNDED_ONLY = TRUE,
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
/datum/ai_controller/basic_controller/juggernaut
|
||||
blackboard = list(
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic,
|
||||
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
|
||||
BB_TARGET_MINIMUM_STAT = HARD_CRIT,
|
||||
)
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
*/
|
||||
/datum/ai_controller/basic_controller/proteon
|
||||
blackboard = list(
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic,
|
||||
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
|
||||
BB_TARGET_MINIMUM_STAT = HARD_CRIT,
|
||||
BB_FLEE_TARGETTING_DATUM = new /datum/targetting_datum/basic,
|
||||
BB_FLEE_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
|
||||
)
|
||||
|
||||
ai_movement = /datum/ai_movement/basic_avoidance
|
||||
@@ -68,7 +68,7 @@
|
||||
*/
|
||||
/datum/ai_controller/basic_controller/wraith
|
||||
blackboard = list(
|
||||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic,
|
||||
BB_TARGETING_STRATEGY = /datum/targeting_strategy/basic,
|
||||
BB_TARGET_MINIMUM_STAT = HARD_CRIT,
|
||||
)
|
||||
|
||||
@@ -80,11 +80,11 @@
|
||||
/datum/ai_planning_subtree/basic_melee_attack_subtree,
|
||||
)
|
||||
|
||||
/// Targetting datum that will only allow mobs that constructs can heal.
|
||||
/datum/targetting_datum/basic/same_faction/construct
|
||||
/// Targeting strategy that will only allow mobs that constructs can heal.
|
||||
/datum/targeting_strategy/basic/same_faction/construct
|
||||
target_wounded_key = BB_TARGET_WOUNDED_ONLY
|
||||
|
||||
/datum/targetting_datum/basic/same_faction/construct/can_attack(mob/living/living_mob, atom/the_target, vision_range, check_faction = TRUE)
|
||||
/datum/targeting_strategy/basic/same_faction/construct/can_attack(mob/living/living_mob, atom/the_target, vision_range, check_faction = TRUE)
|
||||
if(isconstruct(the_target) || istype(the_target, /mob/living/basic/shade))
|
||||
return ..()
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user