|
|
@ -470,25 +470,27 @@ public enum CombatManager { |
|
|
|
|
|
|
|
|
|
|
|
//Range check.
|
|
|
|
//Range check.
|
|
|
|
|
|
|
|
|
|
|
|
if(abstractCharacter.isMoving()){ |
|
|
|
//if(abstractCharacter.isMoving()){
|
|
|
|
range += (abstractCharacter.getSpeed() * 0.1f); // add movement vector offset for moving attacker
|
|
|
|
// range += (abstractCharacter.getSpeed() * 0.1f); // add movement vector offset for moving attacker
|
|
|
|
} |
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
if(AbstractWorldObject.IsAbstractCharacter(target)) { |
|
|
|
//if(AbstractWorldObject.IsAbstractCharacter(target)) {
|
|
|
|
AbstractCharacter tarAc = (AbstractCharacter) target; |
|
|
|
// AbstractCharacter tarAc = (AbstractCharacter) target;
|
|
|
|
if(tarAc != null && tarAc.isMoving()){ |
|
|
|
// if(tarAc != null && tarAc.isMoving()){
|
|
|
|
range += (tarAc.getSpeed() * 0.1f); // add movement vector offset for moving target
|
|
|
|
// range += (tarAc.getSpeed() * 0.1f); // add movement vector offset for moving target
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
float attackerHitBox = abstractCharacter.calcHitBox(); // add attacker hitbox
|
|
|
|
//float attackerHitBox = abstractCharacter.calcHitBox(); // add attacker hitbox
|
|
|
|
float targetHitBox = 0.0f; |
|
|
|
//float targetHitBox = 0.0f;
|
|
|
|
if(AbstractCharacter.IsAbstractCharacter(target)){ |
|
|
|
//if(AbstractCharacter.IsAbstractCharacter(target)){
|
|
|
|
AbstractCharacter targetCharacter = (AbstractCharacter)target; |
|
|
|
// AbstractCharacter targetCharacter = (AbstractCharacter)target;
|
|
|
|
targetHitBox = targetCharacter.calcHitBox(); // add target hitbox
|
|
|
|
// targetHitBox = targetCharacter.calcHitBox(); // add target hitbox
|
|
|
|
} |
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//range += attackerHitBox + targetHitBox + 2.5f; // offset standard range to sync where client tries to stop
|
|
|
|
|
|
|
|
|
|
|
|
range += attackerHitBox + targetHitBox + 2.5f; // offset standard range to sync where client tries to stop
|
|
|
|
range += 2; //sync offset
|
|
|
|
|
|
|
|
|
|
|
|
if (NotInRange(abstractCharacter, target, range)) { |
|
|
|
if (NotInRange(abstractCharacter, target, range)) { |
|
|
|
|
|
|
|
|
|
|
|