diff --git a/core/assets/contributors b/core/assets/contributors index 3653fb05c7..4d8c2faf6b 100644 --- a/core/assets/contributors +++ b/core/assets/contributors @@ -97,4 +97,6 @@ PetrGasparik LeoDog896 Summet jalastram (freesound.org) -newlocknew (freesound.org) \ No newline at end of file +newlocknew (freesound.org) +dsmolenaers (freesound.org) +Headphaze (freesound.org) \ No newline at end of file diff --git a/core/assets/sounds/bang.ogg b/core/assets/sounds/bang.ogg index afbd099e6f..29cde62552 100644 Binary files a/core/assets/sounds/bang.ogg and b/core/assets/sounds/bang.ogg differ diff --git a/core/assets/sounds/boom.ogg b/core/assets/sounds/boom.ogg index 4cce577fe9..19f41d80b2 100644 Binary files a/core/assets/sounds/boom.ogg and b/core/assets/sounds/boom.ogg differ diff --git a/core/assets/sounds/combustion.ogg b/core/assets/sounds/combustion.ogg new file mode 100644 index 0000000000..6aab153a47 Binary files /dev/null and b/core/assets/sounds/combustion.ogg differ diff --git a/core/assets/sounds/cutter.ogg b/core/assets/sounds/cutter.ogg new file mode 100644 index 0000000000..313159006e Binary files /dev/null and b/core/assets/sounds/cutter.ogg differ diff --git a/core/assets/sounds/drill.ogg b/core/assets/sounds/drill.ogg index 6aab153a47..f21898b646 100644 Binary files a/core/assets/sounds/drill.ogg and b/core/assets/sounds/drill.ogg differ diff --git a/core/assets/sounds/empty.ogg b/core/assets/sounds/empty.ogg deleted file mode 100644 index 6c7ecbe8e0..0000000000 Binary files a/core/assets/sounds/empty.ogg and /dev/null differ diff --git a/core/assets/sounds/hum.ogg b/core/assets/sounds/hum.ogg new file mode 100644 index 0000000000..184504f3dd Binary files /dev/null and b/core/assets/sounds/hum.ogg differ diff --git a/core/assets/sounds/pew.ogg b/core/assets/sounds/pew.ogg index 207b69d389..eb960f5537 100644 Binary files a/core/assets/sounds/pew.ogg and b/core/assets/sounds/pew.ogg differ diff --git a/core/assets/sounds/pulse.ogg b/core/assets/sounds/pulse.ogg new file mode 100644 index 0000000000..6c135c8a07 Binary files /dev/null and b/core/assets/sounds/pulse.ogg differ diff --git a/core/assets/sounds/railgun.ogg b/core/assets/sounds/railgun.ogg new file mode 100644 index 0000000000..d8de298916 Binary files /dev/null and b/core/assets/sounds/railgun.ogg differ diff --git a/core/assets/sounds/sap.ogg b/core/assets/sounds/sap.ogg new file mode 100644 index 0000000000..d84c282d02 Binary files /dev/null and b/core/assets/sounds/sap.ogg differ diff --git a/core/assets/sounds/smelter.ogg b/core/assets/sounds/smelter.ogg new file mode 100644 index 0000000000..86bbaf63de Binary files /dev/null and b/core/assets/sounds/smelter.ogg differ diff --git a/core/assets/sounds/spray.ogg b/core/assets/sounds/spray.ogg index 7bddeb6685..b781d106db 100644 Binary files a/core/assets/sounds/spray.ogg and b/core/assets/sounds/spray.ogg differ diff --git a/core/assets/sounds/techloop.ogg b/core/assets/sounds/techloop.ogg index 6ac0d990a4..125ac36718 100644 Binary files a/core/assets/sounds/techloop.ogg and b/core/assets/sounds/techloop.ogg differ diff --git a/core/assets/sounds/wind2.ogg b/core/assets/sounds/wind2.ogg new file mode 100644 index 0000000000..3900ba35a1 Binary files /dev/null and b/core/assets/sounds/wind2.ogg differ diff --git a/core/assets/sounds/windhowl.ogg b/core/assets/sounds/windhowl.ogg new file mode 100644 index 0000000000..de7526a616 Binary files /dev/null and b/core/assets/sounds/windhowl.ogg differ diff --git a/core/src/mindustry/audio/LoopControl.java b/core/src/mindustry/audio/LoopControl.java index 65e3789463..56f06d9e1b 100644 --- a/core/src/mindustry/audio/LoopControl.java +++ b/core/src/mindustry/audio/LoopControl.java @@ -31,12 +31,12 @@ public class LoopControl{ boolean play = data.curVolume > 0.01f; float pan = Mathf.zero(data.total, 0.0001f) ? 0f : sound.calcPan(data.sum.x / data.total, data.sum.y / data.total); - if(data.soundID <= 0){ + if(data.soundID <= 0 || !sound.isPlaying(data.soundID)){ if(play){ data.soundID = sound.loop(data.curVolume, 1f, pan); } }else{ - if(data.curVolume <= 0.01f){ + if(data.curVolume <= 0.001f){ sound.stop(); data.soundID = -1; return; diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index e894530330..89304f1289 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1163,6 +1163,9 @@ public class Blocks implements ContentList{ requirements(Category.power, with(Items.copper, 25, Items.lead, 15)); powerProduction = 1f; itemDuration = 120f; + + ambientSound = Sounds.smelter; + ambientSoundVolume = 0.03f; }}; thermalGenerator = new ThermalGenerator("thermal-generator"){{ @@ -1171,6 +1174,8 @@ public class Blocks implements ContentList{ generateEffect = Fx.redgeneratespark; size = 2; floating = true; + ambientSound = Sounds.hum; + ambientSoundVolume = 0.04f; }}; steamGenerator = new BurnerGenerator("steam-generator"){{ @@ -1180,6 +1185,9 @@ public class Blocks implements ContentList{ consumes.liquid(Liquids.water, 0.1f); hasLiquids = true; size = 2; + + ambientSound = Sounds.smelter; + ambientSoundVolume = 0.05f; }}; differentialGenerator = new SingleTypeGenerator("differential-generator"){{ @@ -1216,6 +1224,8 @@ public class Blocks implements ContentList{ thoriumReactor = new NuclearReactor("thorium-reactor"){{ requirements(Category.power, with(Items.lead, 300, Items.silicon, 200, Items.graphite, 150, Items.thorium, 150, Items.metaglass, 50)); + ambientSound = Sounds.hum; + ambientSoundVolume = 0.16f; size = 3; health = 700; itemDuration = 360f; @@ -1231,6 +1241,9 @@ public class Blocks implements ContentList{ health = 900; powerProduction = 130f; itemDuration = 140f; + ambientSound = Sounds.pulse; + ambientSoundVolume = 0.2f; + consumes.power(25f); consumes.item(Items.blastCompound); consumes.liquid(Liquids.cryofluid, 0.25f); @@ -1491,7 +1504,6 @@ public class Blocks implements ContentList{ shootEffect = Fx.shootLiquid; range = 110f; health = 250 * size * size; - shootSound = Sounds.splash; }}; lancer = new ChargeTurret("lancer"){{ @@ -1639,7 +1651,6 @@ public class Blocks implements ContentList{ shootEffect = Fx.shootLiquid; range = 190f; health = 250 * size * size; - shootSound = Sounds.splash; }}; fuse = new ItemTurret("fuse"){{ @@ -1759,7 +1770,7 @@ public class Blocks implements ContentList{ shots = 1; size = 4; shootCone = 2f; - shootSound = Sounds.shootBig; + shootSound = Sounds.railgun; unitSort = (u, x, y) -> -u.maxHealth; coolantMultiplier = 0.11f; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 6a830d6ef9..8592381131 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -287,6 +287,8 @@ public class UnitTypes implements ContentList{ alternate = false; ejectEffect = Fx.none; recoil = 2f; + shootSound = Sounds.lasershoot; + bullet = new LaserBoltBulletType(5.2f, 14){{ healPercent = 5f; collidesTeam = true; @@ -328,7 +330,7 @@ public class UnitTypes implements ContentList{ spacing = 0f; ejectEffect = Fx.none; recoil = 2.5f; - shootSound = Sounds.pew; + shootSound = Sounds.spark; bullet = new LightningBulletType(){{ lightningColor = hitColor = Pal.heal; @@ -636,7 +638,7 @@ public class UnitTypes implements ContentList{ ejectEffect = Fx.none; recoil = 2f; rotate = true; - shootSound = Sounds.flame; + shootSound = Sounds.sap; x = 8.5f; y = -1.5f; @@ -659,6 +661,7 @@ public class UnitTypes implements ContentList{ rotate = true; x = 4f; y = 3f; + shootSound = Sounds.sap; bullet = new SapBulletType(){{ sapStrength = 0.8f; @@ -723,6 +726,7 @@ public class UnitTypes implements ContentList{ y = 8f; rotate = true; bullet = sapper; + shootSound = Sounds.sap; }}, new Weapon("spiroct-weapon"){{ reload = 15f; @@ -730,6 +734,7 @@ public class UnitTypes implements ContentList{ y = 6f; rotate = true; bullet = sapper; + shootSound = Sounds.sap; }}, new Weapon("spiroct-weapon"){{ reload = 23f; @@ -737,6 +742,7 @@ public class UnitTypes implements ContentList{ y = 0f; rotate = true; bullet = sapper; + shootSound = Sounds.sap; }}, new Weapon("large-purple-mount"){{ y = -7f; @@ -746,7 +752,7 @@ public class UnitTypes implements ContentList{ shake = 3f; rotateSpeed = 2f; ejectEffect = Fx.casing1; - shootSound = Sounds.shootBig; + shootSound = Sounds.artillery; rotate = true; occlusion = 8f; recoil = 3f; @@ -844,7 +850,7 @@ public class UnitTypes implements ContentList{ recoil = 10f; rotateSpeed = 1f; ejectEffect = Fx.casing3; - shootSound = Sounds.shootBig; + shootSound = Sounds.artillery; rotate = true; occlusion = 30f; @@ -1663,6 +1669,7 @@ public class UnitTypes implements ContentList{ shake = 6f; recoil = 10.5f; occlusion = 50f; + shootSound = Sounds.railgun; shots = 1; ejectEffect = Fx.none; diff --git a/core/src/mindustry/content/Weathers.java b/core/src/mindustry/content/Weathers.java index 112417b1f3..f719aa0cea 100644 --- a/core/src/mindustry/content/Weathers.java +++ b/core/src/mindustry/content/Weathers.java @@ -24,6 +24,12 @@ public class Weathers implements ContentList{ sizeMin = 2.6f; density = 1200f; attrs.set(Attribute.light, -0.15f); + + sound = Sounds.windhowl; + soundVol = 0f; + soundVolOscMag = 1.5f; + soundVolOscScl = 1100f; + soundVolMin = 0.02f; }}; rain = new RainWeather("rain"){{ @@ -31,7 +37,7 @@ public class Weathers implements ContentList{ attrs.set(Attribute.water, 0.2f); status = StatusEffects.wet; sound = Sounds.rain; - soundVolume = 0.25f; + soundVol = 0.25f; }}; sandstorm = new ParticleWeather("sandstorm"){{ @@ -50,7 +56,7 @@ public class Weathers implements ContentList{ opacityMultiplier = 0.8f; force = 0.1f; sound = Sounds.wind; - soundVolume = 0.3f; + soundVol = 0.3f; }}; sporestorm = new ParticleWeather("sporestorm"){{ @@ -71,7 +77,7 @@ public class Weathers implements ContentList{ opacityMultiplier = 0.85f; force = 0.1f; sound = Sounds.wind; - soundVolume = 0.3f; + soundVol = 0.3f; }}; fog = new ParticleWeather("fog"){{ diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index acadd51df7..6e6592e42f 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -476,10 +476,6 @@ public class Control implements ApplicationListener, Loadable{ dialog.show(); })); } - - if(android){ - Sounds.empty.loop(0f, 1f, 0f); - } } @Override diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 3f7db0e3ee..2d78be6229 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -207,7 +207,7 @@ public abstract class BulletType extends Content{ Damage.createIncend(x, y, incendSpread, incendAmount); } - if(splashDamageRadius > 0){ + if(splashDamageRadius > 0 && !b.absorbed){ Damage.damage(b.team, x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), collidesAir, collidesGround); if(status != StatusEffects.none){ diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index 15792f0993..23f0175867 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -781,7 +781,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } /** @return whether this block should play its idle sound.*/ - public boolean shouldIdleSound(){ + public boolean shouldAmbientSound(){ return shouldConsume(); } @@ -1226,6 +1226,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } + /** @return ambient sound volume scale. */ + public float ambientVolume(){ + return efficiency(); + } + //endregion //region overrides @@ -1367,8 +1372,8 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, sound.update(x, y, shouldActiveSound()); } - if(block.ambientSound != Sounds.none && shouldIdleSound()){ - loops.play(block.ambientSound, self(), block.ambientSoundVolume); + if(block.ambientSound != Sounds.none && shouldAmbientSound()){ + loops.play(block.ambientSound, self(), block.ambientSoundVolume * ambientVolume()); } if(enabled || !block.noUpdateDisabled){ diff --git a/core/src/mindustry/entities/comp/BulletComp.java b/core/src/mindustry/entities/comp/BulletComp.java index fc8d8ff12b..ba6deb6f24 100644 --- a/core/src/mindustry/entities/comp/BulletComp.java +++ b/core/src/mindustry/entities/comp/BulletComp.java @@ -30,6 +30,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw Object data; BulletType type; float fdata; + transient boolean absorbed; @Override public void getCollisions(Cons consumer){ @@ -67,6 +68,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw @Override public void absorb(){ + absorbed = true; remove(); } diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index 32356ff838..dce9953e98 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -12,8 +12,6 @@ import mindustry.gen.*; import mindustry.type.*; import mindustry.world.*; -import java.io.*; - import static mindustry.Vars.*; import static mindustry.game.EventType.*; @@ -450,111 +448,11 @@ public class Administration{ @SuppressWarnings("unchecked") private void load(){ - if(!loadLegacy()){ - //load default data - playerInfo = Core.settings.getJson("player-data", ObjectMap.class, ObjectMap::new); - bannedIPs = Core.settings.getJson("ip-bans", Seq.class, Seq::new); - whitelist = Core.settings.getJson("whitelist-ids", Seq.class, Seq::new); - subnetBans = Core.settings.getJson("banned-subnets", Seq.class, Seq::new); - }else{ - //save over loaded legacy data - save(); - Log.info("Loaded legacy (5.0) server data."); - } - } - - private boolean loadLegacy(){ - try{ - byte[] info = Core.settings.getBytes("player-info"); - byte[] ips = Core.settings.getBytes("banned-ips"); - byte[] whitelist = Core.settings.getBytes("whitelisted"); - byte[] subnet = Core.settings.getBytes("subnet-bans"); - - if(info != null){ - DataInputStream d = new DataInputStream(new ByteArrayInputStream(info)); - int size = d.readInt(); - if(size != 0){ - d.readUTF(); - d.readUTF(); - - for(int i = 0; i < size; i++){ - String mapKey = d.readUTF(); - - PlayerInfo data = new PlayerInfo(); - - data.id = d.readUTF(); - data.lastName = d.readUTF(); - data.lastIP = d.readUTF(); - int ipsize = d.readInt(); - if(ipsize != 0){ - d.readUTF(); - for(int j = 0; j < ipsize; j++){ - data.ips.add(d.readUTF()); - } - } - - int namesize = d.readInt(); - if(namesize != 0){ - d.readUTF(); - for(int j = 0; j < ipsize; j++){ - data.names.add(d.readUTF()); - } - } - //ips, names... - data.adminUsid = d.readUTF(); - data.timesKicked = d.readInt(); - data.timesJoined = d.readInt(); - data.banned = d.readBoolean(); - data.admin = d.readBoolean(); - data.lastKicked = d.readLong(); - - playerInfo.put(mapKey, data); - } - } - Core.settings.remove("player-info"); - } - - if(ips != null){ - DataInputStream d = new DataInputStream(new ByteArrayInputStream(ips)); - int size = d.readInt(); - if(size != 0){ - d.readUTF(); - for(int i = 0; i < size; i++){ - bannedIPs.add(d.readUTF()); - } - } - Core.settings.remove("banned-ips"); - } - - if(whitelist != null){ - DataInputStream d = new DataInputStream(new ByteArrayInputStream(whitelist)); - int size = d.readInt(); - if(size != 0){ - d.readUTF(); - for(int i = 0; i < size; i++){ - this.whitelist.add(d.readUTF()); - } - } - Core.settings.remove("whitelisted"); - } - - if(subnet != null){ - DataInputStream d = new DataInputStream(new ByteArrayInputStream(subnet)); - int size = d.readInt(); - if(size != 0){ - d.readUTF(); - for(int i = 0; i < size; i++){ - subnetBans.add(d.readUTF()); - } - } - Core.settings.remove("subnet-bans"); - } - - return info != null || ips != null || whitelist != null || subnet != null; - }catch(Throwable e){ - e.printStackTrace(); - } - return false; + //load default data + playerInfo = Core.settings.getJson("player-data", ObjectMap.class, ObjectMap::new); + bannedIPs = Core.settings.getJson("ip-bans", Seq.class, Seq::new); + whitelist = Core.settings.getJson("whitelist-ids", Seq.class, Seq::new); + subnetBans = Core.settings.getJson("banned-subnets", Seq.class, Seq::new); } /** Server configuration definition. Each config value can be a string, boolean or number. */ @@ -585,8 +483,7 @@ public class Administration{ autosaveAmount("The maximum amount of autosaves. Older ones get replaced.", 10), autosaveSpacing("Spacing between autosaves in seconds.", 60 * 5), debug("Enable debug logging", false, () -> { - LogLevel level = debug() ? LogLevel.debug : LogLevel.info; - Log.level = level; + Log.level = debug() ? LogLevel.debug : LogLevel.info; }); public static final Config[] all = values(); diff --git a/core/src/mindustry/type/Weather.java b/core/src/mindustry/type/Weather.java index 0a1670a256..ed6145ceae 100644 --- a/core/src/mindustry/type/Weather.java +++ b/core/src/mindustry/type/Weather.java @@ -25,8 +25,8 @@ public abstract class Weather extends UnlockableContent{ public float opacityMultiplier = 1f; public Attributes attrs = new Attributes(); public Sound sound = Sounds.none; - public float soundVolume = 0.1f; - public float soundVolumeOscMag = 0f, soundVolumeOscScl = 20f; + public float soundVol = 0.1f, soundVolMin = 0f; + public float soundVolOscMag = 0f, soundVolOscScl = 20f; //internals public Rand rand = new Rand(); @@ -90,8 +90,8 @@ public abstract class Weather extends UnlockableContent{ } if(sound != Sounds.none){ - float noise = soundVolumeOscMag > 0 ? (float)Math.abs(Noise.rawNoise(Time.time() / soundVolumeOscScl)) * soundVolumeOscMag : 0; - loops.play(sound, Core.camera.position, (soundVolume + noise) * state.opacity); + float noise = soundVolOscMag > 0 ? (float)Math.abs(Noise.rawNoise(Time.time() / soundVolOscScl)) * soundVolOscMag : 0; + loops.play(sound, Core.camera.position, Math.max((soundVol + noise) * state.opacity, soundVolMin)); } } diff --git a/core/src/mindustry/world/blocks/defense/ForceProjector.java b/core/src/mindustry/world/blocks/defense/ForceProjector.java index e13b7d4345..078bc02807 100644 --- a/core/src/mindustry/world/blocks/defense/ForceProjector.java +++ b/core/src/mindustry/world/blocks/defense/ForceProjector.java @@ -110,7 +110,7 @@ public class ForceProjector extends Block{ } @Override - public boolean shouldIdleSound(){ + public boolean shouldAmbientSound(){ return !broken && realRadius() > 1f; } diff --git a/core/src/mindustry/world/blocks/defense/turrets/PointDefenseTurret.java b/core/src/mindustry/world/blocks/defense/turrets/PointDefenseTurret.java index 0184f9ff7a..6ee0f1ddba 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/PointDefenseTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/PointDefenseTurret.java @@ -1,5 +1,6 @@ package mindustry.world.blocks.defense.turrets; +import arc.audio.*; import arc.graphics.*; import arc.graphics.g2d.*; import arc.math.*; @@ -24,6 +25,8 @@ public class PointDefenseTurret extends ReloadTurret{ public Effect hitEffect = Fx.pointHit; public Effect shootEffect = Fx.sparkShoot; + public Sound shootSound = Sounds.lasershoot; + public float shootCone = 5f; public float bulletDamage = 10f; public float shootLength = 3f; @@ -90,6 +93,7 @@ public class PointDefenseTurret extends ReloadTurret{ beamEffect.at(x + Tmp.v1.x, y + Tmp.v1.y, rotation, color, new Vec2().set(target)); shootEffect.at(x + Tmp.v1.x, y + Tmp.v1.y, rotation, color); hitEffect.at(target.x, target.y, color); + shootSound.at(x + Tmp.v1.x, y + Tmp.v1.y, Mathf.random(0.9f, 1.1f)); reload = 0; } }else{ diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index 4259a9a50f..1f6cd46cc9 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -161,7 +161,7 @@ public class Conveyor extends Block implements Autotiler{ } @Override - public boolean shouldIdleSound(){ + public boolean shouldAmbientSound(){ return clogHeat <= 0.5f; } diff --git a/core/src/mindustry/world/blocks/distribution/StackConveyor.java b/core/src/mindustry/world/blocks/distribution/StackConveyor.java index b5d6b0c7ed..06d6f12068 100644 --- a/core/src/mindustry/world/blocks/distribution/StackConveyor.java +++ b/core/src/mindustry/world/blocks/distribution/StackConveyor.java @@ -231,7 +231,7 @@ public class StackConveyor extends Block implements Autotiler{ } @Override - public boolean shouldIdleSound(){ + public boolean shouldAmbientSound(){ return false; // has no moving parts; } diff --git a/core/src/mindustry/world/blocks/power/ImpactReactor.java b/core/src/mindustry/world/blocks/power/ImpactReactor.java index f5dc985d1e..dec8e52702 100644 --- a/core/src/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/mindustry/world/blocks/power/ImpactReactor.java @@ -91,6 +91,11 @@ public class ImpactReactor extends PowerGenerator{ productionEfficiency = Mathf.pow(warmup, 5f); } + @Override + public float ambientVolume(){ + return warmup; + } + @Override public void draw(){ Draw.rect(bottomRegion, x, y); diff --git a/core/src/mindustry/world/blocks/production/Drill.java b/core/src/mindustry/world/blocks/production/Drill.java index be022d505e..34d663b70f 100644 --- a/core/src/mindustry/world/blocks/production/Drill.java +++ b/core/src/mindustry/world/blocks/production/Drill.java @@ -67,7 +67,7 @@ public class Drill extends Block{ liquidCapacity = 5f; hasItems = true; ambientSound = Sounds.drill; - ambientSoundVolume = 0.003f; + ambientSoundVolume = 0.016f; } @Override @@ -205,8 +205,8 @@ public class Drill extends Block{ } @Override - public boolean shouldIdleSound(){ - return efficiency() > 0.01f; + public boolean shouldAmbientSound(){ + return efficiency() > 0.01f && items.total() < itemCapacity; } @Override diff --git a/core/src/mindustry/world/blocks/production/GenericCrafter.java b/core/src/mindustry/world/blocks/production/GenericCrafter.java index 2019e83468..39a2e2ac4f 100644 --- a/core/src/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/mindustry/world/blocks/production/GenericCrafter.java @@ -136,7 +136,7 @@ public class GenericCrafter extends Block{ } @Override - public boolean shouldIdleSound(){ + public boolean shouldAmbientSound(){ return cons.valid(); } diff --git a/core/src/mindustry/world/blocks/production/GenericSmelter.java b/core/src/mindustry/world/blocks/production/GenericSmelter.java index eb04cb43c7..aa61408d67 100644 --- a/core/src/mindustry/world/blocks/production/GenericSmelter.java +++ b/core/src/mindustry/world/blocks/production/GenericSmelter.java @@ -5,6 +5,7 @@ import arc.graphics.g2d.*; import arc.math.*; import arc.util.*; import mindustry.annotations.Annotations.*; +import mindustry.gen.*; import mindustry.graphics.*; /** A GenericCrafter with a new glowing region drawn on top. */ @@ -14,6 +15,8 @@ public class GenericSmelter extends GenericCrafter{ public GenericSmelter(String name){ super(name); + ambientSound = Sounds.smelter; + ambientSoundVolume = 0.06f; } public class SmelterBuild extends GenericCrafterBuild{ diff --git a/core/src/mindustry/world/blocks/production/Separator.java b/core/src/mindustry/world/blocks/production/Separator.java index a44b854c13..494a2977d8 100644 --- a/core/src/mindustry/world/blocks/production/Separator.java +++ b/core/src/mindustry/world/blocks/production/Separator.java @@ -52,7 +52,7 @@ public class Separator extends Block{ public float warmup; @Override - public boolean shouldIdleSound(){ + public boolean shouldAmbientSound(){ return cons.valid(); }