mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-13 08:15:04 +07:00
Random shoot sound pitch
This commit is contained in:
parent
cb2e2ab9b2
commit
2832dc69ef
@ -9,7 +9,7 @@ public class SoundLoop{
|
||||
private static final float fadeSpeed = 0.05f;
|
||||
|
||||
private final Sound sound;
|
||||
private long id = -1;
|
||||
private int id = -1;
|
||||
private float volume, baseVolume;
|
||||
|
||||
public SoundLoop(Sound sound, float baseVolume){
|
||||
|
@ -92,7 +92,7 @@ public class Weapon{
|
||||
float baseX = shooter.getX(), baseY = shooter.getY();
|
||||
|
||||
Weapon weapon = shooter.getWeapon();
|
||||
weapon.shootSound.at(x, y);
|
||||
weapon.shootSound.at(x, y, Mathf.random(0.8f, 1.0f));
|
||||
|
||||
sequenceNum = 0;
|
||||
if(weapon.shotDelay > 0.01f){
|
||||
|
@ -54,7 +54,7 @@ public class BuildBlock extends Block{
|
||||
Effects.effect(Fx.breakBlock, tile.drawx(), tile.drawy(), block.size);
|
||||
world.removeBlock(tile);
|
||||
Events.fire(new BlockBuildEndEvent(tile, team, true));
|
||||
Sounds.breaks.at(tile);
|
||||
Sounds.breaks.at(tile, Mathf.random(0.7f, 1.4f));
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
@ -75,7 +75,7 @@ public class BuildBlock extends Block{
|
||||
Core.app.post(() -> tile.block().playerPlaced(tile));
|
||||
}
|
||||
Core.app.post(() -> Events.fire(new BlockBuildEndEvent(tile, team, false)));
|
||||
Sounds.place.at(tile);
|
||||
Sounds.place.at(tile, Mathf.random(0.7f, 1.4f));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -279,7 +279,7 @@ public abstract class Turret extends Block{
|
||||
|
||||
Effects.effect(shootEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
Effects.effect(smokeEffect, tile.drawx() + tr.x, tile.drawy() + tr.y, entity.rotation);
|
||||
shootSound.at(tile);
|
||||
shootSound.at(tile, Mathf.random(0.9f, 1.1f));
|
||||
|
||||
if(shootShake > 0){
|
||||
Effects.shake(shootShake, shootShake, tile.entity);
|
||||
|
Loading…
Reference in New Issue
Block a user