Browse Source

attack range sync

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
58d5c1969c
  1. 7
      src/engine/gameManager/CombatManager.java

7
src/engine/gameManager/CombatManager.java

@ -1280,6 +1280,13 @@ public enum CombatManager {
range += (calcHitBox(ac) + calcHitBox(target)); range += (calcHitBox(ac) + calcHitBox(target));
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
range += ((PlayerCharacter)ac).getCharacterHeight() * 0.5f;
if(ac.isMoving()){
range += ac.getSpeed();
}
}
float magnitudeSquared = tl.distanceSquared(sl); float magnitudeSquared = tl.distanceSquared(sl);
return magnitudeSquared > range * range; return magnitudeSquared > range * range;

Loading…
Cancel
Save