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

View File

@@ -96,3 +96,5 @@ YellOw139
PetrGasparik PetrGasparik
LeoDog896 LeoDog896
Summet Summet
jalastram (freesound.org)
newlocknew (freesound.org)

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

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

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

View File

@@ -1471,7 +1471,7 @@ public class Blocks implements ContentList{
inaccuracy = 1f; inaccuracy = 1f;
shootCone = 10f; shootCone = 10f;
health = 260; health = 260;
shootSound = Sounds.artillery; shootSound = Sounds.bang;
}}; }};
wave = new LiquidTurret("wave"){{ wave = new LiquidTurret("wave"){{

View File

@@ -166,7 +166,7 @@ public class UnitTypes implements ContentList{
recoil = 5f; recoil = 5f;
shake = 2f; shake = 2f;
ejectEffect = Fx.casing3; ejectEffect = Fx.casing3;
shootSound = Sounds.artillery; shootSound = Sounds.bang;
shots = 3; shots = 3;
inaccuracy = 3f; inaccuracy = 3f;
shotDelay = 4f; shotDelay = 4f;
@@ -226,7 +226,7 @@ public class UnitTypes implements ContentList{
recoil = 5f; recoil = 5f;
shake = 2f; shake = 2f;
ejectEffect = Fx.casing4; ejectEffect = Fx.casing4;
shootSound = Sounds.artillery; shootSound = Sounds.bang;
bullet = new BasicBulletType(13f, 60){{ bullet = new BasicBulletType(13f, 60){{
pierce = true; pierce = true;
@@ -1252,6 +1252,7 @@ public class UnitTypes implements ContentList{
weapons.add( weapons.add(
new Weapon("heal-weapon-mount"){{ new Weapon("heal-weapon-mount"){{
shootSound = Sounds.lasershoot;
reload = 25f; reload = 25f;
x = 8f; x = 8f;
y = -6f; y = -6f;
@@ -1259,6 +1260,7 @@ public class UnitTypes implements ContentList{
bullet = Bullets.healBulletBig; bullet = Bullets.healBulletBig;
}}, }},
new Weapon("heal-weapon-mount"){{ new Weapon("heal-weapon-mount"){{
shootSound = Sounds.lasershoot;
reload = 15f; reload = 15f;
x = 4f; x = 4f;
y = 5f; y = 5f;

View File

@@ -3,6 +3,7 @@ package mindustry.content;
import arc.graphics.*; import arc.graphics.*;
import arc.util.*; import arc.util.*;
import mindustry.ctype.*; import mindustry.ctype.*;
import mindustry.gen.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.type.weather.*; import mindustry.type.weather.*;
import mindustry.world.meta.*; import mindustry.world.meta.*;
@@ -29,6 +30,8 @@ public class Weathers implements ContentList{
attrs.set(Attribute.light, -0.2f); attrs.set(Attribute.light, -0.2f);
attrs.set(Attribute.water, 0.2f); attrs.set(Attribute.water, 0.2f);
status = StatusEffects.wet; status = StatusEffects.wet;
sound = Sounds.rain;
soundVolume = 0.25f;
}}; }};
sandstorm = new ParticleWeather("sandstorm"){{ sandstorm = new ParticleWeather("sandstorm"){{
@@ -46,6 +49,8 @@ public class Weathers implements ContentList{
attrs.set(Attribute.water, -0.1f); attrs.set(Attribute.water, -0.1f);
opacityMultiplier = 0.8f; opacityMultiplier = 0.8f;
force = 0.1f; force = 0.1f;
sound = Sounds.wind;
soundVolume = 0.3f;
}}; }};
sporestorm = new ParticleWeather("sporestorm"){{ sporestorm = new ParticleWeather("sporestorm"){{
@@ -65,6 +70,8 @@ public class Weathers implements ContentList{
status = StatusEffects.sporeSlowed; status = StatusEffects.sporeSlowed;
opacityMultiplier = 0.85f; opacityMultiplier = 0.85f;
force = 0.1f; force = 0.1f;
sound = Sounds.wind;
soundVolume = 0.3f;
}}; }};
fog = new ParticleWeather("fog"){{ fog = new ParticleWeather("fog"){{

View File

@@ -1,12 +1,14 @@
package mindustry.type; package mindustry.type;
import arc.*; import arc.*;
import arc.audio.*;
import arc.func.*; import arc.func.*;
import arc.graphics.*; import arc.graphics.*;
import arc.graphics.g2d.*; import arc.graphics.g2d.*;
import arc.math.*; import arc.math.*;
import arc.math.geom.*; import arc.math.geom.*;
import arc.util.*; import arc.util.*;
import arc.util.noise.*;
import mindustry.annotations.Annotations.*; import mindustry.annotations.Annotations.*;
import mindustry.content.*; import mindustry.content.*;
import mindustry.ctype.*; import mindustry.ctype.*;
@@ -22,6 +24,9 @@ public abstract class Weather extends UnlockableContent{
public float duration = 9f * Time.toMinutes; public float duration = 9f * Time.toMinutes;
public float opacityMultiplier = 1f; public float opacityMultiplier = 1f;
public Attributes attrs = new Attributes(); public Attributes attrs = new Attributes();
public Sound sound = Sounds.none;
public float soundVolume = 0.1f;
public float soundVolumeOscMag = 0f, soundVolumeOscScl = 20f;
//internals //internals
public Rand rand = new Rand(); public Rand rand = new Rand();
@@ -83,6 +88,11 @@ public abstract class Weather extends UnlockableContent{
state.effectTimer -= Time.delta; 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){ public void drawOver(WeatherState state){