From 131369cebefef0327c7e84465954f63382cef384 Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 18 Dec 2017 14:27:48 -0500 Subject: [PATCH] Finish TargetCancel inside PerkSkeleton Should prevent skeletons from attacking teammates --- .../game/arcade/kit/perks/PerkSkeletons.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java index f26f11497..9a23c20e6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSkeletons.java @@ -160,9 +160,21 @@ public class PerkSkeletons extends Perk { if (event.getEntity().equals(skel)) { + // Cancel targeting when the skeleton + // needs to return home if (UtilMath.offset(skel, player) > _maxDist) { + event.setCancelled(true); + } + if (event.getTarget() instanceof Player) + { + Player target = (Player) event.getTarget(); + + if (Manager.GetGame().GetTeam(player) == Manager.GetGame().GetTeam(target)) + { + event.setCancelled(true); + } } } } @@ -190,13 +202,15 @@ public class PerkSkeletons extends Perk continue; } - //Return to Owner double range = 4; + + //If it's targeting another player if (skel.getTarget() != null || ((CraftSkeleton) skel).getHandle().getGoalTarget() != null) { range = _maxDist; } + //Return to Owner if (UtilMath.offset(skel, player) > range) { float speed = 1.25f;