New sound for rock/plant breaking

This commit is contained in:
Anuken
2021-07-14 17:22:21 -04:00
parent ac25e17286
commit dd5389c738
7 changed files with 11 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -368,6 +368,7 @@ public class Blocks implements ContentList{
sporeCluster = new Prop("spore-cluster"){{ sporeCluster = new Prop("spore-cluster"){{
variants = 3; variants = 3;
breakSound = Sounds.plantBreak;
}}; }};
boulder = new Prop("boulder"){{ boulder = new Prop("boulder"){{

View File

@@ -1442,7 +1442,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
@Override @Override
public void killed(){ public void killed(){
Events.fire(new BlockDestroyEvent(tile)); Events.fire(new BlockDestroyEvent(tile));
block.breakSound.at(tile); block.destroySound.at(tile);
onDestroyed(); onDestroyed();
tile.remove(); tile.remove();
remove(); remove();

View File

@@ -190,8 +190,10 @@ public class Block extends UnlockableContent{
public int outlinedIcon = -1; public int outlinedIcon = -1;
/** Whether this block has a shadow under it. */ /** Whether this block has a shadow under it. */
public boolean hasShadow = true; public boolean hasShadow = true;
/** Sounds made when this block breaks.*/ /** Sounds made when this block is destroyed.*/
public Sound breakSound = Sounds.boom; public Sound destroySound = Sounds.boom;
/** Sound made when this block is deconstructed. */
public Sound breakSound = Sounds.breaks;
/** How reflective this block is. */ /** How reflective this block is. */
public float albedo = 0f; public float albedo = 0f;
/** Environmental passive light color. */ /** Environmental passive light color. */

View File

@@ -47,7 +47,7 @@ public class ConstructBlock extends Block{
/** Returns a ConstructBlock by size. */ /** Returns a ConstructBlock by size. */
public static ConstructBlock get(int size){ public static ConstructBlock get(int size){
if(size > maxBlockSize) throw new IllegalArgumentException("No. Don't place ConstructBlock of size greater than " + maxBlockSize); if(size > maxBlockSize) throw new IllegalArgumentException("No. Don't place ConstructBlocks of size greater than " + maxBlockSize);
return consBlocks[size - 1]; return consBlocks[size - 1];
} }
@@ -57,7 +57,7 @@ public class ConstructBlock extends Block{
block.breakEffect.at(tile.drawx(), tile.drawy(), block.size, block.mapColor); block.breakEffect.at(tile.drawx(), tile.drawy(), block.size, block.mapColor);
Events.fire(new BlockBuildEndEvent(tile, builder, team, true, null)); Events.fire(new BlockBuildEndEvent(tile, builder, team, true, null));
tile.remove(); tile.remove();
if(shouldPlay()) Sounds.breaks.at(tile, calcPitch(false)); if(shouldPlay()) block.breakSound.at(tile, calcPitch(false));
} }
@Remote(called = Loc.server) @Remote(called = Loc.server)

View File

@@ -4,15 +4,18 @@ import arc.*;
import arc.graphics.g2d.*; import arc.graphics.g2d.*;
import arc.math.*; import arc.math.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.gen.*;
import mindustry.world.*; import mindustry.world.*;
public class Prop extends Block{ public class Prop extends Block{
public Prop(String name){ public Prop(String name){
super(name); super(name);
breakable = true; breakable = true;
alwaysReplace = true; alwaysReplace = true;
instantDeconstruct = true; instantDeconstruct = true;
breakEffect = Fx.breakProp; breakEffect = Fx.breakProp;
breakSound = Sounds.rockBreak;
} }
@Override @Override