Sector damage calculation fix

This commit is contained in:
Anuken
2020-10-31 13:42:43 -04:00
parent 4d34f16fcd
commit 9c54fcee2e
3 changed files with 9 additions and 1 deletions

View File

@@ -26,6 +26,11 @@ public class LightningBulletType extends BulletType{
return (lightningLength + lightningLengthRand/2f) * 6f; return (lightningLength + lightningLengthRand/2f) * 6f;
} }
@Override
public float estimateDPS(){
return super.estimateDPS() * Math.max(lightningLength / 2f, 1);
}
@Override @Override
public void draw(Bullet b){ public void draw(Bullet b){
} }

View File

@@ -75,6 +75,9 @@ public class SectorDamage{
float timeDestroyEnemy = dps <= 0.0001f ? Float.POSITIVE_INFINITY : enemyHealth / dps; //if dps == 0, this is infinity float timeDestroyEnemy = dps <= 0.0001f ? Float.POSITIVE_INFINITY : enemyHealth / dps; //if dps == 0, this is infinity
float timeDestroyBase = health / (enemyDps - rps); //if regen > enemyDps this is negative float timeDestroyBase = health / (enemyDps - rps); //if regen > enemyDps this is negative
//regenerating faster than the base can be damaged
if(timeDestroyBase < 0) continue;
//sector is lost, enemy took too long. //sector is lost, enemy took too long.
if(timeDestroyEnemy > timeDestroyBase){ if(timeDestroyEnemy > timeDestroyBase){
health = 0f; health = 0f;

View File

@@ -323,7 +323,7 @@ public class UnitType extends UnlockableContent{
//suicide enemy //suicide enemy
if(weapons.contains(w -> w.bullet.killShooter)){ if(weapons.contains(w -> w.bullet.killShooter)){
//scale down DPS to be insignificant //scale down DPS to be insignificant
dpsEstimate /= 100f; dpsEstimate /= 40f;
} }
} }
} }