Sector damage calculation fix
This commit is contained in:
@@ -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){
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user