From defbb2ea5f67d48ac58af38951172935b72ef042 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 4 Aug 2020 19:18:23 -0400 Subject: [PATCH] v0.8.2: Fixed the following bugs: - ring of energy not increasing ghost HP regen - magical charge buff not increasing the range on disintegration - remains in pit rooms rarely containing a cursed item but not being haunted - wandmaker rarely spawning ontop of traps - rare crash bugs when windows are saved as a scene is being cleared --- .../shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java | 5 ++++- .../shatteredpixeldungeon/items/artifacts/DriedRose.java | 2 +- .../items/wands/WandOfDisintegration.java | 2 +- .../shatteredpixeldungeon/levels/rooms/special/PitRoom.java | 2 +- .../shatteredpixeldungeon/scenes/PixelScene.java | 6 ++++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java index 3a4386d68..7d5ae0212 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Wandmaker.java @@ -278,7 +278,7 @@ public class Wandmaker extends NPC { Wandmaker npc = new Wandmaker(); boolean validPos; - //Do not spawn wandmaker on the entrance, or in front of a door. + //Do not spawn wandmaker on the entrance, a trap, or in front of a door. do { validPos = true; npc.pos = level.pointToCell(room.random()); @@ -290,6 +290,9 @@ public class Wandmaker extends NPC { validPos = false; } } + if (Dungeon.level.traps.get(npc.pos) != null){ + validPos = false; + } } while (!validPos); level.mobs.add( npc ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index 6a8693750..b31700cb1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -360,7 +360,7 @@ public class DriedRose extends Artifact { //heals to full over 1000 turns if (ghost.HP < ghost.HT) { - partialCharge += ghost.HT / 1000f; + partialCharge += (ghost.HT / 1000f) * RingOfEnergy.artifactChargeMultiplier(target); updateQuickslot(); if (partialCharge > 1) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java index c2354e891..ceaed9bd6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfDisintegration.java @@ -118,7 +118,7 @@ public class WandOfDisintegration extends DamageWand { } private int distance() { - return level()*2 + 6; + return buffedLvl()*2 + 6; } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java index 8d5c408f3..6c1abbde8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/PitRoom.java @@ -77,7 +77,7 @@ public class PitRoom extends SpecialRoom { break; } } while ( mainLoot == null || Challenges.isItemBlocked(mainLoot)); - level.drop(mainLoot, remains); + level.drop(mainLoot, remains).setHauntedIfCursed(); int n = Random.IntRange( 1, 2 ); for (int i=0; i < n; i++) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java index 27783871b..be48f5d1c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/PixelScene.java @@ -138,7 +138,9 @@ public class PixelScene extends Scene { private static ArrayList> savedWindows = new ArrayList<>(); private static Class savedClass = null; - public void saveWindows(){ + public synchronized void saveWindows(){ + if (members == null) return; + savedWindows.clear(); savedClass = getClass(); for (Gizmo g : members.toArray(new Gizmo[0])){ @@ -148,7 +150,7 @@ public class PixelScene extends Scene { } } - public void restoreWindows(){ + public synchronized void restoreWindows(){ if (getClass().equals(savedClass)){ for (Class w : savedWindows){ try{