diff --git a/core/assets/sounds/laserbolt.ogg b/core/assets/sounds/laserbolt.ogg new file mode 100644 index 0000000000..ba034545dd Binary files /dev/null and b/core/assets/sounds/laserbolt.ogg differ diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 90d83fb036..1e67543989 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -2392,14 +2392,22 @@ public class UnitTypes{ x = 2.75f; y = 1f; top = false; - ejectEffect = Fx.casing1; - bullet = new BasicBulletType(2.5f, 11){{ - width = 7f; - height = 9f; + bullet = new LaserBoltBulletType(2.5f, 11){{ + shootSound = Sounds.laserbolt; + keepVelocity = false; + width = 1.5f; + height = 4.5f; + hitEffect = despawnEffect = Fx.hitBulletColor; + trailWidth = 1.2f; + trailLength = 3; + shootEffect = Fx.shootSmallColor; + smokeEffect = Fx.hitLaserColor; + backColor = trailColor = Pal.yellowBoltFront; + hitColor = Pal.yellowBoltFront; + frontColor = Color.white; + lifetime = 60f; - shootEffect = Fx.shootSmall; - smokeEffect = Fx.shootSmallSmoke; buildingDamageMultiplier = 0.01f; }}; }}); @@ -2434,14 +2442,22 @@ public class UnitTypes{ rotate = true; shoot.shots = 2; shoot.shotDelay = 4f; - ejectEffect = Fx.casing1; - bullet = new BasicBulletType(3f, 11){{ - width = 7f; - height = 9f; + bullet = new LaserBoltBulletType(3f, 11){{ + shootSound = Sounds.laserbolt; + keepVelocity = false; + width = 1.5f; + height = 4.5f; + hitEffect = despawnEffect = Fx.hitBulletColor; + trailWidth = 1.2f; + trailLength = 3; + shootEffect = Fx.shootSmallColor; + smokeEffect = Fx.hitLaserColor; + backColor = trailColor = Pal.yellowBoltFront; + hitColor = Pal.yellowBoltFront; + frontColor = Color.white; + lifetime = 60f; - shootEffect = Fx.shootSmall; - smokeEffect = Fx.shootSmallSmoke; buildingDamageMultiplier = 0.01f; }}; }}); @@ -2479,14 +2495,22 @@ public class UnitTypes{ }}; inaccuracy = 3f; - ejectEffect = Fx.casing1; - bullet = new BasicBulletType(3.5f, 11){{ - width = 6.5f; - height = 11f; + bullet = new LaserBoltBulletType(3.5f, 11){{ + shootSound = Sounds.laserbolt; + keepVelocity = false; + width = 1.5f; + height = 5f; + hitEffect = despawnEffect = Fx.hitBulletColor; + trailWidth = 1.2f; + trailLength = 4; + shootEffect = Fx.shootSmallColor; + smokeEffect = Fx.hitLaserColor; + backColor = trailColor = Pal.yellowBoltFront; + hitColor = Pal.yellowBoltFront; + frontColor = Color.white; + lifetime = 70f; - shootEffect = Fx.shootSmall; - smokeEffect = Fx.shootSmallSmoke; buildingDamageMultiplier = 0.01f; homingPower = 0.04f; }}; @@ -2799,7 +2823,7 @@ public class UnitTypes{ rotateSpeed = 0.8f; floorMultiplier = 0.3f; immunities.addAll(StatusEffects.burning, StatusEffects.melting); - + float xo = 231f/2f, yo = 231f/2f; treadRects = new Rect[]{new Rect(27 - xo, 152 - yo, 56, 73), new Rect(24 - xo, 51 - 9 - yo, 29, 17), new Rect(59 - xo, 18 - 9 - yo, 39, 19)}; diff --git a/core/src/mindustry/graphics/Pal.java b/core/src/mindustry/graphics/Pal.java index 4a9af6d162..9722bf7594 100644 --- a/core/src/mindustry/graphics/Pal.java +++ b/core/src/mindustry/graphics/Pal.java @@ -72,6 +72,7 @@ public class Pal{ stoneGray = Color.valueOf("8f8f8f"), engine = Color.valueOf("ffbb64"), + yellowBoltFront = Color.valueOf("ffd27e"), health = Color.valueOf("ff341c"), heal = Color.valueOf("98ffa9"), bar = Color.slate, diff --git a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java index a41daf317e..b6c7510349 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/BaseTurret.java @@ -47,9 +47,24 @@ public class BaseTurret extends Block{ coolant = findConsumer(c -> c instanceof ConsumeCoolant); } - //just makes things a little more convenient + checkInitCoolant(); + + if(!disableOverlapCheck){ + placeOverlapRange = Math.max(placeOverlapRange, range + placeOverlapMargin); + } + fogRadius = Math.max(Mathf.round(range / tilesize * fogRadiusMultiplier), fogRadius); + super.init(); + } + + @Override + public void reinitializeConsumers(){ + checkInitCoolant(); + + super.reinitializeConsumers(); + } + + void checkInitCoolant(){ if(coolant != null){ - //TODO coolant fix coolant.update = false; coolant.booster = true; coolant.optional = true; @@ -57,12 +72,6 @@ public class BaseTurret extends Block{ //json parsing does not add to consumes if(!hasConsumer(coolant)) consume(coolant); } - - if(!disableOverlapCheck){ - placeOverlapRange = Math.max(placeOverlapRange, range + placeOverlapMargin); - } - fogRadius = Math.max(Mathf.round(range / tilesize * fogRadiusMultiplier), fogRadius); - super.init(); } @Override