* Fix #6949 * No point in calculating if it already does no damage Also don't show damage stat if it deals no damage. Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
@@ -83,5 +83,9 @@ public class BaseTurret extends Block{
|
||||
public void drawSelect(){
|
||||
Drawf.dashCircle(x, y, range(), team.color);
|
||||
}
|
||||
|
||||
public float estimateDps(){
|
||||
return 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class TractorBeamTurret extends BaseTurret{
|
||||
|
||||
stats.add(Stat.targetsAir, targetAir);
|
||||
stats.add(Stat.targetsGround, targetGround);
|
||||
stats.add(Stat.damage, damage * 60f, StatUnit.perSecond);
|
||||
if(damage > 0) stats.add(Stat.damage, damage * 60f, StatUnit.perSecond);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,6 +137,12 @@ public class TractorBeamTurret extends BaseTurret{
|
||||
return super.shouldConsume() && target != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float estimateDps(){
|
||||
if(!any || damage <= 0) return 0f;
|
||||
return damage * 60f * efficiency * coolantMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
Draw.rect(baseRegion, x, y);
|
||||
|
||||
@@ -214,6 +214,7 @@ public class Turret extends ReloadTurret{
|
||||
public float heatReq;
|
||||
public float[] sideHeat = new float[4];
|
||||
|
||||
@Override
|
||||
public float estimateDps(){
|
||||
if(!hasAmmo()) return 0f;
|
||||
return shoot.shots / reload * 60f * (peekAmmo() == null ? 0f : peekAmmo().estimateDPS()) * potentialEfficiency * timeScale;
|
||||
|
||||
Reference in New Issue
Block a user