diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 7a3467876f..1abe026850 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2261,7 +2261,7 @@ public class UnitTypes{ bullet = new EmpBulletType(){{ float rad = 100f; - scaleVelocity = true; + scaleLife = true; lightOpacity = 0.7f; unitDamageScl = 0.8f; healPercent = 20f; diff --git a/core/src/mindustry/entities/bullet/ArtilleryBulletType.java b/core/src/mindustry/entities/bullet/ArtilleryBulletType.java index 79415b6470..08749c1803 100644 --- a/core/src/mindustry/entities/bullet/ArtilleryBulletType.java +++ b/core/src/mindustry/entities/bullet/ArtilleryBulletType.java @@ -13,7 +13,7 @@ public class ArtilleryBulletType extends BasicBulletType{ collidesTiles = false; collides = false; collidesAir = false; - scaleVelocity = true; + scaleLife = true; hitShake = 1f; hitSound = Sounds.explosion; hitEffect = Fx.flakExplosion; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 56ea9cf113..d30861886b 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -111,7 +111,7 @@ public class BulletType extends Content implements Cloneable{ /** Whether velocity is inherited from the shooter. */ public boolean keepVelocity = true; /** Whether to scale lifetime (not actually velocity!) to disappear at the target position. Used for artillery. */ - public boolean scaleVelocity; + public boolean scaleLife; /** Whether this bullet can be hit by point defense. */ public boolean hittable = true; /** Whether this bullet can be reflected. */ diff --git a/core/src/mindustry/entities/bullet/PointBulletType.java b/core/src/mindustry/entities/bullet/PointBulletType.java index 920e6e5b51..a4fe032b52 100644 --- a/core/src/mindustry/entities/bullet/PointBulletType.java +++ b/core/src/mindustry/entities/bullet/PointBulletType.java @@ -13,7 +13,7 @@ public class PointBulletType extends BulletType{ public float trailSpacing = 10f; public PointBulletType(){ - scaleVelocity = true; + scaleLife = true; lifetime = 100f; collides = false; keepVelocity = false; diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index bd93efcdc2..d72a5ea3f3 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -399,7 +399,7 @@ public class Weapon implements Cloneable{ bulletX = mountX + Angles.trnsx(weaponRotation, this.shootX + xOffset, this.shootY + yOffset), bulletY = mountY + Angles.trnsy(weaponRotation, this.shootX + xOffset, this.shootY + yOffset), shootAngle = bulletRotation(unit, mount, bulletX, bulletY) + angleOffset, - lifeScl = bullet.scaleVelocity ? Mathf.clamp(Mathf.dst(shootX, shootY, mount.aimX, mount.aimY) / bullet.range) : 1f, + lifeScl = bullet.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, mount.aimX, mount.aimY) / bullet.range) : 1f, angle = angleOffset + shootAngle + Mathf.range(inaccuracy); mount.bullet = bullet.create(unit, unit.team, bulletX, bulletY, angle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, mount.aimX, mount.aimY); diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index a205b4746c..f3af5b0df0 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -500,7 +500,7 @@ public class Turret extends ReloadTurret{ bulletY = y + Angles.trnsy(rotation - 90, shootX + xOffset, shootY + yOffset), shootAngle = rotation + angleOffset + Mathf.range(inaccuracy); - float lifeScl = type.scaleVelocity ? 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(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 + Mathf.range(velocityInaccuracy), lifeScl, null, mover, targetPos.x, targetPos.y), xOffset, yOffset, angleOffset);