Method refactoring / Cleanup
This commit is contained in:
@@ -2,7 +2,6 @@ package mindustry.entities.comp;
|
||||
|
||||
import arc.math.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@@ -53,7 +52,7 @@ abstract class HealthComp implements Entityc{
|
||||
/** Damage and pierce armor. */
|
||||
void damagePierce(float amount, boolean withEffect){
|
||||
if(this instanceof Shieldc){
|
||||
damage(amount / Math.max(1f - ((Shieldc)this).armor(), Vars.minArmorDamage), withEffect);
|
||||
damage(amount + ((Shieldc)this).armor(), withEffect);
|
||||
}else{
|
||||
damage(amount, withEffect);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import mindustry.annotations.Annotations.*;
|
||||
import mindustry.core.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.net.Administration.*;
|
||||
@@ -143,6 +144,8 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
||||
unit.team(team);
|
||||
unit.controller(this);
|
||||
}
|
||||
|
||||
Events.fire(new UnitChangeEvent((Playerc)this, unit));
|
||||
}
|
||||
|
||||
boolean dead(){
|
||||
|
||||
@@ -23,7 +23,8 @@ abstract class ShieldComp implements Healthc, Posc{
|
||||
@Override
|
||||
public void damage(float amount){
|
||||
//apply armor
|
||||
amount *= Math.max(1f - armor, minArmorDamage);
|
||||
//TODO balancing of armor stats & minArmorDamage
|
||||
amount = Math.max(amount - armor, minArmorDamage * amount);
|
||||
|
||||
hitTime = 1f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user