diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index e03ed2c0b0..d0e900e479 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -202,10 +202,16 @@ public class Block extends UnlockableContent{ public int outlinedIcon = -1; /** Whether this block has a shadow under it. */ public boolean hasShadow = true; - /** Sounds made when this block is destroyed.*/ - public Sound destroySound = Sounds.boom; + /** Should the sound made when this block is built change in pitch. */ + public boolean placePitchChange = true; + /** Should the sound made when this block is deconstructed change in pitch. */ + public boolean breakPitchChange = true; + /** Sound made when this block is built. */ + public Sound placeSound = Sounds.place; /** Sound made when this block is deconstructed. */ public Sound breakSound = Sounds.breaks; + /** Sounds made when this block is destroyed.*/ + public Sound destroySound = Sounds.boom; /** How reflective this block is. */ public float albedo = 0f; /** Environmental passive light color. */ diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index 9113a840a1..ee42782485 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -58,7 +58,7 @@ public class ConstructBlock extends Block{ block.breakEffect.at(tile.drawx(), tile.drawy(), block.size, block.mapColor); Events.fire(new BlockBuildEndEvent(tile, builder, team, true, null)); tile.remove(); - if(shouldPlay()) block.breakSound.at(tile, calcPitch(false)); + if(shouldPlay()) block.breakSound.at(tile, block.breakPitchChange ? calcPitch(false) : 1f); } @Remote(called = Loc.server) @@ -97,7 +97,7 @@ public class ConstructBlock extends Block{ } Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size); - if(shouldPlay()) Sounds.place.at(tile, calcPitch(true)); + if(shouldPlay()) block.placeSound.at(tile, block.placePitchChange ? calcPitch(true) : 1f); Events.fire(new BlockBuildEndEvent(tile, builder, team, false, config)); }