diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 013497374f..7bc14ddaa6 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -4749,8 +4749,10 @@ public class Blocks{ scathe = new ItemTurret("scathe"){{ requirements(Category.turret, with(Items.silicon, 450, Items.graphite, 400, Items.tungsten, 500, Items.oxide, 100, Items.carbide, 200)); + predictTarget = false; + ammo( - Items.carbide, new BulletType(){{ + Items.carbide, new BulletType(0f, 0f){{ shootEffect = Fx.shootBig; smokeEffect = Fx.shootSmokeMissileColor; hitColor = Pal.redLight; @@ -4837,7 +4839,7 @@ public class Blocks{ }}, //TODO - needs balancing - Items.phaseFabric, new BulletType(){{ + Items.phaseFabric, new BulletType(0f, 0f){{ shootEffect = Fx.shootBig; smokeEffect = Fx.shootSmokeMissileColor; hitColor = Color.valueOf("ffd37f"); @@ -4927,7 +4929,7 @@ public class Blocks{ }}; }}, - Items.surgeAlloy, new BulletType(){{ + Items.surgeAlloy, new BulletType(0f, 0f){{ shootEffect = Fx.shootBig; smokeEffect = Fx.shootSmokeMissileColor; hitColor = Color.valueOf("f7e97e"); diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index a4ad4fff13..f5d9b5962c 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -754,15 +754,15 @@ public class BulletType extends Content implements Cloneable{ } public @Nullable Bullet create(Bullet parent, float x, float y, float angle){ - return create(parent.owner, parent.team, x, y, angle); + return create(parent.owner, parent.shooter, parent.team, x, y, angle, -1, 1f, 1f, null, null, -1f, -1f); } public @Nullable Bullet create(Bullet parent, float x, float y, float angle, float velocityScl, float lifeScale){ - return create(parent.owner, parent.team, x, y, angle, velocityScl, lifeScale); + return create(parent.owner, parent.shooter, parent.team, x, y, angle, -1, velocityScl, lifeScale, null, null, -1f, -1f); } public @Nullable Bullet create(Bullet parent, float x, float y, float angle, float velocityScl){ - return create(parent.owner(), parent.team, x, y, angle, velocityScl); + return create(parent.owner, parent.shooter, parent.team, x, y, angle, -1, velocityScl, 1f, null, null, -1f, -1f); } public @Nullable Bullet create(@Nullable Entityc owner, Team team, float x, float y, float angle, float damage, float velocityScl, float lifetimeScl, Object data){ @@ -819,7 +819,8 @@ public class BulletType extends Content implements Cloneable{ Bullet bullet = Bullet.create(); bullet.type = this; - bullet.owner = shooter == null ? owner : shooter; + bullet.owner = owner; + bullet.shooter = (shooter == null ? owner : shooter); bullet.team = team; bullet.time = 0f; bullet.originX = x; diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index d9c3aef000..35916e43f9 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -39,6 +39,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw //setting this variable to true prevents lifetime from decreasing for a frame. transient boolean keepAlive; + transient Entityc shooter; transient @Nullable Tile aimTile; transient float aimX, aimY; transient float originX, originY; @@ -248,7 +249,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw type.draw(self()); type.drawLight(self()); - + Draw.reset(); } diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 183cf78743..e56be0378a 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -359,8 +359,8 @@ public class Turret extends ReloadTurret{ offset.set(h.deltaX(), h.deltaY()).scl(shoot.firstShotDelay / Time.delta); } - if(predictTarget){ - targetPos.set(Predict.intercept(this, pos, offset.x, offset.y, bullet.speed <= 0.01f ? 99999999f : bullet.speed)); + if(predictTarget && bullet.speed >= 0.01f){ + targetPos.set(Predict.intercept(this, pos, offset.x, offset.y, bullet.speed)); }else{ targetPos.set(pos); } diff --git a/gradle.properties b/gradle.properties index c0897d5b42..c5d42ecc57 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,4 +26,4 @@ org.gradle.caching=true org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 android.enableR8.fullMode=false -archash=9dd4c1ee65 +archash=4940b68158