From 2673220c797493eba0ef6935f41213de591f96fd Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 19 Jan 2020 15:08:20 -0500 Subject: [PATCH] v0.8.0: Fixes: - fixed various crash bugs in new DM fight - fixed bags not being registered as dropped - fixed a typo in DM fight --- .../actors/mobs/NewDM300.java | 8 +++-- .../levels/rooms/special/ShopRoom.java | 10 ++++++ .../plants/Fadeleaf.java | 34 +++++++++++-------- .../messages/levels/levels.properties | 2 +- 4 files changed, 36 insertions(+), 18 deletions(-) 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 f438f1938..e3b0bc0a5 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 @@ -176,9 +176,9 @@ public class NewDM300 extends Mob { } } else { - if (!canReach){ + if (enemy == null) enemy = Dungeon.hero; - if (enemy == null) enemy = Dungeon.hero; + if (!canReach){ if (fieldOfView[enemy.pos] && turnsSinceLastAbility >= MIN_COOLDOWN){ @@ -371,6 +371,10 @@ public class NewDM300 extends Mob { for (int y = 0; y < 7; y++) { pos = start + Dungeon.level.width() * y; for (int x = 0; x < 7; x++) { + if (!Dungeon.level.insideMap(pos)) { + pos++; + continue; + } if (!Dungeon.level.solid[pos] && pos != safeCell && Random.Int(Dungeon.level.distance(rockCenter, pos)) == 0) { GameScene.add(Blob.seed(pos, 1, FallingRocks.class)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java index 5a89eb66c..796355b22 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java @@ -304,6 +304,16 @@ public class ShopRoom extends SpecialRoom { } } + if (bestBag instanceof VelvetPouch){ + Dungeon.LimitedDrops.VELVET_POUCH.drop(); + } else if (bestBag instanceof ScrollHolder){ + Dungeon.LimitedDrops.SCROLL_HOLDER.drop(); + } else if (bestBag instanceof PotionBandolier){ + Dungeon.LimitedDrops.POTION_BANDOLIER.drop(); + } else if (bestBag instanceof MagicalHolster){ + Dungeon.LimitedDrops.MAGICAL_HOLSTER.drop(); + } + return bestBag; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java index f54c2337e..49d305667 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Fadeleaf.java @@ -74,22 +74,26 @@ public class Fadeleaf extends Plant { } else if (ch instanceof Mob && !ch.properties().contains(Char.Property.IMMOVABLE)) { - int count = 10; - int newPos; - do { - newPos = Dungeon.level.randomRespawnCell( ch ); - if (count-- <= 0) { - break; + if (!Dungeon.bossLevel()) { + + int count = 10; + int newPos; + do { + newPos = Dungeon.level.randomRespawnCell(ch); + if (count-- <= 0) { + break; + } + } while (newPos == -1); + + if (newPos != -1) { + + ch.pos = newPos; + if (((Mob) ch).state == ((Mob) ch).HUNTING) + ((Mob) ch).state = ((Mob) ch).WANDERING; + ch.sprite.place(ch.pos); + ch.sprite.visible = Dungeon.level.heroFOV[ch.pos]; + } - } while (newPos == -1); - - if (newPos != -1 && !Dungeon.bossLevel()) { - - ch.pos = newPos; - if (((Mob) ch).state == ((Mob) ch).HUNTING) ((Mob) ch).state = ((Mob) ch).WANDERING; - ch.sprite.place( ch.pos ); - ch.sprite.visible = Dungeon.level.heroFOV[ch.pos]; - } } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties index c832d1f08..61a10826a 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/levels/levels.properties @@ -132,7 +132,7 @@ levels.newcavesbosslevel.wires_name=Exposed wiring levels.newcavesbosslevel.wires_desc=The ground is partially dug up here, showing some large exposed wires. They must be connecting the various electrical machines together.\n\nThe wires must have some current running through them. If DM-300 steps here it may be able to draw power from there. levels.newcavesbosslevel.energy_desc=The ground here is sparking with electricity, and is harmful to step on. The sparks seem to be stronger in some places than others... perhaps they lead to the power source? levels.newcavesbosslevel.gate_name=Metal gate -levels.newcavesbosslevel.gate_desc=A large metal gate that blocks the path into the dwarven metropolis. The metal box in the center is producing a loud humming noice, it must be connected to the circuitry and machines nearby. Perhaps destroying DM-300 will open the gate? +levels.newcavesbosslevel.gate_desc=A large metal gate that blocks the path into the dwarven metropolis. The metal box in the center is producing a loud humming noise, it must be connected to the circuitry and machines nearby. Perhaps destroying DM-300 will open the gate? levels.newcavesbosslevel.gate_desc_broken=The gate must have been connected to DM-300 in some way, as it exploded when DM-300 was defeated. Now only broken pieces remain. levels.newcavesbosslevel.water_desc=With all the electricity around here water might not always be safe...