Fixed fire not syncing

This commit is contained in:
Anuken 2020-08-25 12:10:16 -04:00
parent 7b2b9b3988
commit 9fc42dec6a
3 changed files with 13 additions and 28 deletions

View File

@ -0,0 +1 @@
{version:1,fields:[{name:lifetime,type:float,size:4},{name:tile,type:mindustry.world.Tile,size:-1},{name:time,type:float,size:4},{name:x,type:float,size:4},{name:y,type:float,size:4}]}

View File

@ -485,7 +485,7 @@ public class UnitTypes implements ContentList{
zenith = new UnitType("zenith"){{ zenith = new UnitType("zenith"){{
health = 700; health = 700;
speed = 1.9f; speed = 1.7f;
accel = 0.04f; accel = 0.04f;
drag = 0.016f; drag = 0.016f;
flying = true; flying = true;
@ -638,7 +638,7 @@ public class UnitTypes implements ContentList{
colors = new Color[]{Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white}; colors = new Color[]{Color.valueOf("ec7458aa"), Color.valueOf("ff9c5a"), Color.white};
}}; }};
}}, }},
new Weapon("missiles-mount"){{ new Weapon("large-artillery"){{
x = 11f; x = 11f;
y = 27f; y = 27f;
rotateSpeed = 2f; rotateSpeed = 2f;
@ -648,7 +648,7 @@ public class UnitTypes implements ContentList{
rotate = true; rotate = true;
recoil = 0.5f; recoil = 0.5f;
bullet = Bullets.pyraFlame; bullet = Bullets.fragPlastic;
}}, }},
new Weapon("large-artillery"){{ new Weapon("large-artillery"){{
y = -13f; y = -13f;
@ -660,28 +660,7 @@ public class UnitTypes implements ContentList{
shootSound = Sounds.shoot; shootSound = Sounds.shoot;
rotate = true; rotate = true;
occlusion = 12f; occlusion = 12f;
bullet = new ArtilleryBulletType(3.2f, 12){{ bullet = Bullets.fragPlastic;
trailMult = 0.8f;
hitEffect = Fx.massiveExplosion;
knockback = 1.5f;
lifetime = 140f;
height = 12f;
width = 12f;
collidesTiles = false;
ammoMultiplier = 4f;
splashDamageRadius = 60f;
splashDamage = 60f;
backColor = Pal.missileYellowBack;
frontColor = Pal.missileYellow;
trailEffect = Fx.artilleryTrail;
trailSize = 6f;
hitShake = 4f;
shootEffect = Fx.shootBig2;
status = StatusEffects.blasted;
statusDuration = 60f;
}};
}}); }});
}}; }};

View File

@ -15,14 +15,14 @@ import static mindustry.Vars.*;
@EntityDef(value = {Firec.class}, pooled = true) @EntityDef(value = {Firec.class}, pooled = true)
@Component(base = true) @Component(base = true)
abstract class FireComp implements Timedc, Posc, Firec{ abstract class FireComp implements Timedc, Posc, Firec, Syncc{
private static final float spreadChance = 0.05f, fireballChance = 0.07f; private static final float spreadChance = 0.05f, fireballChance = 0.07f;
@Import float time, lifetime, x, y; @Import float time, lifetime, x, y;
Tile tile; Tile tile;
private Block block; private transient Block block;
private float baseFlammability = -1, puddleFlammability; private transient float baseFlammability = -1, puddleFlammability;
@Override @Override
public void update(){ public void update(){
@ -99,4 +99,9 @@ abstract class FireComp implements Timedc, Posc, Firec{
public void afterRead(){ public void afterRead(){
Fires.register(base()); Fires.register(base());
} }
@Override
public void afterSync(){
Fires.register(base());
}
} }