diff --git a/core/src/mindustry/world/blocks/defense/turrets/ChargeTurret.java b/core/src/mindustry/world/blocks/defense/turrets/ChargeTurret.java index 3680cce446..15feaf0379 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/ChargeTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/ChargeTurret.java @@ -1,10 +1,13 @@ package mindustry.world.blocks.defense.turrets; +import arc.audio.*; import arc.math.*; import arc.util.*; import mindustry.content.*; import mindustry.entities.*; import mindustry.entities.bullet.*; +import mindustry.type.*; +import mindustry.gen.*; import static mindustry.Vars.*; @@ -14,6 +17,7 @@ public class ChargeTurret extends PowerTurret{ public float chargeMaxDelay = 10f; public Effect chargeEffect = Fx.none; public Effect chargeBeginEffect = Fx.none; + public Sound chargeSound = Sounds.none; public ChargeTurret(String name){ super(name); @@ -28,7 +32,8 @@ public class ChargeTurret extends PowerTurret{ tr.trns(rotation, size * tilesize / 2f); chargeBeginEffect.at(x + tr.x, y + tr.y, rotation); - + chargeSound.at(x + tr.x, y + tr.y, 1); + for(int i = 0; i < chargeEffects; i++){ Time.run(Mathf.random(chargeMaxDelay), () -> { if(!isValid()) return; diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index c535f27135..411ee782ec 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -434,7 +434,7 @@ public abstract class Turret extends Block{ fshootEffect.at(x + tr.x, y + tr.y, rotation); fsmokeEffect.at(x + tr.x, y + tr.y, rotation); - shootSound.at(tile, Mathf.random(0.9f, 1.1f)); + shootSound.at(x + tr.x, y + tr.y, Mathf.random(0.9f, 1.1f)); if(shootShake > 0){ Effect.shake(shootShake, shootShake, this);