diff --git a/core/src/main/assets/sounds/grass.mp3 b/core/src/main/assets/sounds/grass.mp3 new file mode 100644 index 000000000..af4323ee5 Binary files /dev/null and b/core/src/main/assets/sounds/grass.mp3 differ diff --git a/core/src/main/assets/sounds/sturdy.mp3 b/core/src/main/assets/sounds/sturdy.mp3 new file mode 100644 index 000000000..6b2f137a3 Binary files /dev/null and b/core/src/main/assets/sounds/sturdy.mp3 differ diff --git a/core/src/main/assets/sounds/trample.mp3 b/core/src/main/assets/sounds/trample.mp3 new file mode 100644 index 000000000..8092ff306 Binary files /dev/null and b/core/src/main/assets/sounds/trample.mp3 differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java index fdc7e4d42..64aafcb12 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java @@ -128,6 +128,10 @@ public class Assets { public static final String MISS = "sounds/miss.mp3"; public static final String STEP = "sounds/step.mp3"; public static final String WATER = "sounds/water.mp3"; + public static final String GRASS = "sounds/grass.mp3"; + public static final String TRAMPLE = "sounds/trample.mp3"; + public static final String STURDY = "sounds/sturdy.mp3"; + public static final String DESCEND = "sounds/descend.mp3"; public static final String EAT = "sounds/eat.mp3"; public static final String READ = "sounds/read.mp3"; @@ -163,6 +167,15 @@ public class Assets { public static final String BEE = "sounds/bee.mp3"; public static final String DEGRADE = "sounds/degrade.mp3"; public static final String MIMIC = "sounds/mimic.mp3"; + + public static final String[] all = new String[]{ + CLICK, BADGE, GOLD, + OPEN, UNLOCK, ITEM, DEWDROP, HIT, MISS, STEP, WATER, GRASS, TRAMPLE, STURDY, + DESCEND, EAT, READ, LULLABY, DRINK, SHATTER, ZAP, LIGHTNING, LEVELUP, DEATH, + CHALLENGE, CURSED, TRAP, EVOKE, TOMB, ALERT, MELD, BOSS, BLAST, PLANT, RAY, BEACON, + TELEPORT, CHARMS, MASTERY, PUFF, ROCKS, BURNING, FALLING, GHOST, SECRET, BONES, + BEE, DEGRADE, MIMIC + }; } public static class Sprites { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 1cf997c88..8164d3cb6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -153,56 +153,7 @@ public class ShatteredPixelDungeon extends Game { Sample.INSTANCE.enable( SPDSettings.soundFx() ); Sample.INSTANCE.volume( SPDSettings.SFXVol()/10f ); - Sample.INSTANCE.load( - Assets.Sounds.CLICK, - Assets.Sounds.BADGE, - Assets.Sounds.GOLD, - - Assets.Sounds.STEP, - Assets.Sounds.WATER, - Assets.Sounds.OPEN, - Assets.Sounds.UNLOCK, - Assets.Sounds.ITEM, - Assets.Sounds.DEWDROP, - Assets.Sounds.HIT, - Assets.Sounds.MISS, - - Assets.Sounds.DESCEND, - Assets.Sounds.EAT, - Assets.Sounds.READ, - Assets.Sounds.LULLABY, - Assets.Sounds.DRINK, - Assets.Sounds.SHATTER, - Assets.Sounds.ZAP, - Assets.Sounds.LIGHTNING, - Assets.Sounds.LEVELUP, - Assets.Sounds.DEATH, - Assets.Sounds.CHALLENGE, - Assets.Sounds.CURSED, - Assets.Sounds.EVOKE, - Assets.Sounds.TRAP, - Assets.Sounds.TOMB, - Assets.Sounds.ALERT, - Assets.Sounds.MELD, - Assets.Sounds.BOSS, - Assets.Sounds.BLAST, - Assets.Sounds.PLANT, - Assets.Sounds.RAY, - Assets.Sounds.BEACON, - Assets.Sounds.TELEPORT, - Assets.Sounds.CHARMS, - Assets.Sounds.MASTERY, - Assets.Sounds.PUFF, - Assets.Sounds.ROCKS, - Assets.Sounds.BURNING, - Assets.Sounds.FALLING, - Assets.Sounds.GHOST, - Assets.Sounds.SECRET, - Assets.Sounds.BONES, - Assets.Sounds.BEE, - Assets.Sounds.DEGRADE, - Assets.Sounds.MIMIC ); - + Sample.INSTANCE.load( Assets.Sounds.all ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 3cb51e703..6ff601a0d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1562,9 +1562,15 @@ public class Hero extends Char { if (!flying) { if (Dungeon.level.water[pos]) { - Sample.INSTANCE.play( Assets.Sounds.WATER, 1, 1, Random.Float( 0.8f, 1.25f ) ); + Sample.INSTANCE.play( Assets.Sounds.WATER, 1, Random.Float( 0.8f, 1.25f ) ); + } else if (Dungeon.level.map[pos] == Terrain.EMPTY_SP) { + Sample.INSTANCE.play( Assets.Sounds.TRAMPLE, 1, Random.Float( 0.96f, 1.05f ) ); + } else if (Dungeon.level.map[pos] == Terrain.GRASS + || Dungeon.level.map[pos] == Terrain.EMBERS + || Dungeon.level.map[pos] == Terrain.FURROWED_GRASS){ + Sample.INSTANCE.play( Assets.Sounds.GRASS, 1, Random.Float( 0.96f, 1.05f ) ); } else { - Sample.INSTANCE.play( Assets.Sounds.STEP ); + Sample.INSTANCE.play( Assets.Sounds.STEP, 1, Random.Float( 0.96f, 1.05f ) ); } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index d4523182b..dcb954d19 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -65,12 +65,6 @@ public class Ghost extends NPC { state = WANDERING; } - - public Ghost() { - super(); - - Sample.INSTANCE.load( Assets.Sounds.GHOST ); - } @Override protected boolean act() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index 770486877..91e0899b6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.features; +import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; @@ -37,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.watabou.noosa.audio.Sample; import com.watabou.utils.Random; public class HighGrass { @@ -57,6 +59,9 @@ public class HighGrass { freezeTrample = true; } else { Level.set(pos, Terrain.GRASS); + if (ch instanceof Hero){ + Sample.INSTANCE.play(Assets.Sounds.TRAMPLE, 1, Random.Float( 0.96f, 1.05f ) ); + } } } else { @@ -66,6 +71,9 @@ public class HighGrass { } else { Level.set(pos, Terrain.GRASS); } + if (ch instanceof Hero){ + Sample.INSTANCE.play(Assets.Sounds.TRAMPLE, 1, Random.Float( 0.96f, 1.05f ) ); + } int naturalismLevel = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java index 5e4726466..62e04c759 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/InterlevelScene.java @@ -230,10 +230,6 @@ public class InterlevelScene extends PixelScene { break; } - if ((Dungeon.depth % 5) == 0) { - Sample.INSTANCE.load(Assets.Sounds.BOSS); - } - } catch (Exception e) { error = e;