New sound for rock/plant breaking
This commit is contained in:
@@ -368,6 +368,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
sporeCluster = new Prop("spore-cluster"){{
|
||||
variants = 3;
|
||||
breakSound = Sounds.plantBreak;
|
||||
}};
|
||||
|
||||
boulder = new Prop("boulder"){{
|
||||
|
||||
@@ -1442,7 +1442,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
@Override
|
||||
public void killed(){
|
||||
Events.fire(new BlockDestroyEvent(tile));
|
||||
block.breakSound.at(tile);
|
||||
block.destroySound.at(tile);
|
||||
onDestroyed();
|
||||
tile.remove();
|
||||
remove();
|
||||
|
||||
@@ -190,8 +190,10 @@ 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 breaks.*/
|
||||
public Sound breakSound = Sounds.boom;
|
||||
/** Sounds made when this block is destroyed.*/
|
||||
public Sound destroySound = Sounds.boom;
|
||||
/** Sound made when this block is deconstructed. */
|
||||
public Sound breakSound = Sounds.breaks;
|
||||
/** How reflective this block is. */
|
||||
public float albedo = 0f;
|
||||
/** Environmental passive light color. */
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ConstructBlock extends Block{
|
||||
|
||||
/** Returns a ConstructBlock by 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];
|
||||
}
|
||||
|
||||
@@ -57,7 +57,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()) Sounds.breaks.at(tile, calcPitch(false));
|
||||
if(shouldPlay()) block.breakSound.at(tile, calcPitch(false));
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
|
||||
@@ -4,15 +4,18 @@ import arc.*;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
public class Prop extends Block{
|
||||
|
||||
public Prop(String name){
|
||||
super(name);
|
||||
breakable = true;
|
||||
alwaysReplace = true;
|
||||
instantDeconstruct = true;
|
||||
breakEffect = Fx.breakProp;
|
||||
breakSound = Sounds.rockBreak;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user