Browse Source

handle destory or derank for buildings

combat-2
FatBoy-DOTC 6 months ago
parent
commit
1bbbc396bd
  1. 4
      src/engine/gameManager/CombatManager.java

4
src/engine/gameManager/CombatManager.java

@ -165,7 +165,7 @@ public enum CombatManager { @@ -165,7 +165,7 @@ public enum CombatManager {
break;
case Building:
if(attackRange > 15){
float rangeSquared = attackRange * attackRange;
float rangeSquared = (attackRange + target.getBounds().getHalfExtents().x) * (attackRange + target.getBounds().getHalfExtents().x);
//float distanceSquared = attacker.loc.distanceSquared(target.loc);
if(distanceSquared < rangeSquared) {
inRange = true;
@ -420,7 +420,7 @@ public enum CombatManager { @@ -420,7 +420,7 @@ public enum CombatManager {
if (AbstractCharacter.IsAbstractCharacter(target))
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
else
((Building) target).setCurrentHitPoints(target.getCurrentHitpoints() - damage);
((Building) target).modifyHealth(-damage, attacker);
int attackAnim = getSwingAnimation(null, null, slot.equals(mbEnums.EquipSlotType.RHELD));
if (attacker.charItemManager.getEquipped().get(slot) != null) {

Loading…
Cancel
Save