Some new sounds

This commit is contained in:
Anuken
2020-11-08 15:58:23 -05:00
parent 99d32b9903
commit 7bb23c3384
13 changed files with 38 additions and 7 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6 -2
View File
@@ -288,6 +288,10 @@ public class Blocks implements ContentList{
attributes.set(Attribute.water, 1f); attributes.set(Attribute.water, 1f);
cacheLayer = CacheLayer.mud; cacheLayer = CacheLayer.mud;
albedo = 0.35f; albedo = 0.35f;
walkSound = Sounds.mud;
walkSoundVolume = 0.08f;
walkSoundPitchMin = 0.4f;
walkSoundPitchMax = 0.5f;
}}; }};
((ShallowLiquid)darksandTaintedWater).set(Blocks.taintedWater, Blocks.darksand); ((ShallowLiquid)darksandTaintedWater).set(Blocks.taintedWater, Blocks.darksand);
@@ -593,7 +597,7 @@ public class Blocks implements ContentList{
drawer = new DrawWeave(); drawer = new DrawWeave();
ambientSound = Sounds.techloop; ambientSound = Sounds.techloop;
ambientSoundVolume = 0.05f; ambientSoundVolume = 0.02f;
consumes.items(with(Items.thorium, 4, Items.sand, 10)); consumes.items(with(Items.thorium, 4, Items.sand, 10));
consumes.power(5f); consumes.power(5f);
@@ -1225,7 +1229,7 @@ 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; ambientSound = Sounds.hum;
ambientSoundVolume = 0.16f; ambientSoundVolume = 0.2f;
size = 3; size = 3;
health = 700; health = 700;
itemDuration = 360f; itemDuration = 360f;
@@ -75,10 +75,14 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
wasFlying = isFlying(); wasFlying = isFlying();
} }
if(!hovering && isGrounded() && floor.isLiquid){ if(!hovering && isGrounded()){
if((splashTimer += Mathf.dst(deltaX(), deltaY())) >= (7f + hitSize()/8f)){ if((splashTimer += Mathf.dst(deltaX(), deltaY())) >= (7f + hitSize()/8f)){
floor.walkEffect.at(x, y, hitSize() / 8f, floor.mapColor); floor.walkEffect.at(x, y, hitSize() / 8f, floor.mapColor);
splashTimer = 0f; splashTimer = 0f;
if(!(this instanceof WaterMovec)){
floor.walkSound.at(x, y, Mathf.random(floor.walkSoundPitchMin, floor.walkSoundPitchMax), floor.walkSoundVolume);
}
} }
} }
@@ -112,6 +112,7 @@ abstract class LegsComp implements Posc, Rotc, Hitboxc, Flyingc, Unitc{
Floor floor = Vars.world.floorWorld(l.base.x, l.base.y); Floor floor = Vars.world.floorWorld(l.base.x, l.base.y);
if(floor.isLiquid){ if(floor.isLiquid){
floor.walkEffect.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor); floor.walkEffect.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor);
floor.walkSound.at(x, y, 1f, floor.walkSoundVolume);
}else{ }else{
Fx.unitLandSmall.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor); Fx.unitLandSmall.at(l.base.x, l.base.y, type.rippleScale, floor.mapColor);
} }
+3 -1
View File
@@ -96,11 +96,13 @@ public class LAssembler{
if(data == null || data.isEmpty()) return new Seq<>(); if(data == null || data.isEmpty()) return new Seq<>();
Seq<LStatement> statements = new Seq<>(); Seq<LStatement> statements = new Seq<>();
String[] lines = data.split("[;\n]+"); String[] lines = data.split("\n");
int index = 0; int index = 0;
for(String line : lines){ for(String line : lines){
//comments //comments
if(line.startsWith("#")) continue; if(line.startsWith("#")) continue;
//remove trailing semicolons in case someone adds them in for no reason
if(line.endsWith(";")) line = line.substring(0, line.length() - 1);
if(index++ > max) break; if(index++ > max) break;
@@ -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.*;
@@ -34,6 +35,9 @@ public class TractorBeamTurret extends BaseTurret{
public StatusEffect status = StatusEffects.none; public StatusEffect status = StatusEffects.none;
public float statusDuration = 300; public float statusDuration = 300;
public Sound shootSound = Sounds.tractorbeam;
public float shootSoundVolume = 0.9f;
public TractorBeamTurret(String name){ public TractorBeamTurret(String name){
super(name); super(name);
@@ -91,6 +95,8 @@ public class TractorBeamTurret extends BaseTurret{
//look at target //look at target
if(target != null && target.within(this, range) && target.team() != team && target.type.flying && efficiency() > 0.01f){ if(target != null && target.within(this, range) && target.team() != team && target.type.flying && efficiency() > 0.01f){
loops.play(shootSound, this, shootSoundVolume);
any = true; any = true;
float dest = angleTo(target); float dest = angleTo(target);
rotation = Angles.moveToward(rotation, dest, rotateSpeed * edelta()); rotation = Angles.moveToward(rotation, dest, rotateSpeed * edelta());
@@ -42,7 +42,7 @@ public class Conveyor extends Block implements Autotiler{
conveyorPlacement = true; conveyorPlacement = true;
ambientSound = Sounds.conveyor; ambientSound = Sounds.conveyor;
ambientSoundVolume = 0.004f; ambientSoundVolume = 0.002f;
unloadable = false; unloadable = false;
noUpdateDisabled = false; noUpdateDisabled = false;
} }
@@ -1,6 +1,7 @@
package mindustry.world.blocks.environment; package mindustry.world.blocks.environment;
import arc.*; import arc.*;
import arc.audio.*;
import arc.graphics.*; import arc.graphics.*;
import arc.graphics.g2d.*; import arc.graphics.g2d.*;
import arc.graphics.g2d.TextureAtlas.*; import arc.graphics.g2d.TextureAtlas.*;
@@ -10,6 +11,7 @@ import arc.struct.*;
import arc.util.*; import arc.util.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.entities.*; import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.graphics.MultiPacker.*; import mindustry.graphics.MultiPacker.*;
import mindustry.type.*; import mindustry.type.*;
@@ -33,7 +35,11 @@ public class Floor extends Block{
/** How many ticks it takes to drown on this. */ /** How many ticks it takes to drown on this. */
public float drownTime = 0f; public float drownTime = 0f;
/** Effect when walking on this floor. */ /** Effect when walking on this floor. */
public Effect walkEffect = Fx.ripple; public Effect walkEffect = Fx.none;
/** Sound made when walking. */
public Sound walkSound = Sounds.none;
/** Volume of sound made when walking. */
public float walkSoundVolume = 0.1f, walkSoundPitchMin = 0.8f, walkSoundPitchMax = 1.2f;
/** Effect displayed when drowning on this floor. */ /** Effect displayed when drowning on this floor. */
public Effect drownUpdateEffect = Fx.bubble; public Effect drownUpdateEffect = Fx.bubble;
/** Status effect applied when walking on. */ /** Status effect applied when walking on. */
@@ -115,6 +121,14 @@ public class Floor extends Block{
if(decoration == Blocks.air){ if(decoration == Blocks.air){
decoration = content.blocks().min(b -> b instanceof Boulder && b.breakable ? mapColor.diff(b.mapColor) : Float.POSITIVE_INFINITY); decoration = content.blocks().min(b -> b instanceof Boulder && b.breakable ? mapColor.diff(b.mapColor) : Float.POSITIVE_INFINITY);
} }
if(isLiquid && walkEffect == Fx.none){
walkEffect = Fx.ripple;
}
if(isLiquid && walkSound == Sounds.none){
walkSound = Sounds.splash;
}
} }
@Override @Override
+1 -1
View File
@@ -1,3 +1,3 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=f0ff5f7d844bb184ebb548cd78b6e1a921de2ee9 archash=b99073959675a037f3a722a7ca08d28c21e10038