Browse Source

See Invis Bug Addressed

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
c304a59d95
  1. 16
      src/engine/mobileAI/MobAI.java
  2. 4
      src/engine/objects/PlayerCharacter.java

16
src/engine/mobileAI/MobAI.java

@ -48,7 +48,12 @@ public class MobAI {
mob.setCombatTarget(null); mob.setCombatTarget(null);
return; return;
} }
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter){
if(((PlayerCharacter)target).getHidden() > 0){
mob.setCombatTarget(null);
return;
}
}
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) { if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter && canCast(mob)) {
if (mob.isPlayerGuard() == false && MobCast(mob)) { if (mob.isPlayerGuard() == false && MobCast(mob)) {
@ -736,7 +741,7 @@ public class MobAI {
//Player is Dead, Mob no longer needs to attempt to aggro. Remove them from aggro map. //Player is Dead, Mob no longer needs to attempt to aggro. Remove them from aggro map.
if (!loadedPlayer.isAlive()) { if (!loadedPlayer.isAlive() || loadedPlayer.getHidden() > 0) {
loadedPlayers.remove(playerID); loadedPlayers.remove(playerID);
continue; continue;
} }
@ -978,7 +983,12 @@ public class MobAI {
private static void chaseTarget(Mob mob) { private static void chaseTarget(Mob mob) {
try { try {
if (mob.combatTarget.getObjectType() == Enum.GameObjectType.PlayerCharacter){
if(((PlayerCharacter)mob.combatTarget).getHidden() > 0){
mob.setCombatTarget(null);
return;
}
}
float rangeSquared = mob.getRange() * mob.getRange(); float rangeSquared = mob.getRange() * mob.getRange();
float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc()); float distanceSquared = mob.getLoc().distanceSquared2D(mob.getCombatTarget().getLoc());

4
src/engine/objects/PlayerCharacter.java

@ -3324,7 +3324,9 @@ public class PlayerCharacter extends AbstractCharacter {
if (this.equals(tar)) if (this.equals(tar))
return true; return true;
if(this.getSeeInvis() >= 20){
return !tar.safemodeInvis();
}
return this.getSeeInvis() >= tar.hidden && !tar.safemodeInvis(); return this.getSeeInvis() >= tar.hidden && !tar.safemodeInvis();
} }

Loading…
Cancel
Save