From 7ac77270930c5d2099bd2562dfafff93c10f98d5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 23 May 2019 15:29:31 -0400 Subject: [PATCH] v0.7.3: removed support for pre-0.6.5c saves --- .../shatteredpixeldungeon/Dungeon.java | 7 --- .../GamesInProgress.java | 4 +- .../ShatteredPixelDungeon.java | 47 +------------------ .../items/armor/Armor.java | 3 +- .../items/rings/Ring.java | 5 -- .../items/weapon/Weapon.java | 10 +--- .../items/weapon/missiles/MissileWeapon.java | 11 +---- .../journal/Catalog.java | 5 -- .../shatteredpixeldungeon/levels/Level.java | 4 +- .../scenes/WelcomeScene.java | 30 +----------- 10 files changed, 9 insertions(+), 117 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java index dd03a0ec1..4e602485e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Dungeon.java @@ -140,13 +140,6 @@ public class Dungeon { } } - //saves prior to 0.6.4 - if (bundle.contains("SEED_POUCH")) { - LimitedDrops.VELVET_POUCH.count = bundle.getInt("SEED_POUCH"); - } - if (bundle.contains("WAND_HOLSTER")) { - LimitedDrops.MAGICAL_HOLSTER.count = bundle.getInt("WAND_HOLSTER"); - } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java index 1994de382..3a62b0f92 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java @@ -103,8 +103,8 @@ public class GamesInProgress { info.slot = slot; Dungeon.preview(info, bundle); - //saves from before 0.6.2e are not supported - if (info.version < ShatteredPixelDungeon.v0_6_2e) { + //saves from before 0.6.5c are not supported + if (info.version < ShatteredPixelDungeon.v0_6_5c) { info = null; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index 4a831a0bf..4bd55fa5c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -40,10 +40,7 @@ import javax.microedition.khronos.opengles.GL10; public class ShatteredPixelDungeon extends Game { //variable constants for specific older versions of shattered, used for data conversion - //versions older than v0.6.2e are no longer supported, and data from them is ignored - public static final int v0_6_2e = 229; - public static final int v0_6_3b = 245; - public static final int v0_6_4a = 252; + //versions older than v0.6.5c are no longer supported, and data from them is ignored public static final int v0_6_5c = 264; public static final int v0_7_0c = 311; @@ -53,48 +50,6 @@ public class ShatteredPixelDungeon extends Game { public ShatteredPixelDungeon() { super( sceneClass == null ? WelcomeScene.class : sceneClass ); - //v0.6.3 - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Tomahawk.class, - "com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Tamahawk" ); - - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart.class, - "com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Dart" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.IncendiaryDart.class, - "com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.IncendiaryDart" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.ParalyticDart.class, - "com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.CurareDart" ); - - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfCorrosion.class, - "com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfVenom" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.actors.blobs.CorrosiveGas.class, - "com.shatteredpixel.shatteredpixeldungeon.actors.blobs.VenomGas" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corrosion.class, - "com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Venom" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.levels.traps.CorrosionTrap.class, - "com.shatteredpixel.shatteredpixeldungeon.levels.traps.VenomTrap" ); - - //v0.6.4 - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch.class, - "com.shatteredpixel.shatteredpixeldungeon.items.bags.SeedPouch" ); - - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster.class, - "com.shatteredpixel.shatteredpixeldungeon.items.bags.WandHolster" ); - - //v0.6.5 - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAugmentation.class, - "com.shatteredpixel.shatteredpixeldungeon.items.Weightstone" ); - //v0.7.0 com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb.class, 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 6073c078d..673514bdc 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 @@ -145,8 +145,7 @@ public class Armor extends EquipableItem { availableUsesToID = USES_TO_ID/2f; } - //pre-0.6.5 saves - if (bundle.contains(AUGMENT)) augment = bundle.getEnum(AUGMENT, Augment.class); + augment = bundle.getEnum(AUGMENT, Augment.class); } @Override 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 c67357a65..bc7432948 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 @@ -289,11 +289,6 @@ public class Ring extends KindofMisc { if (bundle.contains( "unfamiliarity" )){ levelsToID = bundle.getInt( "unfamiliarity" ) / 200f; } - - //pre-0.6.1 saves - if (level() < 0){ - upgrade(-level()); - } } public void onHeroGainExp( float levelPercent, Hero hero ){ 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 a42f284ee..1aecf35fb 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 @@ -155,15 +155,7 @@ abstract public class Weapon extends KindOfWeapon { availableUsesToID = USES_TO_ID/2f; } - //pre-0.6.5 saves - if (bundle.contains( "imbue" )){ - String imbue = bundle.getString( "imbue" ); - if (imbue.equals( "LIGHT" )) augment = Augment.SPEED; - else if (imbue.equals( "HEAVY" )) augment = Augment.DAMAGE; - else augment = Augment.NONE; - } else { - augment = bundle.getEnum(AUGMENT, Augment.class); - } + augment = bundle.getEnum(AUGMENT, Augment.class); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java index 346f22d64..4874f9433 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/MissileWeapon.java @@ -384,15 +384,6 @@ abstract public class MissileWeapon extends Weapon { bundleRestoring = true; super.restoreFromBundle(bundle); bundleRestoring = false; - //compatibility with pre-0.6.3 saves - if (bundle.contains(DURABILITY)) { - durability = bundle.getInt(DURABILITY); - } else { - durability = 100; - //reduces quantity roughly in line with new durability system - if (!(this instanceof TippedDart)){ - quantity = (int)Math.ceil(quantity/5f); - } - } + durability = bundle.getInt(DURABILITY); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java index dca2b9c04..c53b6073d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java @@ -336,12 +336,7 @@ public enum Catalog { if (bundle.contains(CATALOGS)) { List seen = Arrays.asList(bundle.getStringArray(CATALOGS)); - //pre-0.6.3 saves //TODO should adjust this to tie into the bundling system's class array - if (seen.contains("WandOfVenom")){ - WANDS.seen.put(WandOfCorrosion.class, true); - } - for (Catalog cat : values()) { for (Class item : cat.items()) { if (seen.contains(item.getSimpleName())) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 7db9a76a0..0f9354310 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -302,8 +302,8 @@ public abstract class Level implements Bundlable { version = bundle.getInt( VERSION ); - //saves from before 0.6.2e are not supported - if (version < ShatteredPixelDungeon.v0_6_2e){ + //saves from before 0.6.5c are not supported + if (version < ShatteredPixelDungeon.v0_6_5c){ throw new RuntimeException("old save"); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java index 17f681bfc..e9f941b54 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java @@ -187,38 +187,10 @@ public class WelcomeScene extends PixelScene { Journal.loadGlobal(); Document.ALCHEMY_GUIDE.addPage("Potions"); Document.ALCHEMY_GUIDE.addPage("Stones"); - Document.ALCHEMY_GUIDE.addPage("Darts"); + Document.ALCHEMY_GUIDE.addPage("Energy_Food"); Journal.saveGlobal(); } - //convert game saves from the old format - if (previousVersion <= ShatteredPixelDungeon.v0_6_2e){ - //old save file names for warrior, mage, rogue, huntress - String[] classes = new String[]{"warrior", "mage", "game", "ranger"}; - for (int i = 1; i <= classes.length; i++){ - String name = classes[i-1]; - if (FileUtils.fileExists(name + ".dat")){ - try { - Bundle gamedata = FileUtils.bundleFromFile(name + ".dat"); - FileUtils.bundleToFile(GamesInProgress.gameFile(i), gamedata); - FileUtils.deleteFile(name + ".dat"); - - //rogue's safe files have a different name - if (name.equals("game")) name = "depth"; - - int depth = 1; - while (FileUtils.fileExists(name + depth + ".dat")) { - gamedata = FileUtils.bundleFromFile(name + depth + ".dat"); - FileUtils.bundleToFile(GamesInProgress.depthFile(i, depth), gamedata); - FileUtils.deleteFile(name + depth + ".dat"); - depth++; - } - } catch (Exception e){ - } - } - } - } - SPDSettings.version(ShatteredPixelDungeon.versionCode); }