Renamed class to not conflict with the java.lang version.

This commit is contained in:
2024-04-05 07:59:44 -04:00
parent dd84615ca1
commit c1ee6f5b52
388 changed files with 1807 additions and 1779 deletions
+32 -32
View File
@@ -8,12 +8,12 @@
package engine.mobileAI;
import engine.Enum;
import engine.Enum.DispatchChannel;
import engine.InterestManagement.WorldGrid;
import engine.gameManager.*;
import engine.math.Vector3f;
import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.DispatchChannel;
import engine.mobileAI.Threads.MobAIThread;
import engine.mobileAI.Threads.Respawner;
import engine.mobileAI.utilities.MovementUtilities;
@@ -50,13 +50,13 @@ public class MobAI {
return;
}
if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) &&
if (target.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) &&
!mob.canSee((AbstractCharacter) target)) {
mob.setCombatTarget(null);
return;
}
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) {
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter && canCast(mob)) {
if (MobCast(mob)) {
mob.updateLocation();
@@ -141,7 +141,7 @@ public class MobAI {
if (playercity != null)
for (Mob guard : playercity.getParent().zoneMobSet)
if (guard.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN))
if (guard.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN))
if (guard.getCombatTarget() == null && !guard.getGuild().equals(mob.getGuild()))
guard.setCombatTarget(mob);
@@ -188,7 +188,7 @@ public class MobAI {
// early exit while waiting to patrol again.
// Minions are force marched if captain is alive
boolean forced = mob.agentType.equals(Enum.AIAgentType.GUARDMINION) &&
boolean forced = mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION) &&
mob.guardCaptain.isAlive();
if (mob.stopPatrolTime + (patrolDelay * 1000) > System.currentTimeMillis())
@@ -198,7 +198,7 @@ public class MobAI {
//guards inherit barracks patrol points dynamically
if (mob.patrolPoints == null || mob.patrolPoints.isEmpty())
if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN) || mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) {
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN) || mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION)) {
Building barracks = mob.building;
@@ -215,7 +215,7 @@ public class MobAI {
// Minions are given marching orders by the captain if he is alive
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) {
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION)) {
Mob captain = (Mob) mob.guardCaptain;
mob.destination = captain.destination.add(Formation.getOffset(2, mob.guardCaptain.minions.indexOf(mob.getObjectUUID()) + 3));
mob.lastPatrolPointIndex = captain.lastPatrolPointIndex;
@@ -226,7 +226,7 @@ public class MobAI {
// Captain orders minions to patrol
if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN))
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN))
for (Integer minionUUID : mob.minions) {
Mob minion = Mob.getMob(minionUUID);
if (minion.isAlive() && minion.combatTarget == null)
@@ -254,16 +254,16 @@ public class MobAI {
if (mob.isPlayerGuard() == true) {
if (mob.agentType.equals(Enum.AIAgentType.GUARDWALLARCHER))
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDWALLARCHER))
return false; //wall archers don't cast
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION))
contractID = mob.guardCaptain.contract.getContractID();
else
contractID = mob.contract.getContractID();
// exception allowing werewolf and werebear guard captains to cast
if (Enum.MinionType.ContractToMinionMap.get(contractID).isMage() == false && contractID != 980103 && contractID != 980104)
if (mbEnums.MinionType.ContractToMinionMap.get(contractID).isMage() == false && contractID != 980103 && contractID != 980104)
return false;
}
@@ -313,7 +313,7 @@ public class MobAI {
if (mob.contract != null)
contractEntries = PowersManager.getPowersForRune(mob.contractUUID);
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION))
contractEntries = PowersManager.getPowersForRune(mob.guardCaptain.contractUUID);
powerEntries.addAll(contractEntries);
@@ -473,7 +473,7 @@ public class MobAI {
if (mob.despawned && mob.isPlayerGuard()) {
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) {
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION)) {
if (mob.guardCaptain.isAlive() == false || ((Mob) mob.guardCaptain).despawned == true) {
//minions don't respawn while guard captain is dead
@@ -490,7 +490,7 @@ public class MobAI {
//check to send mob home for player guards to prevent exploit of dragging guards away and then teleporting
if (!mob.agentType.equals(Enum.AIAgentType.PET))
if (!mob.agentType.equals(mbEnums.AIAgentType.PET))
CheckToSendMobHome(mob);
return;
@@ -507,7 +507,7 @@ public class MobAI {
boolean bypassLoadedPlayerCheck = false;
if (mob.isPlayerGuard() || mob.isSiege()) {
bypassLoadedPlayerCheck = true;
if (mob.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
if (mob.combatTarget != null && mob.combatTarget.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
if (mob.combatTarget.loc.distanceSquared(mob.loc) > 10000)
mob.setCombatTarget(null);
}
@@ -519,7 +519,7 @@ public class MobAI {
}
if (mob.agentType.equals(Enum.AIAgentType.PET) == false)
if (mob.agentType.equals(mbEnums.AIAgentType.PET) == false)
CheckToSendMobHome(mob);
if (mob.getCombatTarget() != null) {
@@ -684,7 +684,7 @@ public class MobAI {
// Minions only patrol on their own if captain is dead.
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) == false)
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION) == false)
Patrol(mob);
else if (mob.guardCaptain.isAlive() == false)
Patrol(mob);
@@ -758,19 +758,19 @@ public class MobAI {
if (mob.getCombatTarget() == null)
return;
if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false &&
mob.agentType.equals(Enum.AIAgentType.PET) == false) {
if (mob.getCombatTarget().getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) && MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) == false &&
mob.agentType.equals(mbEnums.AIAgentType.PET) == false) {
mob.setCombatTarget(null);
return;
}
if (System.currentTimeMillis() > mob.getNextAttackTime()) {
int delay = 3000;
if (mob.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD) != null) {
delay = (int) (mob.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD).template.item_weapon_wepspeed * 100);
if (mob.charItemManager.getEquipped().get(mbEnums.EquipSlotType.RHELD) != null) {
delay = (int) (mob.charItemManager.getEquipped().get(mbEnums.EquipSlotType.RHELD).template.item_weapon_wepspeed * 100);
}
if (mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD) != null && mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD).template.item_type.equals(Enum.ItemType.WEAPON)) {
delay += (int) (mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD).template.item_weapon_wepspeed * 100);
if (mob.charItemManager.getEquipped().get(mbEnums.EquipSlotType.LHELD) != null && mob.charItemManager.getEquipped().get(mbEnums.EquipSlotType.LHELD).template.item_type.equals(mbEnums.ItemType.WEAPON)) {
delay += (int) (mob.charItemManager.getEquipped().get(mbEnums.EquipSlotType.LHELD).template.item_weapon_wepspeed * 100);
}
@@ -799,7 +799,7 @@ public class MobAI {
PowersManager.useMobPower(mob, mob, recall, 40);
mob.setCombatTarget(null);
if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN) && mob.isAlive()) {
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN) && mob.isAlive()) {
//guard captain pulls his minions home with him
@@ -883,7 +883,7 @@ public class MobAI {
continue;
//don't attack pets
if (aggroMob.agentType.equals(Enum.AIAgentType.PET))
if (aggroMob.agentType.equals(mbEnums.AIAgentType.PET))
continue;
if (mob.getLoc().distanceSquared2D(aggroMob.getLoc()) > sqr(50))
@@ -907,7 +907,7 @@ public class MobAI {
if (newTarget != null) {
if (newTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
if (newTarget.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
if (GuardCanAggro(mob, (PlayerCharacter) newTarget))
mob.setCombatTarget(newTarget);
} else
@@ -947,7 +947,7 @@ public class MobAI {
if (mob.isSit() && mob.getTimeStamp("HEALTHRECOVERED") < System.currentTimeMillis() + 3000)
if (mob.getHealth() < mob.getHealthMax()) {
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(Enum.ModType.HealthRecoverRate, Enum.SourceType.None)) * 0.01f);
float recoveredHealth = mob.getHealthMax() * ((1 + mob.getBonuses().getFloatPercentAll(mbEnums.ModType.HealthRecoverRate, mbEnums.SourceType.None)) * 0.01f);
mob.setHealth(mob.getHealth() + recoveredHealth);
mob.getTimestamps().put("HEALTHRECOVERED", System.currentTimeMillis());
@@ -992,7 +992,7 @@ public class MobAI {
mob.setCombatTarget(newTarget);
else {
if (mob.getCombatTarget() == null) {
if (mob.behaviourType == Enum.MobBehaviourType.HamletGuard)
if (mob.behaviourType == mbEnums.MobBehaviourType.HamletGuard)
SafeGuardAggro(mob); //safehold guard
else
CheckForAggro(mob); //normal aggro
@@ -1026,7 +1026,7 @@ public class MobAI {
// Defer to captain if possible for current target
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) &&
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION) &&
mob.guardCaptain.isAlive()
&& mob.guardCaptain.combatTarget != null) {
mob.setCombatTarget(mob.guardCaptain.combatTarget);
@@ -1178,7 +1178,7 @@ public class MobAI {
MovementUtilities.aiMove(mob, mob.destination, true);
if (mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN)) {
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN)) {
for (Integer minionUUID : mob.minions) {
Mob minion = Mob.getMob(minionUUID);
@@ -1206,7 +1206,7 @@ public class MobAI {
float CurrentHateValue = 0;
if (mob.getCombatTarget() != null && mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
if (mob.getCombatTarget() != null && mob.getCombatTarget().getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
CurrentHateValue = mob.playerAgroMap.get(mob.combatTarget.getObjectUUID()).floatValue();
AbstractWorldObject mostHatedTarget = null;