diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java index 04ead3132..9b92ab65d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java @@ -154,11 +154,12 @@ public class Preparation extends Buff implements ActionIndicator.Action { @Override public float iconFadePercent() { - if (AttackLevel.getLvl(turnsInvis) == AttackLevel.LVL_4){ + AttackLevel level = AttackLevel.getLvl(turnsInvis); + if (level == AttackLevel.LVL_4){ return 0; } else { - float turnsForCur = AttackLevel.getLvl(turnsInvis).turnsReq; - float turnsForNext = AttackLevel.values()[AttackLevel.getLvl(turnsInvis).ordinal()+1].turnsReq; + float turnsForCur = level.turnsReq; + float turnsForNext = AttackLevel.values()[level.ordinal()+1].turnsReq; turnsForNext -= turnsForCur; float turnsToNext = turnsInvis - turnsForCur; return Math.min(1, (turnsForNext - turnsToNext)/(turnsForNext)); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java index 348d2bbf5..58e3b6ad3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java @@ -244,7 +244,9 @@ public class NewTengu extends Mob { do { newPos = ((NewPrisonBossLevel)Dungeon.level).randomTenguCellPos(); - } while ( (level.trueDistance(newPos, enemy.pos) <= 4 || Actor.findChar(newPos) != null)); + } while ( level.trueDistance(newPos, enemy.pos) <= 4 + || level.trueDistance(newPos, Dungeon.hero.pos) <= 4 + || Actor.findChar(newPos) != null); if (level.heroFOV[pos]) CellEmitter.get( pos ).burst( Speck.factory( Speck.WOOL ), 6 ); @@ -266,6 +268,8 @@ public class NewTengu extends Mob { level.solid[newPos] || level.distance(newPos, enemy.pos) < 5 || level.distance(newPos, enemy.pos) > 7 || + level.distance(newPos, Dungeon.hero.pos) < 5 || + level.distance(newPos, Dungeon.hero.pos) > 7 || level.distance(newPos, pos) < 6 || Actor.findChar(newPos) != null || Dungeon.level.heaps.get(newPos) != null); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java index 438c43947..ef8006c99 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Blacksmith.java @@ -246,6 +246,7 @@ public class Blacksmith extends NPC { } Dungeon.hero.spendAndNext( 2f ); Badges.validateItemLevelAquired( first ); + Item.updateQuickslot(); Quest.reforged = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java index 01552dce5..2b7bbcbfe 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java @@ -78,9 +78,7 @@ public class SandalsOfNature extends Artifact { if (action.equals(AC_FEED)){ - selectingFootwear = this; GameScene.selectItem(itemSelector, mode, Messages.get(this, "prompt")); - selectingFootwear = null; } else if (action.equals(AC_ROOT) && level() > 0){ @@ -140,11 +138,10 @@ public class SandalsOfNature extends Artifact { return super.upgrade(); } - private static SandalsOfNature selectingFootwear = null; - public static boolean canUseSeed(Item item){ if (item instanceof Plant.Seed){ - return selectingFootwear == null || !selectingFootwear.seeds.contains(item.getClass()); + return !(curItem instanceof SandalsOfNature) || + !((SandalsOfNature) curItem).seeds.contains(item.getClass()); } return false; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java index 8c3d60cec..d89597b63 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java @@ -91,14 +91,18 @@ public class WandOfFireblast extends DamageWand { for ( Char ch : affectedChars ){ processSoulMark(ch, chargesPerCast()); ch.damage(damageRoll(), this); - Buff.affect( ch, Burning.class ).reignite( ch ); - switch(chargesPerCast()){ - case 1: - break; //no effects - case 2: - Buff.affect(ch, Cripple.class, 4f); break; - case 3: - Buff.affect(ch, Paralysis.class, 4f); break; + if (ch.isAlive()) { + Buff.affect(ch, Burning.class).reignite(ch); + switch (chargesPerCast()) { + case 1: + break; //no effects + case 2: + Buff.affect(ch, Cripple.class, 4f); + break; + case 3: + Buff.affect(ch, Paralysis.class, 4f); + break; + } } } } @@ -139,6 +143,7 @@ public class WandOfFireblast extends DamageWand { bolt.path.get(dist/2), callback ); Sample.INSTANCE.play( Assets.Sounds.ZAP ); + Sample.INSTANCE.play( Assets.Sounds.BURNING ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java index 00d2ff1d5..ca9aebfd5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java @@ -63,11 +63,10 @@ public class Dart extends MissileWeapon { @Override public void execute(Hero hero, String action) { + super.execute(hero, action); if (action.equals(AC_TIP)){ GameScene.selectItem(itemSelector, WndBag.Mode.SEED, Messages.get(this, "prompt")); } - - super.execute(hero, action); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java index b613106df..a5fcf228a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/TippedDart.java @@ -72,6 +72,7 @@ public abstract class TippedDart extends Dart { @Override public void execute(final Hero hero, String action) { + super.execute(hero, action); if (action.equals( AC_CLEAN )){ GameScene.show(new WndOptions(Messages.get(this, "clean_title"), @@ -100,7 +101,6 @@ public abstract class TippedDart extends Dart { }); } - super.execute(hero, action); } //exact same damage as regular darts, despite being higher tier. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java index 190305a71..3232841a1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/NewPrisonBossLevel.java @@ -571,9 +571,9 @@ public class NewPrisonBossLevel extends Level { PathFinder.buildDistanceMap(tenguPos, BArray.not(trapsPatch, null)); //note that the effective range of fill is 40%-90% //so distance to tengu starts at 3-6 tiles and scales up to 7-8 as fill increases - } while (PathFinder.distance[heroPos] > Math.ceil(4 + 4*fill) - || PathFinder.distance[heroPos] < Math.ceil(7*fill)); - + } while (((PathFinder.distance[heroPos] < Math.ceil(7*fill)) + || (PathFinder.distance[heroPos] > Math.ceil(4 + 4*fill)))); + PathFinder.setMapSize(width(), height()); for (int i = 0; i < trapsPatch.length; i++){ diff --git a/services/updates/githubUpdates/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/updates/GitHubUpdates.java b/services/updates/githubUpdates/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/updates/GitHubUpdates.java index a649fc581..c601fc01d 100644 --- a/services/updates/githubUpdates/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/updates/GitHubUpdates.java +++ b/services/updates/githubUpdates/src/main/java/com/shatteredpixel/shatteredpixeldungeon/services/updates/GitHubUpdates.java @@ -43,6 +43,7 @@ public class GitHubUpdates extends UpdateService { if (!Game.platform.connectedToUnmeteredNetwork()){ callback.onConnectionFailed(); + return; } Net.HttpRequest httpGet = new Net.HttpRequest(Net.HttpMethods.GET);