Files
Bubberstation/code/datums/ai/bane/bane_controller.dm
Ben10Omintrix f698cea0f4 fixes ai controllers resetting their targets post do_afters (#87426)
## About The Pull Request
mobs would disregard you for a bit if they went through a do_after, such
as goldgrub digging or medbots healing. this fixes that

## Why It's Good For The Game
fixes ai controllers resetting their targets post do_afters

## Changelog
🆑
fix: fixes ai controllers resetting their targets post do_afters
/🆑
2024-10-25 01:49:00 +02:00

32 lines
1.1 KiB
Plaintext

/*
You yourself fought the decadence of Gotham for years with all your strength, all your resources, all your moral authority.
And the only victory you achieved was a lie. Now you understand Gotham is beyond saving, and must be allowed to die.
*/
/datum/ai_controller/bane
movement_delay = 0.4 SECONDS
blackboard = list(BB_BANE_BATMAN = null)
planning_subtrees = list(/datum/ai_planning_subtree/bane_hunting)
/datum/ai_controller/bane/TryPossessPawn(atom/new_pawn)
if(!isliving(new_pawn))
return AI_CONTROLLER_INCOMPATIBLE
return ..() //Run parent at end
/datum/ai_controller/bane/on_stat_changed(mob/living/source, new_stat)
. = ..()
update_able_to_run()
/datum/ai_controller/bane/setup_able_to_run()
. = ..()
RegisterSignal(pawn, COMSIG_MOB_INCAPACITATE_CHANGED, PROC_REF(update_able_to_run))
/datum/ai_controller/bane/clear_able_to_run()
UnregisterSignal(pawn, list(COMSIG_MOB_INCAPACITATE_CHANGED, COMSIG_MOB_STATCHANGE))
return ..()
/datum/ai_controller/bane/get_able_to_run()
var/mob/living/living_pawn = pawn
if(IS_DEAD_OR_INCAP(living_pawn))
return AI_UNABLE_TO_RUN
return ..()