SFX changes

This commit is contained in:
Anuken
2020-11-08 13:55:09 -05:00
parent 0a67576133
commit a211fceab4
36 changed files with 80 additions and 142 deletions

View File

@@ -110,7 +110,7 @@ public class ForceProjector extends Block{
}
@Override
public boolean shouldIdleSound(){
public boolean shouldAmbientSound(){
return !broken && realRadius() > 1f;
}

View File

@@ -1,5 +1,6 @@
package mindustry.world.blocks.defense.turrets;
import arc.audio.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
@@ -24,6 +25,8 @@ public class PointDefenseTurret extends ReloadTurret{
public Effect hitEffect = Fx.pointHit;
public Effect shootEffect = Fx.sparkShoot;
public Sound shootSound = Sounds.lasershoot;
public float shootCone = 5f;
public float bulletDamage = 10f;
public float shootLength = 3f;
@@ -90,6 +93,7 @@ public class PointDefenseTurret extends ReloadTurret{
beamEffect.at(x + Tmp.v1.x, y + Tmp.v1.y, rotation, color, new Vec2().set(target));
shootEffect.at(x + Tmp.v1.x, y + Tmp.v1.y, rotation, color);
hitEffect.at(target.x, target.y, color);
shootSound.at(x + Tmp.v1.x, y + Tmp.v1.y, Mathf.random(0.9f, 1.1f));
reload = 0;
}
}else{

View File

@@ -161,7 +161,7 @@ public class Conveyor extends Block implements Autotiler{
}
@Override
public boolean shouldIdleSound(){
public boolean shouldAmbientSound(){
return clogHeat <= 0.5f;
}

View File

@@ -231,7 +231,7 @@ public class StackConveyor extends Block implements Autotiler{
}
@Override
public boolean shouldIdleSound(){
public boolean shouldAmbientSound(){
return false; // has no moving parts;
}

View File

@@ -91,6 +91,11 @@ public class ImpactReactor extends PowerGenerator{
productionEfficiency = Mathf.pow(warmup, 5f);
}
@Override
public float ambientVolume(){
return warmup;
}
@Override
public void draw(){
Draw.rect(bottomRegion, x, y);

View File

@@ -67,7 +67,7 @@ public class Drill extends Block{
liquidCapacity = 5f;
hasItems = true;
ambientSound = Sounds.drill;
ambientSoundVolume = 0.003f;
ambientSoundVolume = 0.016f;
}
@Override
@@ -205,8 +205,8 @@ public class Drill extends Block{
}
@Override
public boolean shouldIdleSound(){
return efficiency() > 0.01f;
public boolean shouldAmbientSound(){
return efficiency() > 0.01f && items.total() < itemCapacity;
}
@Override

View File

@@ -136,7 +136,7 @@ public class GenericCrafter extends Block{
}
@Override
public boolean shouldIdleSound(){
public boolean shouldAmbientSound(){
return cons.valid();
}

View File

@@ -5,6 +5,7 @@ import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import mindustry.annotations.Annotations.*;
import mindustry.gen.*;
import mindustry.graphics.*;
/** A GenericCrafter with a new glowing region drawn on top. */
@@ -14,6 +15,8 @@ public class GenericSmelter extends GenericCrafter{
public GenericSmelter(String name){
super(name);
ambientSound = Sounds.smelter;
ambientSoundVolume = 0.06f;
}
public class SmelterBuild extends GenericCrafterBuild{

View File

@@ -52,7 +52,7 @@ public class Separator extends Block{
public float warmup;
@Override
public boolean shouldIdleSound(){
public boolean shouldAmbientSound(){
return cons.valid();
}