Fixed missile unit DPS calculation
This commit is contained in:
Binary file not shown.
@@ -3161,6 +3161,8 @@ public class UnitTypes{
|
|||||||
rotationLimit = 70f;
|
rotationLimit = 70f;
|
||||||
rotateSpeed = 2f;
|
rotateSpeed = 2f;
|
||||||
inaccuracy = 20f;
|
inaccuracy = 20f;
|
||||||
|
shootStatus = StatusEffects.slow;
|
||||||
|
alwaysShootWhenMoving = true;
|
||||||
|
|
||||||
rotate = true;
|
rotate = true;
|
||||||
|
|
||||||
|
|||||||
@@ -314,6 +314,10 @@ public class BulletType extends Content implements Cloneable{
|
|||||||
|
|
||||||
/** @return estimated damage per shot. this can be very inaccurate. */
|
/** @return estimated damage per shot. this can be very inaccurate. */
|
||||||
public float estimateDPS(){
|
public float estimateDPS(){
|
||||||
|
if(spawnUnit != null){
|
||||||
|
return spawnUnit.estimateDps();
|
||||||
|
}
|
||||||
|
|
||||||
float sum = damage + splashDamage*0.75f;
|
float sum = damage + splashDamage*0.75f;
|
||||||
if(fragBullet != null && fragBullet != this){
|
if(fragBullet != null && fragBullet != this){
|
||||||
sum += fragBullet.estimateDPS() * fragBullets / 2f;
|
sum += fragBullet.estimateDPS() * fragBullets / 2f;
|
||||||
|
|||||||
@@ -828,6 +828,13 @@ public class UnitType extends UnlockableContent{
|
|||||||
ammoCapacity = Math.max(1, (int)(shotsPerSecond * targetSeconds));
|
ammoCapacity = Math.max(1, (int)(shotsPerSecond * targetSeconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
estimateDps();
|
||||||
|
|
||||||
|
//only do this after everything else was initialized
|
||||||
|
sample = constructor.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public float estimateDps(){
|
||||||
//calculate estimated DPS for one target based on weapons
|
//calculate estimated DPS for one target based on weapons
|
||||||
if(dpsEstimate < 0){
|
if(dpsEstimate < 0){
|
||||||
dpsEstimate = weapons.sumf(Weapon::dps);
|
dpsEstimate = weapons.sumf(Weapon::dps);
|
||||||
@@ -838,9 +845,8 @@ public class UnitType extends UnlockableContent{
|
|||||||
dpsEstimate /= 25f;
|
dpsEstimate /= 25f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//only do this after everything else was initialized
|
return dpsEstimate;
|
||||||
sample = constructor.get();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@CallSuper
|
@CallSuper
|
||||||
|
|||||||
Reference in New Issue
Block a user