forked from MagicBane/Server
handle destory or derank for buildings
This commit is contained in:
@@ -165,7 +165,7 @@ public enum CombatManager {
|
|||||||
break;
|
break;
|
||||||
case Building:
|
case Building:
|
||||||
if(attackRange > 15){
|
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);
|
//float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
||||||
if(distanceSquared < rangeSquared) {
|
if(distanceSquared < rangeSquared) {
|
||||||
inRange = true;
|
inRange = true;
|
||||||
@@ -420,7 +420,7 @@ public enum CombatManager {
|
|||||||
if (AbstractCharacter.IsAbstractCharacter(target))
|
if (AbstractCharacter.IsAbstractCharacter(target))
|
||||||
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
||||||
else
|
else
|
||||||
((Building) target).setCurrentHitPoints(target.getCurrentHitpoints() - damage);
|
((Building) target).modifyHealth(-damage, attacker);
|
||||||
|
|
||||||
int attackAnim = getSwingAnimation(null, null, slot.equals(mbEnums.EquipSlotType.RHELD));
|
int attackAnim = getSwingAnimation(null, null, slot.equals(mbEnums.EquipSlotType.RHELD));
|
||||||
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user