From 86199bb40f64cf31140e64961f17c3cc32b2680a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 5 Feb 2019 14:12:59 -0500 Subject: [PATCH] v0.7.2: bugfixes: - fixed incorrect interactions betwee thieves and quickslots - fixed errors with new ID system and remains - screen orientation not always being set when app starts --- .../ShatteredPixelDungeon.java | 18 ++++++++---------- .../actors/mobs/Thief.java | 2 +- .../items/armor/Armor.java | 1 + .../items/rings/Ring.java | 1 + .../items/wands/Wand.java | 12 ++++++++---- .../items/weapon/Weapon.java | 6 ++++++ 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 401acd9ef..480602e62 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -225,16 +225,14 @@ public class ShatteredPixelDungeon extends Game { public void updateDisplaySize(){ boolean landscape = SPDSettings.landscape(); - if (landscape != (width > height)) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { - instance.setRequestedOrientation(landscape ? - ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : - ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); - } else { - instance.setRequestedOrientation(landscape ? - ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : - ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + instance.setRequestedOrientation(landscape ? + ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : + ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); + } else { + instance.setRequestedOrientation(landscape ? + ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : + ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } if (view.getMeasuredWidth() == 0 || view.getMeasuredHeight() == 0) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java index 3111c48bb..4869350ef 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Thief.java @@ -139,7 +139,7 @@ public class Thief extends Mob { if (item != null && !item.unique && item.level() < 1 ) { GLog.w( Messages.get(Thief.class, "stole", item.name()) ); - if (!item.stackable || hero.belongings.getSimilar(item) == null) { + if (!item.stackable) { Dungeon.quickslot.convertToPlaceholder(item); } item.updateQuickslot(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index d21187c7c..fa1cdf142 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -140,6 +140,7 @@ public class Armor extends EquipableItem { @Override public void reset() { super.reset(); + levelsToID = 1; //armor can be kept in bones between runs, the seal cannot. seal = null; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index 7b09dd8fc..7b31c5ac2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -117,6 +117,7 @@ public class Ring extends KindofMisc { public void reset() { super.reset(); + levelsToID = 1; if (handler != null && handler.contains(this)){ image = handler.image(this); gem = handler.label(this); 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 e85ffaf76..2904006c4 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 @@ -57,8 +57,6 @@ import java.util.ArrayList; public abstract class Wand extends Item { - private static final int USAGES_TO_KNOW = 20; - public static final String AC_ZAP = "ZAP"; private static final float TIME_TO_ZAP = 1f; @@ -70,8 +68,7 @@ public abstract class Wand extends Item { protected Charger charger; private boolean curChargeKnown = false; - - protected int usagesToKnow = USAGES_TO_KNOW; + private float levelsToID = 1; //wands can't be equipped, so the player needs to use them in addition to gaining exp //takes 5 charges spent, giving 15% exp gain each, plus 25% given right away @@ -369,6 +366,13 @@ public abstract class Wand extends Item { partialCharge = bundle.getFloat( PARTIALCHARGE ); } + @Override + public void reset() { + super.reset(); + levelsToID = 1; + levelsToIDAvailable = 0.25f; + } + protected static CellSelector.Listener zapper = new CellSelector.Listener() { @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index d24b8c9f6..2a24b3083 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -156,6 +156,12 @@ abstract public class Weapon extends KindOfWeapon { } } + @Override + public void reset() { + super.reset(); + levelsToID = 1; + } + @Override public float accuracyFactor( Char owner ) {