From de503f6b92e4d6faa4f8477c85363f7d71df5ca6 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 31 Aug 2022 18:30:30 +0200 Subject: [PATCH] [MIRROR] Monkeys won't stay in combat mode forever after getting pissed off anymore. [MDB IGNORE] (#15937) * Monkeys won't stay in combat mode forever after getting pissed off anymore. (#69488) Monkeys will now drop out of combat mode in the following situations - They have no enemies - They have enemies but the monkey can not target them because they are far away - They have enemies but they are dead/disabled * Monkeys won't stay in combat mode forever after getting pissed off anymore. Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com> --- code/datums/ai/monkey/monkey_subtrees.dm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/datums/ai/monkey/monkey_subtrees.dm b/code/datums/ai/monkey/monkey_subtrees.dm index 443d927127a..9d7ba082333 100644 --- a/code/datums/ai/monkey/monkey_subtrees.dm +++ b/code/datums/ai/monkey/monkey_subtrees.dm @@ -30,10 +30,12 @@ var/list/enemies = controller.blackboard[BB_MONKEY_ENEMIES] if((HAS_TRAIT(controller.pawn, TRAIT_PACIFISM)) || (!length(enemies) && !controller.blackboard[BB_MONKEY_AGGRESSIVE])) //Pacifist, or we have no enemies and we're not pissed + living_pawn.set_combat_mode(FALSE) return if(!controller.blackboard[BB_MONKEY_CURRENT_ATTACK_TARGET]) controller.queue_behavior(/datum/ai_behavior/monkey_set_combat_target, BB_MONKEY_CURRENT_ATTACK_TARGET, BB_MONKEY_ENEMIES) + living_pawn.set_combat_mode(FALSE) return SUBTREE_RETURN_FINISH_PLANNING var/datum/weakref/target_ref = controller.blackboard[BB_MONKEY_CURRENT_ATTACK_TARGET] @@ -55,6 +57,8 @@ //by this point we have a target but they're down, let's try dumpstering this loser + living_pawn.set_combat_mode(FALSE) + if(!controller.blackboard[BB_MONKEY_TARGET_DISPOSAL]) controller.queue_behavior(/datum/ai_behavior/find_and_set, BB_MONKEY_TARGET_DISPOSAL, /obj/machinery/disposal, MONKEY_ENEMY_VISION) return