v0.8.1: Various bufixes:

- fixed rogue armor's blink not going over terrain when accounting for range
- fixed unblessed ankg revives waking up mimics
- fixed enemies not being surprised by invisible heroes in rare cases
- fixed pylons being surprised when they shouldn't
- fixed dark and bright fists rarely teleporting into unreachable places
- fixed rankings conversion logic on game updates not actually doing anything
- fixed debuffs being incorrectly persisted in rankings
This commit is contained in:
Evan Debenham
2020-06-16 18:59:19 -04:00
parent 5db6795d54
commit 2a622dc5f6
9 changed files with 33 additions and 10 deletions

View File

@@ -70,7 +70,6 @@ public class Assets {
public static final String BANNERS = "interfaces/banners.png";
public static final String BADGES = "interfaces/badges.png";
public static final String LOCKED = "interfaces/locked_badge.png";
public static final String AMULET = "interfaces/amulet.png";
public static final String CHROME = "interfaces/chrome.png";
public static final String ICONS = "interfaces/icons.png";
@@ -215,6 +214,7 @@ public class Assets {
public static final String HUNTRESS = "sprites/huntress.png";
public static final String AVATARS = "sprites/avatars.png";
public static final String PET = "sprites/pet.png";
public static final String AMULET = "sprites/amulet.png";
public static final String RAT = "sprites/rat.png";
public static final String BRUTE = "sprites/brute.png";

View File

@@ -22,6 +22,7 @@
package com.shatteredpixel.shatteredpixeldungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
@@ -131,6 +132,12 @@ public enum Rankings {
} else if (!Dungeon.quickslot.contains(item))
belongings.backpack.items.remove(item);
}
//remove all buffs (ones tied to equipment will be re-applied)
for(Buff b : Dungeon.hero.buffs()){
Dungeon.hero.remove(b);
}
rec.gameData.put( HERO, Dungeon.hero );
//save stats

View File

@@ -249,7 +249,7 @@ public class Mimic extends Mob {
@Override
public boolean reset() {
state = WANDERING;
if (state != PASSIVE) state = WANDERING;
return true;
}

View File

@@ -579,7 +579,7 @@ public abstract class Mob extends Char {
}
public boolean surprisedBy( Char enemy ){
return !enemySeen && enemy == Dungeon.hero;
return (!enemySeen || enemy.invisible > 0) && enemy == Dungeon.hero;
}
public void aggro( Char ch ) {

View File

@@ -129,6 +129,11 @@ public class Pylon extends Mob {
return p;
}
@Override
public void notice() {
//do nothing
}
@Override
public String description() {
if (alignment == Alignment.NEUTRAL){

View File

@@ -473,7 +473,7 @@ public abstract class YogFist extends Mob {
} while (Dungeon.level.heroFOV[i]
|| Dungeon.level.solid[i]
|| Actor.findChar(i) != null
|| Dungeon.findStep(this, Dungeon.level.exit, Dungeon.level.passable, fieldOfView, false) == -1);
|| PathFinder.getStep(i, Dungeon.level.exit, Dungeon.level.passable) == -1);
ScrollOfTeleportation.appear(this, i);
state = WANDERING;
GameScene.flash(0xFFFFFF);
@@ -543,7 +543,7 @@ public abstract class YogFist extends Mob {
} while (Dungeon.level.heroFOV[i]
|| Dungeon.level.solid[i]
|| Actor.findChar(i) != null
|| Dungeon.findStep(this, Dungeon.level.exit, Dungeon.level.passable, fieldOfView, false) == -1);
|| PathFinder.getStep(i, Dungeon.level.exit, Dungeon.level.passable) == -1);
ScrollOfTeleportation.appear(this, i);
state = WANDERING;
GameScene.flash(0, false);

View File

@@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.PathFinder;
@@ -57,11 +58,10 @@ public class RogueArmor extends ClassArmor {
public void onSelect( Integer target ) {
if (target != null) {
PathFinder.buildDistanceMap(curUser.pos, Dungeon.level.passable, 8);
PathFinder.buildDistanceMap(curUser.pos, BArray.not(Dungeon.level.solid,null), 8);
if ( PathFinder.distance[target] == Integer.MAX_VALUE ||
!Dungeon.level.heroFOV[target] ||
!(Dungeon.level.passable[target] || Dungeon.level.avoid[target]) ||
Actor.findChar( target ) != null) {
GLog.w( Messages.get(RogueArmor.class, "fov") );

View File

@@ -57,7 +57,7 @@ public class AmuletScene extends PixelScene {
add( text );
}
amulet = new Image( Assets.Interfaces.AMULET );
amulet = new Image( Assets.Sprites.AMULET );
add( amulet );
RedButton btnExit = new RedButton( Messages.get(this, "exit") ) {

View File

@@ -35,14 +35,14 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndStartGame;
import com.watabou.glwrap.Blending;
import com.watabou.noosa.Camera;
import com.watabou.noosa.Game;
import com.watabou.noosa.Image;
import com.watabou.utils.FileUtils;
import java.util.ArrayList;
public class WelcomeScene extends PixelScene {
private static int LATEST_UPDATE = ShatteredPixelDungeon.v0_8_0;
@@ -169,10 +169,21 @@ public class WelcomeScene extends PixelScene {
if (previousVersion < LATEST_UPDATE){
try {
Rankings.INSTANCE.load();
for (Rankings.Record rec : Rankings.INSTANCE.records.toArray(new Rankings.Record[0])){
try {
Rankings.INSTANCE.loadGameData(rec);
Rankings.INSTANCE.saveGameData(rec);
} catch (Exception e) {
//if we encounter a fatal per-record error, then clear that record
Rankings.INSTANCE.records.remove(rec);
ShatteredPixelDungeon.reportException(e);
}
}
Rankings.INSTANCE.save();
} catch (Exception e) {
//if we encounter a fatal error, then just clear the rankings
FileUtils.deleteFile( Rankings.RANKINGS_FILE );
ShatteredPixelDungeon.reportException(e);
}
}