Browse Source

added = to range checks and converted speed to float

combat-4
FatBoy-DOTC 7 months ago
parent
commit
1cf1d731c4
  1. 8
      src/engine/gameManager/CombatManager.java

8
src/engine/gameManager/CombatManager.java

@ -168,12 +168,12 @@ public enum CombatManager {
switch (target.getObjectType()) { switch (target.getObjectType()) {
case PlayerCharacter: case PlayerCharacter:
attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f; attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f;
if (distanceSquared < attackRange * attackRange) if (distanceSquared <= attackRange * attackRange)
inRange = true; inRange = true;
break; break;
case Mob: case Mob:
attackRange += ((AbstractCharacter) target).calcHitBox(); attackRange += ((AbstractCharacter) target).calcHitBox();
if (distanceSquared < attackRange * attackRange) if (distanceSquared <= attackRange * attackRange)
inRange = true; inRange = true;
break; break;
case Building: case Building:
@ -201,7 +201,7 @@ public enum CombatManager {
if (weapon != null) { if (weapon != null) {
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed); float wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None)); wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
@ -212,7 +212,7 @@ public enum CombatManager {
if (wepSpeed < 10) if (wepSpeed < 10)
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects. wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
delay = wepSpeed * 100L; delay = (long)wepSpeed * 100L;
} }
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)) if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))

Loading…
Cancel
Save