From 58d5c1969c9c8d17e89cac40ad25d9f551fa6ac0 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sat, 27 Apr 2024 19:37:51 -0500 Subject: [PATCH] attack range sync --- src/engine/gameManager/CombatManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index 7f9fd45f..1f47a54d 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -1280,6 +1280,13 @@ public enum CombatManager { 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); return magnitudeSquared > range * range;