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

@@ -98,3 +98,5 @@ LeoDog896
Summet Summet
jalastram (freesound.org) jalastram (freesound.org)
newlocknew (freesound.org) newlocknew (freesound.org)
dsmolenaers (freesound.org)
Headphaze (freesound.org)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
core/assets/sounds/hum.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
core/assets/sounds/sap.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -31,12 +31,12 @@ public class LoopControl{
boolean play = data.curVolume > 0.01f; boolean play = data.curVolume > 0.01f;
float pan = Mathf.zero(data.total, 0.0001f) ? 0f : sound.calcPan(data.sum.x / data.total, data.sum.y / data.total); float pan = Mathf.zero(data.total, 0.0001f) ? 0f : sound.calcPan(data.sum.x / data.total, data.sum.y / data.total);
if(data.soundID <= 0){ if(data.soundID <= 0 || !sound.isPlaying(data.soundID)){
if(play){ if(play){
data.soundID = sound.loop(data.curVolume, 1f, pan); data.soundID = sound.loop(data.curVolume, 1f, pan);
} }
}else{ }else{
if(data.curVolume <= 0.01f){ if(data.curVolume <= 0.001f){
sound.stop(); sound.stop();
data.soundID = -1; data.soundID = -1;
return; return;

View File

@@ -1163,6 +1163,9 @@ public class Blocks implements ContentList{
requirements(Category.power, with(Items.copper, 25, Items.lead, 15)); requirements(Category.power, with(Items.copper, 25, Items.lead, 15));
powerProduction = 1f; powerProduction = 1f;
itemDuration = 120f; itemDuration = 120f;
ambientSound = Sounds.smelter;
ambientSoundVolume = 0.03f;
}}; }};
thermalGenerator = new ThermalGenerator("thermal-generator"){{ thermalGenerator = new ThermalGenerator("thermal-generator"){{
@@ -1171,6 +1174,8 @@ public class Blocks implements ContentList{
generateEffect = Fx.redgeneratespark; generateEffect = Fx.redgeneratespark;
size = 2; size = 2;
floating = true; floating = true;
ambientSound = Sounds.hum;
ambientSoundVolume = 0.04f;
}}; }};
steamGenerator = new BurnerGenerator("steam-generator"){{ steamGenerator = new BurnerGenerator("steam-generator"){{
@@ -1180,6 +1185,9 @@ public class Blocks implements ContentList{
consumes.liquid(Liquids.water, 0.1f); consumes.liquid(Liquids.water, 0.1f);
hasLiquids = true; hasLiquids = true;
size = 2; size = 2;
ambientSound = Sounds.smelter;
ambientSoundVolume = 0.05f;
}}; }};
differentialGenerator = new SingleTypeGenerator("differential-generator"){{ differentialGenerator = new SingleTypeGenerator("differential-generator"){{
@@ -1216,6 +1224,8 @@ public class Blocks implements ContentList{
thoriumReactor = new NuclearReactor("thorium-reactor"){{ thoriumReactor = new NuclearReactor("thorium-reactor"){{
requirements(Category.power, with(Items.lead, 300, Items.silicon, 200, Items.graphite, 150, Items.thorium, 150, Items.metaglass, 50)); requirements(Category.power, with(Items.lead, 300, Items.silicon, 200, Items.graphite, 150, Items.thorium, 150, Items.metaglass, 50));
ambientSound = Sounds.hum;
ambientSoundVolume = 0.16f;
size = 3; size = 3;
health = 700; health = 700;
itemDuration = 360f; itemDuration = 360f;
@@ -1231,6 +1241,9 @@ public class Blocks implements ContentList{
health = 900; health = 900;
powerProduction = 130f; powerProduction = 130f;
itemDuration = 140f; itemDuration = 140f;
ambientSound = Sounds.pulse;
ambientSoundVolume = 0.2f;
consumes.power(25f); consumes.power(25f);
consumes.item(Items.blastCompound); consumes.item(Items.blastCompound);
consumes.liquid(Liquids.cryofluid, 0.25f); consumes.liquid(Liquids.cryofluid, 0.25f);
@@ -1491,7 +1504,6 @@ public class Blocks implements ContentList{
shootEffect = Fx.shootLiquid; shootEffect = Fx.shootLiquid;
range = 110f; range = 110f;
health = 250 * size * size; health = 250 * size * size;
shootSound = Sounds.splash;
}}; }};
lancer = new ChargeTurret("lancer"){{ lancer = new ChargeTurret("lancer"){{
@@ -1639,7 +1651,6 @@ public class Blocks implements ContentList{
shootEffect = Fx.shootLiquid; shootEffect = Fx.shootLiquid;
range = 190f; range = 190f;
health = 250 * size * size; health = 250 * size * size;
shootSound = Sounds.splash;
}}; }};
fuse = new ItemTurret("fuse"){{ fuse = new ItemTurret("fuse"){{
@@ -1759,7 +1770,7 @@ public class Blocks implements ContentList{
shots = 1; shots = 1;
size = 4; size = 4;
shootCone = 2f; shootCone = 2f;
shootSound = Sounds.shootBig; shootSound = Sounds.railgun;
unitSort = (u, x, y) -> -u.maxHealth; unitSort = (u, x, y) -> -u.maxHealth;
coolantMultiplier = 0.11f; coolantMultiplier = 0.11f;

View File

@@ -287,6 +287,8 @@ public class UnitTypes implements ContentList{
alternate = false; alternate = false;
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2f; recoil = 2f;
shootSound = Sounds.lasershoot;
bullet = new LaserBoltBulletType(5.2f, 14){{ bullet = new LaserBoltBulletType(5.2f, 14){{
healPercent = 5f; healPercent = 5f;
collidesTeam = true; collidesTeam = true;
@@ -328,7 +330,7 @@ public class UnitTypes implements ContentList{
spacing = 0f; spacing = 0f;
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2.5f; recoil = 2.5f;
shootSound = Sounds.pew; shootSound = Sounds.spark;
bullet = new LightningBulletType(){{ bullet = new LightningBulletType(){{
lightningColor = hitColor = Pal.heal; lightningColor = hitColor = Pal.heal;
@@ -636,7 +638,7 @@ public class UnitTypes implements ContentList{
ejectEffect = Fx.none; ejectEffect = Fx.none;
recoil = 2f; recoil = 2f;
rotate = true; rotate = true;
shootSound = Sounds.flame; shootSound = Sounds.sap;
x = 8.5f; x = 8.5f;
y = -1.5f; y = -1.5f;
@@ -659,6 +661,7 @@ public class UnitTypes implements ContentList{
rotate = true; rotate = true;
x = 4f; x = 4f;
y = 3f; y = 3f;
shootSound = Sounds.sap;
bullet = new SapBulletType(){{ bullet = new SapBulletType(){{
sapStrength = 0.8f; sapStrength = 0.8f;
@@ -723,6 +726,7 @@ public class UnitTypes implements ContentList{
y = 8f; y = 8f;
rotate = true; rotate = true;
bullet = sapper; bullet = sapper;
shootSound = Sounds.sap;
}}, }},
new Weapon("spiroct-weapon"){{ new Weapon("spiroct-weapon"){{
reload = 15f; reload = 15f;
@@ -730,6 +734,7 @@ public class UnitTypes implements ContentList{
y = 6f; y = 6f;
rotate = true; rotate = true;
bullet = sapper; bullet = sapper;
shootSound = Sounds.sap;
}}, }},
new Weapon("spiroct-weapon"){{ new Weapon("spiroct-weapon"){{
reload = 23f; reload = 23f;
@@ -737,6 +742,7 @@ public class UnitTypes implements ContentList{
y = 0f; y = 0f;
rotate = true; rotate = true;
bullet = sapper; bullet = sapper;
shootSound = Sounds.sap;
}}, }},
new Weapon("large-purple-mount"){{ new Weapon("large-purple-mount"){{
y = -7f; y = -7f;
@@ -746,7 +752,7 @@ public class UnitTypes implements ContentList{
shake = 3f; shake = 3f;
rotateSpeed = 2f; rotateSpeed = 2f;
ejectEffect = Fx.casing1; ejectEffect = Fx.casing1;
shootSound = Sounds.shootBig; shootSound = Sounds.artillery;
rotate = true; rotate = true;
occlusion = 8f; occlusion = 8f;
recoil = 3f; recoil = 3f;
@@ -844,7 +850,7 @@ public class UnitTypes implements ContentList{
recoil = 10f; recoil = 10f;
rotateSpeed = 1f; rotateSpeed = 1f;
ejectEffect = Fx.casing3; ejectEffect = Fx.casing3;
shootSound = Sounds.shootBig; shootSound = Sounds.artillery;
rotate = true; rotate = true;
occlusion = 30f; occlusion = 30f;
@@ -1663,6 +1669,7 @@ public class UnitTypes implements ContentList{
shake = 6f; shake = 6f;
recoil = 10.5f; recoil = 10.5f;
occlusion = 50f; occlusion = 50f;
shootSound = Sounds.railgun;
shots = 1; shots = 1;
ejectEffect = Fx.none; ejectEffect = Fx.none;

View File

@@ -24,6 +24,12 @@ public class Weathers implements ContentList{
sizeMin = 2.6f; sizeMin = 2.6f;
density = 1200f; density = 1200f;
attrs.set(Attribute.light, -0.15f); attrs.set(Attribute.light, -0.15f);
sound = Sounds.windhowl;
soundVol = 0f;
soundVolOscMag = 1.5f;
soundVolOscScl = 1100f;
soundVolMin = 0.02f;
}}; }};
rain = new RainWeather("rain"){{ rain = new RainWeather("rain"){{
@@ -31,7 +37,7 @@ public class Weathers implements ContentList{
attrs.set(Attribute.water, 0.2f); attrs.set(Attribute.water, 0.2f);
status = StatusEffects.wet; status = StatusEffects.wet;
sound = Sounds.rain; sound = Sounds.rain;
soundVolume = 0.25f; soundVol = 0.25f;
}}; }};
sandstorm = new ParticleWeather("sandstorm"){{ sandstorm = new ParticleWeather("sandstorm"){{
@@ -50,7 +56,7 @@ public class Weathers implements ContentList{
opacityMultiplier = 0.8f; opacityMultiplier = 0.8f;
force = 0.1f; force = 0.1f;
sound = Sounds.wind; sound = Sounds.wind;
soundVolume = 0.3f; soundVol = 0.3f;
}}; }};
sporestorm = new ParticleWeather("sporestorm"){{ sporestorm = new ParticleWeather("sporestorm"){{
@@ -71,7 +77,7 @@ public class Weathers implements ContentList{
opacityMultiplier = 0.85f; opacityMultiplier = 0.85f;
force = 0.1f; force = 0.1f;
sound = Sounds.wind; sound = Sounds.wind;
soundVolume = 0.3f; soundVol = 0.3f;
}}; }};
fog = new ParticleWeather("fog"){{ fog = new ParticleWeather("fog"){{

View File

@@ -476,10 +476,6 @@ public class Control implements ApplicationListener, Loadable{
dialog.show(); dialog.show();
})); }));
} }
if(android){
Sounds.empty.loop(0f, 1f, 0f);
}
} }
@Override @Override

View File

@@ -207,7 +207,7 @@ public abstract class BulletType extends Content{
Damage.createIncend(x, y, incendSpread, incendAmount); Damage.createIncend(x, y, incendSpread, incendAmount);
} }
if(splashDamageRadius > 0){ if(splashDamageRadius > 0 && !b.absorbed){
Damage.damage(b.team, x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), collidesAir, collidesGround); Damage.damage(b.team, x, y, splashDamageRadius, splashDamage * b.damageMultiplier(), collidesAir, collidesGround);
if(status != StatusEffects.none){ if(status != StatusEffects.none){

View File

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

View File

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

View File

@@ -12,8 +12,6 @@ import mindustry.gen.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.world.*; import mindustry.world.*;
import java.io.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
import static mindustry.game.EventType.*; import static mindustry.game.EventType.*;
@@ -450,111 +448,11 @@ public class Administration{
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void load(){ private void load(){
if(!loadLegacy()){ //load default data
//load default data playerInfo = Core.settings.getJson("player-data", ObjectMap.class, ObjectMap::new);
playerInfo = Core.settings.getJson("player-data", ObjectMap.class, ObjectMap::new); bannedIPs = Core.settings.getJson("ip-bans", Seq.class, Seq::new);
bannedIPs = Core.settings.getJson("ip-bans", Seq.class, Seq::new); whitelist = Core.settings.getJson("whitelist-ids", Seq.class, Seq::new);
whitelist = Core.settings.getJson("whitelist-ids", Seq.class, Seq::new); subnetBans = Core.settings.getJson("banned-subnets", Seq.class, Seq::new);
subnetBans = Core.settings.getJson("banned-subnets", Seq.class, Seq::new);
}else{
//save over loaded legacy data
save();
Log.info("Loaded legacy (5.0) server data.");
}
}
private boolean loadLegacy(){
try{
byte[] info = Core.settings.getBytes("player-info");
byte[] ips = Core.settings.getBytes("banned-ips");
byte[] whitelist = Core.settings.getBytes("whitelisted");
byte[] subnet = Core.settings.getBytes("subnet-bans");
if(info != null){
DataInputStream d = new DataInputStream(new ByteArrayInputStream(info));
int size = d.readInt();
if(size != 0){
d.readUTF();
d.readUTF();
for(int i = 0; i < size; i++){
String mapKey = d.readUTF();
PlayerInfo data = new PlayerInfo();
data.id = d.readUTF();
data.lastName = d.readUTF();
data.lastIP = d.readUTF();
int ipsize = d.readInt();
if(ipsize != 0){
d.readUTF();
for(int j = 0; j < ipsize; j++){
data.ips.add(d.readUTF());
}
}
int namesize = d.readInt();
if(namesize != 0){
d.readUTF();
for(int j = 0; j < ipsize; j++){
data.names.add(d.readUTF());
}
}
//ips, names...
data.adminUsid = d.readUTF();
data.timesKicked = d.readInt();
data.timesJoined = d.readInt();
data.banned = d.readBoolean();
data.admin = d.readBoolean();
data.lastKicked = d.readLong();
playerInfo.put(mapKey, data);
}
}
Core.settings.remove("player-info");
}
if(ips != null){
DataInputStream d = new DataInputStream(new ByteArrayInputStream(ips));
int size = d.readInt();
if(size != 0){
d.readUTF();
for(int i = 0; i < size; i++){
bannedIPs.add(d.readUTF());
}
}
Core.settings.remove("banned-ips");
}
if(whitelist != null){
DataInputStream d = new DataInputStream(new ByteArrayInputStream(whitelist));
int size = d.readInt();
if(size != 0){
d.readUTF();
for(int i = 0; i < size; i++){
this.whitelist.add(d.readUTF());
}
}
Core.settings.remove("whitelisted");
}
if(subnet != null){
DataInputStream d = new DataInputStream(new ByteArrayInputStream(subnet));
int size = d.readInt();
if(size != 0){
d.readUTF();
for(int i = 0; i < size; i++){
subnetBans.add(d.readUTF());
}
}
Core.settings.remove("subnet-bans");
}
return info != null || ips != null || whitelist != null || subnet != null;
}catch(Throwable e){
e.printStackTrace();
}
return false;
} }
/** Server configuration definition. Each config value can be a string, boolean or number. */ /** Server configuration definition. Each config value can be a string, boolean or number. */
@@ -585,8 +483,7 @@ public class Administration{
autosaveAmount("The maximum amount of autosaves. Older ones get replaced.", 10), autosaveAmount("The maximum amount of autosaves. Older ones get replaced.", 10),
autosaveSpacing("Spacing between autosaves in seconds.", 60 * 5), autosaveSpacing("Spacing between autosaves in seconds.", 60 * 5),
debug("Enable debug logging", false, () -> { debug("Enable debug logging", false, () -> {
LogLevel level = debug() ? LogLevel.debug : LogLevel.info; Log.level = debug() ? LogLevel.debug : LogLevel.info;
Log.level = level;
}); });
public static final Config[] all = values(); public static final Config[] all = values();

View File

@@ -25,8 +25,8 @@ public abstract class Weather extends UnlockableContent{
public float opacityMultiplier = 1f; public float opacityMultiplier = 1f;
public Attributes attrs = new Attributes(); public Attributes attrs = new Attributes();
public Sound sound = Sounds.none; public Sound sound = Sounds.none;
public float soundVolume = 0.1f; public float soundVol = 0.1f, soundVolMin = 0f;
public float soundVolumeOscMag = 0f, soundVolumeOscScl = 20f; public float soundVolOscMag = 0f, soundVolOscScl = 20f;
//internals //internals
public Rand rand = new Rand(); public Rand rand = new Rand();
@@ -90,8 +90,8 @@ public abstract class Weather extends UnlockableContent{
} }
if(sound != Sounds.none){ if(sound != Sounds.none){
float noise = soundVolumeOscMag > 0 ? (float)Math.abs(Noise.rawNoise(Time.time() / soundVolumeOscScl)) * soundVolumeOscMag : 0; float noise = soundVolOscMag > 0 ? (float)Math.abs(Noise.rawNoise(Time.time() / soundVolOscScl)) * soundVolOscMag : 0;
loops.play(sound, Core.camera.position, (soundVolume + noise) * state.opacity); loops.play(sound, Core.camera.position, Math.max((soundVol + noise) * state.opacity, soundVolMin));
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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