[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>
This commit is contained in:
SkyratBot
2022-08-31 09:30:30 -07:00
committed by GitHub
co-authored by itseasytosee
parent ec2ddf2d68
commit de503f6b92
+4
View File
@@ -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