From 5d1ccc437c769bc94d584effe9747290674f28a5 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 6 Aug 2023 00:04:42 -0500 Subject: [PATCH] mele guards dont cast --- src/engine/Enum.java | 3 +++ src/engine/mobileAI/MobAI.java | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/engine/Enum.java b/src/engine/Enum.java index ce5dfa3c..231f1c5f 100644 --- a/src/engine/Enum.java +++ b/src/engine/Enum.java @@ -2679,6 +2679,9 @@ public class Enum { return race; } + public Boolean isMage(){ + return this.minionClass.ordinal() == MinionClass.MAGE.ordinal(); + } } public enum GridObjectType { diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index dea54c94..1fa9a1cf 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -320,6 +320,18 @@ public class MobAI { if (mob == null) return false; + if(mob.isPlayerGuard == true){ + int contractID; + if(mob.BehaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal()){ + contractID = mob.npcOwner.contract.getContractID(); + } else{ + contractID = mob.contract.getContractID(); + } + if(Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false){ + return false; + } + } + if (mob.mobPowers.isEmpty()) return false; @@ -327,12 +339,6 @@ public class MobAI { mob.setCombatTarget(null); return false; } - - //int castRoll = ThreadLocalRandom.current().nextInt(1,101); - - //if (castRoll < MobAIThread.AI_POWER_DIVISOR) - // return false; - if (mob.nextCastTime == 0) mob.nextCastTime = System.currentTimeMillis();