SFX changes
This commit is contained in:
@@ -110,7 +110,7 @@ public class ForceProjector extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldIdleSound(){
|
||||
public boolean shouldAmbientSound(){
|
||||
return !broken && realRadius() > 1f;
|
||||
}
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -161,7 +161,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldIdleSound(){
|
||||
public boolean shouldAmbientSound(){
|
||||
return clogHeat <= 0.5f;
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ public class StackConveyor extends Block implements Autotiler{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldIdleSound(){
|
||||
public boolean shouldAmbientSound(){
|
||||
return false; // has no moving parts;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -136,7 +136,7 @@ public class GenericCrafter extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldIdleSound(){
|
||||
public boolean shouldAmbientSound(){
|
||||
return cons.valid();
|
||||
}
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -52,7 +52,7 @@ public class Separator extends Block{
|
||||
public float warmup;
|
||||
|
||||
@Override
|
||||
public boolean shouldIdleSound(){
|
||||
public boolean shouldAmbientSound(){
|
||||
return cons.valid();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user