Fixed scathe bugs

This commit is contained in:
Anuken 2025-01-12 20:49:06 -05:00
parent f23dd0467f
commit 59e64ab37c
5 changed files with 15 additions and 11 deletions

View File

@ -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");

View File

@ -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;

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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