Erekir turret SFX (of varying quality)

This commit is contained in:
Anuken
2022-08-21 20:44:07 -04:00
parent ae83779253
commit 2c28b206b8
19 changed files with 62 additions and 3 deletions

View File

@@ -1098,6 +1098,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
return false;
}
/** @return volume cale of active sound. */
public float activeSoundVolume(){
return 1f;
}
/** @return whether this block should play its idle sound.*/
public boolean shouldAmbientSound(){
return shouldConsume();
@@ -1954,7 +1959,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
//TODO separate system for sound? AudioSource, etc
if(!headless){
if(sound != null){
sound.update(x, y, shouldActiveSound());
sound.update(x, y, shouldActiveSound(), activeSoundVolume());
}
if(block.ambientSound != Sounds.none && shouldAmbientSound()){

View File

@@ -437,6 +437,10 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
healTime -= Time.delta / 20f;
wasHealed = false;
if(!headless && type.loopSound != Sounds.none){
control.sound.loop(type.loopSound, this, type.loopSoundVolume);
}
//check if environment is unsupported
if(!type.supportsEnv(state.rules.env) && !dead){
Call.unitEnvDeath(self());