Some new sounds

This commit is contained in:
Anuken
2020-11-08 15:58:23 -05:00
parent 99d32b9903
commit 7bb23c3384
13 changed files with 38 additions and 7 deletions
@@ -1,5 +1,6 @@
package mindustry.world.blocks.defense.turrets;
import arc.audio.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
@@ -34,6 +35,9 @@ public class TractorBeamTurret extends BaseTurret{
public StatusEffect status = StatusEffects.none;
public float statusDuration = 300;
public Sound shootSound = Sounds.tractorbeam;
public float shootSoundVolume = 0.9f;
public TractorBeamTurret(String name){
super(name);
@@ -91,6 +95,8 @@ public class TractorBeamTurret extends BaseTurret{
//look at target
if(target != null && target.within(this, range) && target.team() != team && target.type.flying && efficiency() > 0.01f){
loops.play(shootSound, this, shootSoundVolume);
any = true;
float dest = angleTo(target);
rotation = Angles.moveToward(rotation, dest, rotateSpeed * edelta());
@@ -42,7 +42,7 @@ public class Conveyor extends Block implements Autotiler{
conveyorPlacement = true;
ambientSound = Sounds.conveyor;
ambientSoundVolume = 0.004f;
ambientSoundVolume = 0.002f;
unloadable = false;
noUpdateDisabled = false;
}
@@ -1,6 +1,7 @@
package mindustry.world.blocks.environment;
import arc.*;
import arc.audio.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.graphics.g2d.TextureAtlas.*;
@@ -10,6 +11,7 @@ import arc.struct.*;
import arc.util.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.graphics.MultiPacker.*;
import mindustry.type.*;
@@ -33,7 +35,11 @@ public class Floor extends Block{
/** How many ticks it takes to drown on this. */
public float drownTime = 0f;
/** Effect when walking on this floor. */
public Effect walkEffect = Fx.ripple;
public Effect walkEffect = Fx.none;
/** Sound made when walking. */
public Sound walkSound = Sounds.none;
/** Volume of sound made when walking. */
public float walkSoundVolume = 0.1f, walkSoundPitchMin = 0.8f, walkSoundPitchMax = 1.2f;
/** Effect displayed when drowning on this floor. */
public Effect drownUpdateEffect = Fx.bubble;
/** Status effect applied when walking on. */
@@ -115,6 +121,14 @@ public class Floor extends Block{
if(decoration == Blocks.air){
decoration = content.blocks().min(b -> b instanceof Boulder && b.breakable ? mapColor.diff(b.mapColor) : Float.POSITIVE_INFINITY);
}
if(isLiquid && walkEffect == Fx.none){
walkEffect = Fx.ripple;
}
if(isLiquid && walkSound == Sounds.none){
walkSound = Sounds.splash;
}
}
@Override