mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 09:05:11 +01:00
Adds a priority targeting framework, and priority targeting to mining mobs (#95720)
## About The Pull Request Introduces a new targeting priority strategy system for basicmob AIs, which allows controllers to decide which mob to prioritize over others. Mining mobs will now focus on the NODE drone unless hit, and will pursue the attacker for 25 seconds before dropping the aggro. They also get increased aggro if you've attacked other mobs in their view recently, and after a few hits will have enough aggro to swap to you from the NODE drone. Ashwalkers get a reduction in aggro because they live there. Legion broods and brimdemons will immediately target anyone who attacks their allies rather than waiting for multiple hits. Broods also now inherit their parent's targets and retaliation/reinforcements lists. https://github.com/user-attachments/assets/6baaba8a-8b3c-4b2f-ae8b-842f0b1f2b6d #### This is a bounty for ArcaneMusic ## Why It's Good For The Game Makes vent defense mob behavior more predictable and easier for players to manipulate, allowing them to draw aggro from the NODE drone should make vents more engaging and less of an AI rng fest ## Changelog 🆑 add: Mining mobs now use priority when choosing their target, prioritizing NODE drones over miners who haven't attacked them or their allies /🆑
This commit is contained in:
@@ -8,24 +8,33 @@ PROCESSING_SUBSYSTEM_DEF(ai_behaviors)
|
||||
/datum/controller/subsystem/movement/ai_movement,
|
||||
)
|
||||
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()
|
||||
/// List of all ai_behavior singletons, key is the typepath while assigned value is a newly created instance of the typepath. See setup_ai_behaviors()
|
||||
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()
|
||||
/// List of all targeting_strategy singletons, key is the typepath while assigned value is a newly created instance of the typepath. See setup_targeting_strats()
|
||||
var/list/targeting_strategies
|
||||
/// List of all target_priority_strategy singletons, key is the typepath while assigned value is a newly created instance of the typepath. See setup_target_priority_strats()
|
||||
var/list/target_priority_strategies
|
||||
|
||||
/datum/controller/subsystem/processing/ai_behaviors/Initialize()
|
||||
SetupAIBehaviors()
|
||||
SetupTargetingStrats()
|
||||
setup_ai_behaviors()
|
||||
setup_targeting_strats()
|
||||
setup_target_priority_strats()
|
||||
return SS_INIT_SUCCESS
|
||||
|
||||
/datum/controller/subsystem/processing/ai_behaviors/proc/SetupAIBehaviors()
|
||||
/datum/controller/subsystem/processing/ai_behaviors/proc/setup_ai_behaviors()
|
||||
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()
|
||||
/datum/controller/subsystem/processing/ai_behaviors/proc/setup_targeting_strats()
|
||||
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
|
||||
|
||||
/datum/controller/subsystem/processing/ai_behaviors/proc/setup_target_priority_strats()
|
||||
target_priority_strategies = list()
|
||||
for(var/target_type in subtypesof(/datum/target_priority_strategy))
|
||||
var/datum/target_priority_strategy/target_start = new target_type
|
||||
target_priority_strategies[target_type] = target_start
|
||||
|
||||
Reference in New Issue
Block a user