diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 282fd46a1c7c..9d2205095799 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -3723,6 +3723,7 @@ Items.plastanium, new ArtilleryBulletType(3.4f, 20, "shell"){{ ammoUseEffect = Fx.casing3Double; ammoPerShot = 2; velocityRnd = 0.2f; + scaleLifetimeOffset = 1f / 9f; recoil = 6f; shake = 2f; range = 290f; diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 8c58f51a633c..ef0ad5f88a48 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -54,6 +54,8 @@ public class Turret extends ReloadTurret{ public float inaccuracy = 0f; /** Fraction of bullet velocity that is random. */ public float velocityRnd = 0f; + /** Fraction of lifetime that is added. */ + public float scaleLifetimeOffset = 0f; /** Maximum angle difference in degrees at which turret will still try to shoot. */ public float shootCone = 8f; /** Turret shoot point. */ @@ -615,7 +617,7 @@ protected void bullet(BulletType type, float xOffset, float yOffset, float angle bulletY = y + Angles.trnsy(rotation - 90, shootX + xOffset + xSpread, shootY + yOffset), shootAngle = rotation + angleOffset + Mathf.range(inaccuracy + type.inaccuracy); - float lifeScl = type.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f; + float lifeScl = type.scaleLife ? Mathf.clamp(((1 + scaleLifetimeOffset) * Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y)) / type.range, minRange / type.range, range() / type.range) : 1f; //TODO aimX / aimY for multi shot turrets? handleBullet(type.create(this, team, bulletX, bulletY, shootAngle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, targetPos.x, targetPos.y), xOffset, yOffset, shootAngle - rotation);