too many things to list

This commit is contained in:
Anuken
2020-10-15 13:44:20 -04:00
parent fb0179da95
commit 86c2fe8805
52 changed files with 665 additions and 117 deletions

View File

@@ -137,6 +137,15 @@ public abstract class BulletType extends Content{
this(1f, 1f);
}
/** @return estimated damage per shot. this can be very inaccurate. */
public float estimateDPS(){
float sum = damage + splashDamage*0.75f;
if(fragBullet != null && fragBullet != this){
sum += fragBullet.estimateDPS() * fragBullets / 2f;
}
return sum;
}
/** Returns maximum distance the bullet this bullet type has can travel. */
public float range(){
return Math.max(speed * lifetime * (1f - drag), range);

View File

@@ -44,6 +44,12 @@ public class ContinuousLaserBulletType extends BulletType{
this(0);
}
@Override
public float estimateDPS(){
//assume firing duration is about 100 by default, may not be accurate there's no way of knowing in this method
return damage * 100f / 5f;
}
@Override
public float range(){
return length;

View File

@@ -88,6 +88,8 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
case rotation -> rotation;
case health -> health;
case maxHealth -> maxHealth;
case ammo -> state.rules.unitAmmo ? type.ammoCapacity : ammo;
case ammoCapacity -> type.ammoCapacity;
case x -> x;
case y -> y;
case team -> team.id;

View File

@@ -166,7 +166,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc, Velc, Statusc{
Weapon weapon = mount.weapon;
float baseX = this.x, baseY = this.y;
boolean delay = weapon.firstShotDelay > 0f;
boolean delay = weapon.firstShotDelay + weapon.shotDelay > 0f;
(delay ? weapon.chargeSound : weapon.shootSound).at(x, y, Mathf.random(0.8f, 1.0f));