From a0ff6dcb75a3129c718720be2b5e229ea26ad906 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 17 Jun 2020 14:25:40 -0400 Subject: [PATCH] v0.8.1: fixes: - fixed audio issues with DM-200/Dm-300 - fixed summoning traps failing to summon anything in some cases - fixed DM-300 being able to drill out of its arena in rare cases --- .../actors/mobs/DM200.java | 1 - .../actors/mobs/NewDM300.java | 18 +++++++++++------ .../levels/NewCavesBossLevel.java | 20 +++++++++---------- .../levels/traps/SummoningTrap.java | 4 ++-- .../sprites/DM200Sprite.java | 2 +- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java index 0eb3db5ac..992078ec1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java @@ -130,7 +130,6 @@ public class DM200 extends Mob { } GLog.w(Messages.get(this, "vent")); - Sample.INSTANCE.play(Assets.Sounds.GAS); GameScene.add(Blob.seed(trajectory.collisionPos, 100, ToxicGas.class)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java index 41f7f1107..d47beab41 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java @@ -65,7 +65,9 @@ import com.watabou.noosa.audio.Sample; import com.watabou.utils.Bundle; import com.watabou.utils.GameMath; import com.watabou.utils.PathFinder; +import com.watabou.utils.Point; import com.watabou.utils.Random; +import com.watabou.utils.Rect; import com.watabou.utils.RectF; public class NewDM300 extends Mob { @@ -202,7 +204,7 @@ public class NewDM300 extends Mob { return false; } else { ventGas(enemy); - Sample.INSTANCE.play(Assets.Sounds.PUFF); + Sample.INSTANCE.play(Assets.Sounds.GAS); return true; } @@ -237,7 +239,7 @@ public class NewDM300 extends Mob { return false; } else { ventGas(enemy); - Sample.INSTANCE.play(Assets.Sounds.PUFF); + Sample.INSTANCE.play(Assets.Sounds.GAS); return true; } } else { @@ -247,7 +249,7 @@ public class NewDM300 extends Mob { return false; } else { dropRocks(enemy); - Sample.INSTANCE.play(Assets.Sounds.PUFF); + Sample.INSTANCE.play(Assets.Sounds.ROCKS); return true; } } @@ -354,8 +356,6 @@ public class NewDM300 extends Mob { } - Sample.INSTANCE.play(Assets.Sounds.GAS); - } public void onSlamComplete(){ @@ -551,8 +551,13 @@ public class NewDM300 extends Mob { if (bestpos != pos){ Sample.INSTANCE.play( Assets.Sounds.ROCKS ); + Rect gate = NewCavesBossLevel.gate; for (int i : PathFinder.NEIGHBOURS9){ if (Dungeon.level.map[pos+i] == Terrain.WALL || Dungeon.level.map[pos+i] == Terrain.WALL_DECO){ + Point p = Dungeon.level.cellToPoint(pos+i); + if (p.y < gate.bottom && p.x > gate.left-2 && p.x < gate.right+2){ + continue; //don't break the gate or walls around the gate + } Level.set(pos+i, Terrain.EMPTY_DECO); GameScene.updateMap(pos+i); } @@ -561,8 +566,9 @@ public class NewDM300 extends Mob { Dungeon.observe(); spend(3f); + bestpos = pos; for (int i : PathFinder.NEIGHBOURS8){ - if (Actor.findChar(pos+i) == null && + if (Actor.findChar(pos+i) == null && Dungeon.level.openSpace[pos+i] && Dungeon.level.trueDistance(bestpos, target) > Dungeon.level.trueDistance(pos+i, target)){ bestpos = pos+i; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java index 7f94e51f6..cd73cf5ca 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewCavesBossLevel.java @@ -92,16 +92,6 @@ public class NewCavesBossLevel extends Level { setSize(WIDTH, HEIGHT); - //fill in special floor, statues, and exits - Painter.fill(this, 15, 2, 3, 3, Terrain.EMPTY_SP); - Painter.fill(this, 15, 5, 3, 1, Terrain.STATUE); - Painter.fill(this, 15, 7, 3, 1, Terrain.STATUE); - Painter.fill(this, 15, 9, 3, 1, Terrain.STATUE); - Painter.fill(this, 16, 5, 1, 6, Terrain.EMPTY_SP); - Painter.fill(this, 15, 0, 3, 3, Terrain.EXIT); - - exit = 16 + 2*width(); - //These signs are visually overridden with custom tile visuals Painter.fill(this, gate, Terrain.SIGN); @@ -132,6 +122,16 @@ public class NewCavesBossLevel extends Level { Painter.fill(this, 13, 10, 7, 1, Terrain.CHASM); Painter.fill(this, 14, 3, 5, 10, Terrain.EMPTY); + //fill in special floor, statues, and exits + Painter.fill(this, 15, 2, 3, 3, Terrain.EMPTY_SP); + Painter.fill(this, 15, 5, 3, 1, Terrain.STATUE); + Painter.fill(this, 15, 7, 3, 1, Terrain.STATUE); + Painter.fill(this, 15, 9, 3, 1, Terrain.STATUE); + Painter.fill(this, 16, 5, 1, 6, Terrain.EMPTY_SP); + Painter.fill(this, 15, 0, 3, 3, Terrain.EXIT); + + exit = 16 + 2*width(); + CustomTilemap customVisuals = new CityEntrance(); customVisuals.setRect(0, 0, width(), 11); customTiles.add(customVisuals); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java index 655103c11..6b5fd2d61 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/SummoningTrap.java @@ -74,8 +74,8 @@ public class SummoningTrap extends Trap { for (Integer point : respawnPoints) { Mob mob = Dungeon.level.createMob(); - if (Char.hasProp(mob, Char.Property.LARGE) && !Dungeon.level.openSpace[point]){ - continue; + while (Char.hasProp(mob, Char.Property.LARGE) && !Dungeon.level.openSpace[point]){ + mob = Dungeon.level.createMob(); } if (mob != null) { mob.state = mob.WANDERING; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java index a3bc42b6b..fecc779a0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/DM200Sprite.java @@ -71,7 +71,7 @@ public class DM200Sprite extends MobSprite { ((DM200)ch).onZapComplete(); } } ); - Sample.INSTANCE.play( Assets.Sounds.PUFF ); + Sample.INSTANCE.play( Assets.Sounds.GAS ); } @Override