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
This commit is contained in:
Evan Debenham 2018-08-03 20:56:19 -04:00
parent 405bfeb77c
commit 61787086e3
10 changed files with 26 additions and 12 deletions

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop; import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; 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.armor.ClothArmor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit; import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
@ -68,7 +69,7 @@ public class Challenges {
} }
if (Dungeon.isChallenged(NO_ARMOR)){ if (Dungeon.isChallenged(NO_ARMOR)){
if (item instanceof Armor && !(item instanceof ClothArmor)) { if (item instanceof Armor && !(item instanceof ClothArmor || item instanceof ClassArmor)) {
return true; return true;
} }
} }

View File

@ -62,7 +62,7 @@ public class PrismaticGuard extends Buff {
int bestPos = -1; int bestPos = -1;
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
int p = hero.pos + PathFinder.NEIGHBOURS8[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)){ if (bestPos == -1 || Dungeon.level.trueDistance(p, closest.pos) < Dungeon.level.trueDistance(bestPos, closest.pos)){
bestPos = p; bestPos = p;
} }

View File

@ -434,6 +434,10 @@ public abstract class Mob extends Char {
} }
protected boolean getFurther( int target ) { protected boolean getFurther( int target ) {
if (rooted || target == pos) {
return false;
}
int step = Dungeon.flee( this, pos, target, int step = Dungeon.flee( this, pos, target,
Dungeon.level.passable, Dungeon.level.passable,
fieldOfView ); fieldOfView );

View File

@ -187,6 +187,10 @@ public class MirrorImage extends NPC {
@Override @Override
public boolean interact() { public boolean interact() {
if (!Dungeon.level.passable[pos]){
return true;
}
int curPos = pos; int curPos = pos;
moveSprite( pos, Dungeon.hero.pos ); moveSprite( pos, Dungeon.hero.pos );

View File

@ -209,6 +209,10 @@ public class PrismaticImage extends NPC {
@Override @Override
public boolean interact() { public boolean interact() {
if (!Dungeon.level.passable[pos]){
return true;
}
int curPos = pos; int curPos = pos;
moveSprite( pos, Dungeon.hero.pos ); moveSprite( pos, Dungeon.hero.pos );

View File

@ -337,6 +337,7 @@ public class TimekeepersHourglass extends Artifact {
super.detach(); super.detach();
activeBuff = null; activeBuff = null;
triggerPresses(); triggerPresses();
target.next();
} }
private static final String PRESSES = "presses"; private static final String PRESSES = "presses";

View File

@ -79,7 +79,7 @@ public class ScrollOfMirrorImage extends Scroll {
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) { for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
int p = hero.pos + PathFinder.NEIGHBOURS8[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 ); respawnPoints.add( p );
} }
} }

View File

@ -57,9 +57,9 @@ public class ScrollOfUpgrade extends InventoryScroll {
w.upgrade(); w.upgrade();
if (hadCursedEnchant && !w.hasCurseEnchant()){ if (w.cursedKnown && hadCursedEnchant && !w.hasCurseEnchant()){
removeCurse( Dungeon.hero ); removeCurse( Dungeon.hero );
} else if (wasCursed && !w.cursed){ } else if (w.cursedKnown && wasCursed && !w.cursed){
weakenCurse( Dungeon.hero ); weakenCurse( Dungeon.hero );
} }
if (hadGoodEnchant && !w.hasGoodEnchant()){ if (hadGoodEnchant && !w.hasGoodEnchant()){
@ -74,9 +74,9 @@ public class ScrollOfUpgrade extends InventoryScroll {
a.upgrade(); a.upgrade();
if (hadCursedGlyph && !a.hasCurseGlyph()){ if (a.cursedKnown && hadCursedGlyph && !a.hasCurseGlyph()){
removeCurse( Dungeon.hero ); removeCurse( Dungeon.hero );
} else if (wasCursed && !a.cursed){ } else if (a.cursedKnown && wasCursed && !a.cursed){
weakenCurse( Dungeon.hero ); weakenCurse( Dungeon.hero );
} }
if (hadGoodGlyph && !a.hasGoodGlyph()){ if (hadGoodGlyph && !a.hasGoodGlyph()){

View File

@ -80,8 +80,9 @@ public class StoneOfClairvoyance extends Runestone {
} }
} }
if (Dungeon.level.traps.get(curr) != null){ Trap t = Dungeon.level.traps.get(curr);
disarmCandidates.add(Dungeon.level.traps.get(curr)); if (t != null && t.active){
disarmCandidates.add(t);
} }
} }

View File

@ -387,7 +387,8 @@ public abstract class Wand extends Item {
if (curWand.curCharges >= (curWand.cursed ? 1 : curWand.chargesPerCast())) { if (curWand.curCharges >= (curWand.cursed ? 1 : curWand.chargesPerCast())) {
curUser.busy(); curUser.busy();
Invisibility.dispel();
if (curWand.cursed){ if (curWand.cursed){
CursedWand.cursedZap(curWand, curUser, new Ballistica( curUser.pos, target, Ballistica.MAGIC_BOLT)); CursedWand.cursedZap(curWand, curUser, new Ballistica( curUser.pos, target, Ballistica.MAGIC_BOLT));
if (!curWand.cursedKnown){ if (!curWand.cursedKnown){
@ -403,8 +404,6 @@ public abstract class Wand extends Item {
} }
curWand.cursedKnown = true; curWand.cursedKnown = true;
Invisibility.dispel();
} else { } else {
GLog.w( Messages.get(Wand.class, "fizzles") ); GLog.w( Messages.get(Wand.class, "fizzles") );