From 86102c8933e2f8e6006ea4082e26dab29acdb58e Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Mon, 27 May 2024 19:50:52 -0500 Subject: [PATCH] updated range chack and hitbox calculations --- src/engine/gameManager/CombatManager.java | 10 +++++----- src/engine/server/MBServerStatics.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index abda3780..b1b3b66a 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -140,7 +140,7 @@ public enum CombatManager { if (bonus != null) rangeMod += bonus.getFloatPercentAll(mbEnums.ModType.WeaponRange, mbEnums.SourceType.None); - attackRange = weapon.template.item_weapon_max_range * rangeMod; + attackRange += weapon.template.item_weapon_max_range * rangeMod; } if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)) @@ -150,11 +150,11 @@ public enum CombatManager { float distanceSquared = attacker.loc.distanceSquared(target.loc); boolean inRange = false; - if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) { - attackRange += ((PlayerCharacter) attacker).getCharacterHeight() * 0.5f; - } else { + //if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) { + // attackRange += ((PlayerCharacter) attacker).getCharacterHeight() * 0.5f; + //} else { attackRange += attacker.calcHitBox(); - } + //} if(attackRange > 15 && attacker.isMoving()){ //cannot shoot bow while moving; diff --git a/src/engine/server/MBServerStatics.java b/src/engine/server/MBServerStatics.java index 8546fe01..ad48d04b 100644 --- a/src/engine/server/MBServerStatics.java +++ b/src/engine/server/MBServerStatics.java @@ -273,7 +273,7 @@ public class MBServerStatics { public static final float COMBATRUNSPEED = 14.67f; public static final float RUNSPEED_MOB = 15.4f; public static final float MOVEMENT_DESYNC_TOLERANCE = 2f; // Distance out of - public static final float NO_WEAPON_RANGE = 8f; // Range for attack with no + public static final float NO_WEAPON_RANGE = 4f; // Range for attack with no public static final float REGEN_IDLE = .06f; /* * Base regen rates. Do NOT modify these. They must match the client %per