From 61787086e3aae8efb7300104d39cc943e0a83dfe Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 3 Aug 2018 20:56:19 -0400 Subject: [PATCH] v0.7.0: bugfixes: - mirror and prismatic images spawning over pits - position-swapping with images putting the hero into invalid terrain - rooting not working when an enemy is retreating - timekeeper's hourglass interacting poorly with some traps - scroll of upgrade revealing if an item is cursed when it is unknown - stone of clairvoyance disarming inactive traps - some wands interacting incorrectly with timekeeper's hourglass - class armor dissappearing in faith is my armor challenge --- .../shatteredpixel/shatteredpixeldungeon/Challenges.java | 3 ++- .../actors/buffs/PrismaticGuard.java | 2 +- .../shatteredpixeldungeon/actors/mobs/Mob.java | 4 ++++ .../actors/mobs/npcs/MirrorImage.java | 4 ++++ .../actors/mobs/npcs/PrismaticImage.java | 4 ++++ .../items/artifacts/TimekeepersHourglass.java | 1 + .../items/scrolls/ScrollOfMirrorImage.java | 2 +- .../items/scrolls/ScrollOfUpgrade.java | 8 ++++---- .../items/stones/StoneOfClairvoyance.java | 5 +++-- .../shatteredpixeldungeon/items/wands/Wand.java | 5 ++--- 10 files changed, 26 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Challenges.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Challenges.java index eb47f5ee4..3c8f53f81 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Challenges.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Challenges.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon; import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClassArmor; import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit; @@ -68,7 +69,7 @@ public class Challenges { } if (Dungeon.isChallenged(NO_ARMOR)){ - if (item instanceof Armor && !(item instanceof ClothArmor)) { + if (item instanceof Armor && !(item instanceof ClothArmor || item instanceof ClassArmor)) { return true; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java index 268c0c3e3..3465de5cf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/PrismaticGuard.java @@ -62,7 +62,7 @@ public class PrismaticGuard extends Buff { int bestPos = -1; for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = hero.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { + if (Actor.findChar( p ) == null && Dungeon.level.passable[p]) { if (bestPos == -1 || Dungeon.level.trueDistance(p, closest.pos) < Dungeon.level.trueDistance(bestPos, closest.pos)){ bestPos = p; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index a640af8fc..b3a7c9d1e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -434,6 +434,10 @@ public abstract class Mob extends Char { } protected boolean getFurther( int target ) { + if (rooted || target == pos) { + return false; + } + int step = Dungeon.flee( this, pos, target, Dungeon.level.passable, fieldOfView ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java index 3e6946766..66dffb171 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java @@ -187,6 +187,10 @@ public class MirrorImage extends NPC { @Override public boolean interact() { + if (!Dungeon.level.passable[pos]){ + return true; + } + int curPos = pos; moveSprite( pos, Dungeon.hero.pos ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java index 675624adf..a3f691ad2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/PrismaticImage.java @@ -209,6 +209,10 @@ public class PrismaticImage extends NPC { @Override public boolean interact() { + if (!Dungeon.level.passable[pos]){ + return true; + } + int curPos = pos; moveSprite( pos, Dungeon.hero.pos ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index d3e1327ab..4c36d029f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -337,6 +337,7 @@ public class TimekeepersHourglass extends Artifact { super.detach(); activeBuff = null; triggerPresses(); + target.next(); } private static final String PRESSES = "presses"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java index 467e4f360..24f727c42 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfMirrorImage.java @@ -79,7 +79,7 @@ public class ScrollOfMirrorImage extends Scroll { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { int p = hero.pos + PathFinder.NEIGHBOURS8[i]; - if (Actor.findChar( p ) == null && (Dungeon.level.passable[p] || Dungeon.level.avoid[p])) { + if (Actor.findChar( p ) == null && Dungeon.level.passable[p]) { respawnPoints.add( p ); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java index 833aa56ed..07008bb92 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/ScrollOfUpgrade.java @@ -57,9 +57,9 @@ public class ScrollOfUpgrade extends InventoryScroll { w.upgrade(); - if (hadCursedEnchant && !w.hasCurseEnchant()){ + if (w.cursedKnown && hadCursedEnchant && !w.hasCurseEnchant()){ removeCurse( Dungeon.hero ); - } else if (wasCursed && !w.cursed){ + } else if (w.cursedKnown && wasCursed && !w.cursed){ weakenCurse( Dungeon.hero ); } if (hadGoodEnchant && !w.hasGoodEnchant()){ @@ -74,9 +74,9 @@ public class ScrollOfUpgrade extends InventoryScroll { a.upgrade(); - if (hadCursedGlyph && !a.hasCurseGlyph()){ + if (a.cursedKnown && hadCursedGlyph && !a.hasCurseGlyph()){ removeCurse( Dungeon.hero ); - } else if (wasCursed && !a.cursed){ + } else if (a.cursedKnown && wasCursed && !a.cursed){ weakenCurse( Dungeon.hero ); } if (hadGoodGlyph && !a.hasGoodGlyph()){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java index 31931dd27..95ac79258 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfClairvoyance.java @@ -80,8 +80,9 @@ public class StoneOfClairvoyance extends Runestone { } } - if (Dungeon.level.traps.get(curr) != null){ - disarmCandidates.add(Dungeon.level.traps.get(curr)); + Trap t = Dungeon.level.traps.get(curr); + if (t != null && t.active){ + disarmCandidates.add(t); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index c60aa2245..aa0219611 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -387,7 +387,8 @@ public abstract class Wand extends Item { if (curWand.curCharges >= (curWand.cursed ? 1 : curWand.chargesPerCast())) { curUser.busy(); - + Invisibility.dispel(); + if (curWand.cursed){ CursedWand.cursedZap(curWand, curUser, new Ballistica( curUser.pos, target, Ballistica.MAGIC_BOLT)); if (!curWand.cursedKnown){ @@ -403,8 +404,6 @@ public abstract class Wand extends Item { } curWand.cursedKnown = true; - Invisibility.dispel(); - } else { GLog.w( Messages.get(Wand.class, "fizzles") );