Added scaleLifetimeOffset and Centered Ripple Projectiles (#10292)

* Added scaleLifetimeOffset
Changed ripple to have its shot centered, calculated by: (1 - velocityRnd/2)^-1

* unneccessary parenthesis

* Update Turret.java

one last adjustement, hopefully
This commit is contained in:
SomeonesShade
2025-02-05 02:24:47 +08:00
committed by GitHub
parent fb5945f1e8
commit 0b4a7b3b16
2 changed files with 4 additions and 1 deletions

View File

@@ -3754,6 +3754,7 @@ public class Blocks{
ammoUseEffect = Fx.casing3Double;
ammoPerShot = 2;
velocityRnd = 0.2f;
scaleLifetimeOffset = 1f / 9f;
recoil = 6f;
shake = 2f;
range = 290f;

View File

@@ -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 to bullets with lifeScale. */
public float scaleLifetimeOffset = 0f;
/** Maximum angle difference in degrees at which turret will still try to shoot. */
public float shootCone = 8f;
/** Turret shoot point. */
@@ -640,7 +642,7 @@ public class Turret extends ReloadTurret{
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);