From 93fc235aabef777391d32b90293932614526992e Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 17 Jul 2020 19:07:18 -0400 Subject: [PATCH] v0.8.2: Fixed the following bugs: - Freezes if caustic slimes or DM-201s died over pits - Talisman of foresight taking no time to scry - Talisman of foresight not gaining exp in some cases - Wand of Warding healing sentries for more HP than intended - Dropped items not using new step SFX --- .../actors/mobs/CausticSlime.java | 2 +- .../actors/mobs/DM201.java | 2 +- .../items/artifacts/TalismanOfForesight.java | 23 ++++++++----------- .../items/wands/WandOfWarding.java | 3 --- .../sprites/ItemSprite.java | 20 ++++++++++------ 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java index 7c881793d..3e20fa330 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/CausticSlime.java @@ -57,7 +57,7 @@ public class CausticSlime extends Slime { int ofs; do { ofs = PathFinder.NEIGHBOURS8[Random.Int(8)]; - } while (!Dungeon.level.passable[pos + ofs]); + } while (Dungeon.level.solid[pos + ofs]); Dungeon.level.drop( new GooBlob(), pos + ofs ).sprite.drop( pos ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java index fe93b0057..e65fd24a1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM201.java @@ -126,7 +126,7 @@ public class DM201 extends DM200 { int ofs; do { ofs = PathFinder.NEIGHBOURS8[Random.Int(8)]; - } while (!Dungeon.level.passable[pos + ofs]); + } while (Dungeon.level.solid[pos + ofs]); Dungeon.level.drop( new MetalShard(), pos + ofs ).sprite.drop( pos ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java index e0607519f..cdb3e77cf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java @@ -156,20 +156,16 @@ public class TalismanOfForesight extends Artifact { } if (Dungeon.level.secret[cell]) { - Dungeon.level.discover(cell); + int oldValue = Dungeon.level.map[cell]; + GameScene.discoverTile(cell, oldValue); + Dungeon.level.discover( cell ); + ScrollOfMagicMapping.discover(cell); + noticed = true; - if (Dungeon.level.heroFOV[cell]) { - int oldValue = Dungeon.level.map[cell]; - GameScene.discoverTile(cell, Dungeon.level.map[cell]); - Dungeon.level.discover( cell ); - ScrollOfMagicMapping.discover(cell); - noticed = true; - - if (oldValue == Terrain.SECRET_TRAP){ - earnedExp += 10; - } else if (oldValue == Terrain.SECRET_DOOR){ - earnedExp += 100; - } + if (oldValue == Terrain.SECRET_TRAP){ + earnedExp += 10; + } else if (oldValue == Terrain.SECRET_DOOR){ + earnedExp += 100; } } @@ -214,6 +210,7 @@ public class TalismanOfForesight extends Artifact { GameScene.updateFog(); curUser.sprite.zap(target); + curUser.spend(Actor.TICK); Sample.INSTANCE.play(Assets.Sounds.TELEPORT); if (noticed) Sample.INSTANCE.play(Assets.Sounds.SECRET); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java index 575b2792e..515f36831 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfWarding.java @@ -250,15 +250,12 @@ public class WandOfWarding extends Wand { return; case 4: heal = 8; - HP = Math.min(HT, HP+9); break; case 5: heal = 10; - HP = Math.min(HT, HP+10); break; case 6: heal = 15; - HP = Math.min(HT, HP+15); break; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java index cf0874cf7..6910464f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSprite.java @@ -322,17 +322,23 @@ public class ItemSprite extends MovieClip { place(heap.pos); if (visible) { - boolean water = Dungeon.level.water[heap.pos]; - if (water) { + if (Dungeon.level.water[heap.pos]) { GameScene.ripple(heap.pos); - } else { - int cell = Dungeon.level.map[heap.pos]; - water = (cell == Terrain.WELL || cell == Terrain.ALCHEMY); } - if (!(heap.peek() instanceof Gold)) { - Sample.INSTANCE.play(water ? Assets.Sounds.WATER : Assets.Sounds.STEP, 0.8f, 0.8f, 1.2f); + if (Dungeon.level.water[heap.pos]) { + Sample.INSTANCE.play( Assets.Sounds.WATER, 0.8f, Random.Float( 1f, 1.45f ) ); + } else if (Dungeon.level.map[heap.pos] == Terrain.EMPTY_SP) { + Sample.INSTANCE.play( Assets.Sounds.STURDY, 0.8f, Random.Float( 1.16f, 1.25f ) ); + } else if (Dungeon.level.map[heap.pos] == Terrain.GRASS + || Dungeon.level.map[heap.pos] == Terrain.EMBERS + || Dungeon.level.map[heap.pos] == Terrain.FURROWED_GRASS){ + Sample.INSTANCE.play( Assets.Sounds.GRASS, 0.8f, Random.Float( 1.16f, 1.25f ) ); + } else if (Dungeon.level.map[heap.pos] == Terrain.HIGH_GRASS) { + Sample.INSTANCE.play( Assets.Sounds.STEP, 0.8f, Random.Float( 1.16f, 1.25f ) ); + } else { + Sample.INSTANCE.play( Assets.Sounds.STEP, 0.8f, Random.Float( 1.16f, 1.25f )); } } }