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
This commit is contained in:
Evan Debenham 2019-02-05 14:12:59 -05:00
parent 007bc46829
commit 86199bb40f
6 changed files with 25 additions and 15 deletions

View File

@ -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)

View File

@ -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();

View File

@ -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;
}

View File

@ -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);

View File

@ -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

View File

@ -156,6 +156,12 @@ abstract public class Weapon extends KindOfWeapon {
}
}
@Override
public void reset() {
super.reset();
levelsToID = 1;
}
@Override
public float accuracyFactor( Char owner ) {