diff --git a/core/assets/sounds/mineDeploy.ogg b/core/assets/sounds/mineDeploy.ogg new file mode 100644 index 0000000000..69fb5d2f98 Binary files /dev/null and b/core/assets/sounds/mineDeploy.ogg differ diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 811650ef7a..8749c7f4e9 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -1780,6 +1780,7 @@ public class UnitTypes implements ContentList{ shots = 3; shotDelay = 7f; x = y = shootX = shootY = 0f; + shootSound = Sounds.mineDeploy; bullet = new BasicBulletType(){{ sprite = "mine-bullet"; @@ -2150,6 +2151,8 @@ public class UnitTypes implements ContentList{ shootY = 7f; recoil = 4f; cooldownTime = reload - 10f; + //TODO better sound + shootSound = Sounds.laser; bullet = new EmpBulletType(){{ float rad = 100f; @@ -2182,6 +2185,7 @@ public class UnitTypes implements ContentList{ hitShake = 4f; trailRotation = true; status = StatusEffects.electrified; + hitSound = Sounds.plasmaboom; trailEffect = new Effect(16f, e -> { color(Pal.heal); diff --git a/core/src/mindustry/entities/abilities/EnergyFieldAbility.java b/core/src/mindustry/entities/abilities/EnergyFieldAbility.java index 0109128f38..8681e37843 100644 --- a/core/src/mindustry/entities/abilities/EnergyFieldAbility.java +++ b/core/src/mindustry/entities/abilities/EnergyFieldAbility.java @@ -1,6 +1,7 @@ package mindustry.entities.abilities; import arc.*; +import arc.audio.*; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; @@ -19,6 +20,7 @@ public class EnergyFieldAbility extends Ability{ public float damage = 1, reload = 100, range = 60; public Effect healEffect = Fx.heal, hitEffect = Fx.hitLaserBlast, damageEffect = Fx.chainLightning; public StatusEffect status = StatusEffects.electrified; + public Sound shootSound = Sounds.spark; public float statusDuration = 60f * 6f; public float x, y; public boolean hitBuildings = true; @@ -139,6 +141,10 @@ public class EnergyFieldAbility extends Ability{ } } + if(anyNearby){ + shootSound.at(unit); + } + timer = 0f; } } diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 4fb99cf01a..33729c9636 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -249,7 +249,7 @@ public class Weapon implements Cloneable{ unit.vel.add(Tmp.v1.trns(unit.rotation + 180f, mount.bullet.type.recoil)); if(shootSound != Sounds.none && !headless){ if(mount.sound == null) mount.sound = new SoundLoop(shootSound, 1f); - mount.sound.update(x, y, true); + mount.sound.update(bulletX, bulletY, true); } } }else{ @@ -323,6 +323,9 @@ public class Weapon implements Cloneable{ Time.run(sequenceNum * shotDelay + firstShotDelay, () -> { if(!unit.isAdded()) return; mount.bullet = bullet(unit, shootX + unit.x - baseX, shootY + unit.y - baseY, f + Mathf.range(inaccuracy), lifeScl); + if(!continuous){ + shootSound.at(shootX, shootY, Mathf.random(soundPitchMin, soundPitchMax)); + } }); sequenceNum++; });