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

@@ -781,7 +781,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
/** @return whether this block should play its idle sound.*/
public boolean shouldIdleSound(){
public boolean shouldAmbientSound(){
return shouldConsume();
}
@@ -1226,6 +1226,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
}
/** @return ambient sound volume scale. */
public float ambientVolume(){
return efficiency();
}
//endregion
//region overrides
@@ -1367,8 +1372,8 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
sound.update(x, y, shouldActiveSound());
}
if(block.ambientSound != Sounds.none && shouldIdleSound()){
loops.play(block.ambientSound, self(), block.ambientSoundVolume);
if(block.ambientSound != Sounds.none && shouldAmbientSound()){
loops.play(block.ambientSound, self(), block.ambientSoundVolume * ambientVolume());
}
if(enabled || !block.noUpdateDisabled){

View File

@@ -30,6 +30,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
Object data;
BulletType type;
float fdata;
transient boolean absorbed;
@Override
public void getCollisions(Cons<QuadTree> consumer){
@@ -67,6 +68,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
@Override
public void absorb(){
absorbed = true;
remove();
}