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:
@@ -3754,6 +3754,7 @@ public class Blocks{
|
|||||||
ammoUseEffect = Fx.casing3Double;
|
ammoUseEffect = Fx.casing3Double;
|
||||||
ammoPerShot = 2;
|
ammoPerShot = 2;
|
||||||
velocityRnd = 0.2f;
|
velocityRnd = 0.2f;
|
||||||
|
scaleLifetimeOffset = 1f / 9f;
|
||||||
recoil = 6f;
|
recoil = 6f;
|
||||||
shake = 2f;
|
shake = 2f;
|
||||||
range = 290f;
|
range = 290f;
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ public class Turret extends ReloadTurret{
|
|||||||
public float inaccuracy = 0f;
|
public float inaccuracy = 0f;
|
||||||
/** Fraction of bullet velocity that is random. */
|
/** Fraction of bullet velocity that is random. */
|
||||||
public float velocityRnd = 0f;
|
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. */
|
/** Maximum angle difference in degrees at which turret will still try to shoot. */
|
||||||
public float shootCone = 8f;
|
public float shootCone = 8f;
|
||||||
/** Turret shoot point. */
|
/** Turret shoot point. */
|
||||||
@@ -640,7 +642,7 @@ public class Turret extends ReloadTurret{
|
|||||||
bulletY = y + Angles.trnsy(rotation - 90, shootX + xOffset + xSpread, shootY + yOffset),
|
bulletY = y + Angles.trnsy(rotation - 90, shootX + xOffset + xSpread, shootY + yOffset),
|
||||||
shootAngle = rotation + angleOffset + Mathf.range(inaccuracy + type.inaccuracy);
|
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?
|
//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);
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user