This commit is contained in:
Anuken
2022-10-10 19:23:13 -04:00
parent dea70e9d71
commit 2b62ab6b2f
2 changed files with 2 additions and 2 deletions

View File

@@ -437,7 +437,7 @@ public class Weapon implements Cloneable{
bulletY = mountY + Angles.trnsy(weaponRotation, this.shootX + xOffset + xSpread, this.shootY + yOffset), bulletY = mountY + Angles.trnsy(weaponRotation, this.shootX + xOffset + xSpread, this.shootY + yOffset),
shootAngle = bulletRotation(unit, mount, bulletX, bulletY) + angleOffset, shootAngle = bulletRotation(unit, mount, bulletX, bulletY) + angleOffset,
lifeScl = bullet.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, 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); angle = angleOffset + shootAngle + Mathf.range(inaccuracy + bullet.inaccuracy);
mount.bullet = bullet.create(unit, unit.team, bulletX, bulletY, angle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, mount.aimX, mount.aimY); mount.bullet = bullet.create(unit, unit.team, bulletX, bulletY, angle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, mount.aimX, mount.aimY);
handleBullet(unit, mount, mount.bullet); handleBullet(unit, mount, mount.bullet);

View File

@@ -558,7 +558,7 @@ public class Turret extends ReloadTurret{
xSpread = Mathf.range(xRand), xSpread = Mathf.range(xRand),
bulletX = x + Angles.trnsx(rotation - 90, shootX + xOffset + xSpread, shootY + yOffset), bulletX = x + Angles.trnsx(rotation - 90, shootX + xOffset + xSpread, shootY + yOffset),
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); 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(Mathf.dst(bulletX, bulletY, targetPos.x, targetPos.y) / type.range, minRange / type.range, range() / type.range) : 1f;