Basic weather sounds, other tweaks

This commit is contained in:
Anuken
2020-11-07 20:57:49 -05:00
parent ae1965a5c7
commit 8910a9d537
13 changed files with 24 additions and 3 deletions
+2
View File
@@ -96,3 +96,5 @@ YellOw139
PetrGasparik
LeoDog896
Summet
jalastram (freesound.org)
newlocknew (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.

Before

Width:  |  Height:  |  Size: 826 B

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 185 KiB

+1 -1
View File
@@ -1471,7 +1471,7 @@ public class Blocks implements ContentList{
inaccuracy = 1f;
shootCone = 10f;
health = 260;
shootSound = Sounds.artillery;
shootSound = Sounds.bang;
}};
wave = new LiquidTurret("wave"){{
+4 -2
View File
@@ -166,7 +166,7 @@ public class UnitTypes implements ContentList{
recoil = 5f;
shake = 2f;
ejectEffect = Fx.casing3;
shootSound = Sounds.artillery;
shootSound = Sounds.bang;
shots = 3;
inaccuracy = 3f;
shotDelay = 4f;
@@ -226,7 +226,7 @@ public class UnitTypes implements ContentList{
recoil = 5f;
shake = 2f;
ejectEffect = Fx.casing4;
shootSound = Sounds.artillery;
shootSound = Sounds.bang;
bullet = new BasicBulletType(13f, 60){{
pierce = true;
@@ -1252,6 +1252,7 @@ public class UnitTypes implements ContentList{
weapons.add(
new Weapon("heal-weapon-mount"){{
shootSound = Sounds.lasershoot;
reload = 25f;
x = 8f;
y = -6f;
@@ -1259,6 +1260,7 @@ public class UnitTypes implements ContentList{
bullet = Bullets.healBulletBig;
}},
new Weapon("heal-weapon-mount"){{
shootSound = Sounds.lasershoot;
reload = 15f;
x = 4f;
y = 5f;
+7
View File
@@ -3,6 +3,7 @@ package mindustry.content;
import arc.graphics.*;
import arc.util.*;
import mindustry.ctype.*;
import mindustry.gen.*;
import mindustry.type.*;
import mindustry.type.weather.*;
import mindustry.world.meta.*;
@@ -29,6 +30,8 @@ public class Weathers implements ContentList{
attrs.set(Attribute.light, -0.2f);
attrs.set(Attribute.water, 0.2f);
status = StatusEffects.wet;
sound = Sounds.rain;
soundVolume = 0.25f;
}};
sandstorm = new ParticleWeather("sandstorm"){{
@@ -46,6 +49,8 @@ public class Weathers implements ContentList{
attrs.set(Attribute.water, -0.1f);
opacityMultiplier = 0.8f;
force = 0.1f;
sound = Sounds.wind;
soundVolume = 0.3f;
}};
sporestorm = new ParticleWeather("sporestorm"){{
@@ -65,6 +70,8 @@ public class Weathers implements ContentList{
status = StatusEffects.sporeSlowed;
opacityMultiplier = 0.85f;
force = 0.1f;
sound = Sounds.wind;
soundVolume = 0.3f;
}};
fog = new ParticleWeather("fog"){{
+10
View File
@@ -1,12 +1,14 @@
package mindustry.type;
import arc.*;
import arc.audio.*;
import arc.func.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.math.geom.*;
import arc.util.*;
import arc.util.noise.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.ctype.*;
@@ -22,6 +24,9 @@ public abstract class Weather extends UnlockableContent{
public float duration = 9f * Time.toMinutes;
public float opacityMultiplier = 1f;
public Attributes attrs = new Attributes();
public Sound sound = Sounds.none;
public float soundVolume = 0.1f;
public float soundVolumeOscMag = 0f, soundVolumeOscScl = 20f;
//internals
public Rand rand = new Rand();
@@ -83,6 +88,11 @@ public abstract class Weather extends UnlockableContent{
state.effectTimer -= Time.delta;
}
}
if(sound != Sounds.none){
float noise = soundVolumeOscMag > 0 ? (float)Math.abs(Noise.rawNoise(Time.time() / soundVolumeOscScl)) * soundVolumeOscMag : 0;
loops.play(sound, Core.camera.position, (soundVolume + noise) * state.opacity);
}
}
public void drawOver(WeatherState state){