diff --git a/SPD-classes/src/main/java/com/watabou/utils/Bundle.java b/SPD-classes/src/main/java/com/watabou/utils/Bundle.java index 36ecb4953..1beb5043b 100644 --- a/SPD-classes/src/main/java/com/watabou/utils/Bundle.java +++ b/SPD-classes/src/main/java/com/watabou/utils/Bundle.java @@ -521,6 +521,7 @@ public class Bundle { try { json = new JSONTokener(jsonString).nextValue(); } catch (Exception e){ + //TODO support for v1.1.X saves has been dropped, can probably remove this soon //if the string can't be tokenized, it may be written by v1.1.X, which used libGDX JSON. // Some of these are written in a 'minified' format, some have duplicate keys. // We read them in with the libGDX JSON code, fix duplicates, write as full JSON diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java index 108a55acb..60ea34ad6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Badges.java @@ -222,9 +222,7 @@ public class Badges { private static final HashSet removedBadges = new HashSet<>(); static{ - //v1.3.0 (These were removed and re-added internally as new unlock reqs were added) - removedBadges.add("YASD"); - removedBadges.add("DEATH_FROM_GLYPH"); + //no removed badges currently } private static final HashMap renamedBadges = new HashMap<>(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java index 65071a3b2..d86e49437 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/GamesInProgress.java @@ -107,8 +107,8 @@ public class GamesInProgress { info.slot = slot; Dungeon.preview(info, bundle); - //saves from before v1.2.3 are not supported - if (info.version < ShatteredPixelDungeon.v1_2_3) { + //saves from before v1.4.3 are not supported + if (info.version < ShatteredPixelDungeon.v1_4_3) { 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 252388a1c..aa6b0f184 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -34,14 +34,14 @@ import com.watabou.utils.PlatformSupport; public class ShatteredPixelDungeon extends Game { //variable constants for specific older versions of shattered, used for data conversion - //versions older than v1.2.3 are no longer supported, and data from them is ignored - public static final int v1_2_3 = 628; - public static final int v1_3_2 = 648; - public static final int v1_4_3 = 668; + public static final int v1_2_3 = 628; //v1.2.3 is kept for now, for old rankings score logic - public static final int v2_0_2 = 700; - public static final int v2_1_4 = 737; //iOS was 737, other platforms were 736 - public static final int v2_2_0 = 753; + //savegames from versions older than v1.4.3 are no longer supported, and data from them is ignored + public static final int v1_4_3 = 668; + + public static final int v2_0_2 = 700; + public static final int v2_1_4 = 737; //iOS was 737, other platforms were 736 + public static final int v2_2_1 = 755; //iOS was 755 (also called v2.2.2), other platforms were 754 public ShatteredPixelDungeon( PlatformSupport platform ) { super( sceneClass == null ? WelcomeScene.class : sceneClass, platform ); @@ -68,24 +68,6 @@ public class ShatteredPixelDungeon extends Game { com.watabou.utils.Bundle.addAlias( com.shatteredpixel.shatteredpixeldungeon.levels.rooms.quest.RotGardenRoom.class, "com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.RotGardenRoom" ); - - //pre-v1.3.0 - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding.class, - "com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm$FallBleed" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.plants.Mageroyal.class, - "com.shatteredpixel.shatteredpixeldungeon.plants.Dreamfoil" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.plants.Mageroyal.Seed.class, - "com.shatteredpixel.shatteredpixeldungeon.plants.Dreamfoil$Seed" ); - - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Dazzling.class, - "com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Exhausting" ); - com.watabou.utils.Bundle.addAlias( - com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Explosive.class, - "com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Fragile" ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java index c175e64d9..b53c37748 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Talent.java @@ -459,7 +459,6 @@ public enum Talent { } public static class CachedRationsDropped extends CounterBuff{{revivePersists = true;}}; - public static class NatureBerriesAvailable extends CounterBuff{{revivePersists = true;}}; //for pre-1.3.0 saves public static class NatureBerriesDropped extends CounterBuff{{revivePersists = true;}}; public static void onFoodEaten( Hero hero, float foodVal, Item foodSource ){ @@ -939,8 +938,6 @@ public enum Talent { static{ //v2.2.0 removedTalents.add("EMPOWERING_SCROLLS"); - //v1.4.0 - removedTalents.add("BERSERKING_STAMINA"); } private static final HashMap renamedTalents = new HashMap<>(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java index 58c761b92..03757f4ad 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/ItemStatusHandler.java @@ -118,11 +118,6 @@ public class ItemStatusHandler { Class item = items[i]; String itemName = item.getSimpleName(); - //pre-1.4.0 saves - if (!bundle.contains( itemName + PFX_LABEL )){ - itemName = item.toString(); - } - if (bundle.contains( itemName + PFX_LABEL )) { String label = bundle.getString( itemName + PFX_LABEL ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java index 64ecabe82..aaea586a5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CavesBossLevel.java @@ -189,13 +189,6 @@ public class CavesBossLevel extends Level { public void restoreFromBundle(Bundle bundle) { super.restoreFromBundle(bundle); - //pre-1.3.0 saves, modifies exit transition with custom size - if (bundle.contains("exit")){ - LevelTransition exit = getTransition(LevelTransition.Type.REGULAR_EXIT); - exit.set(14, 0, 18, 2); - transitions.add(exit); - } - for (CustomTilemap c : customTiles){ if (c instanceof ArenaVisuals){ customArenaVisuals = (ArenaVisuals) c; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java index e39ea2855..957fde74a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/CityBossLevel.java @@ -123,12 +123,6 @@ public class CityBossLevel extends Level { @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle( bundle ); - //pre-1.3.0 saves, modifies exit transition with custom size - if (bundle.contains("exit")){ - LevelTransition exit = getTransition(LevelTransition.Type.REGULAR_EXIT); - exit.set(end.left+4, end.top+4, end.left+4+6, end.top+4+4); - transitions.add(exit); - } impShop = (ImpShopRoom) bundle.get( IMP_SHOP ); if (map[topDoor] != Terrain.LOCKED_DOOR && Imp.Quest.isCompleted() && !impShop.shopSpawned()){ spawnShop(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java index d93dbadd7..461f54e24 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/HallsBossLevel.java @@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.levels; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Bones; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; -import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; @@ -323,8 +322,6 @@ public class HallsBossLevel extends Level { @Override public boolean activateTransition(Hero hero, LevelTransition transition) { if (transition.type == LevelTransition.Type.REGULAR_ENTRANCE - //ascension challenge only works on runs started on v1.3+ - && Dungeon.initialVersion > ShatteredPixelDungeon.v1_2_3 && hero.belongings.getItem(Amulet.class) != null && hero.buff(AscensionChallenge.class) == null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java index af266924e..54004ff7a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/LastLevel.java @@ -229,9 +229,6 @@ public class LastLevel extends Level { @Override public void restoreFromBundle(Bundle bundle) { - //pre-1.3.0 saves, deletes unneeded exit - if (bundle.contains("exit")) bundle.remove("exit"); - super.restoreFromBundle(bundle); for (int i=0; i < length(); i++) { int flags = Terrain.flags[map[i]]; 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 d4d10a2c0..ea0445524 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -327,8 +327,8 @@ public abstract class Level implements Bundlable { version = bundle.getInt( VERSION ); - //saves from before v1.2.3 are not supported - if (version < ShatteredPixelDungeon.v1_2_3){ + //saves from before v1.4.3 are not supported + if (version < ShatteredPixelDungeon.v1_4_3){ throw new RuntimeException("old save"); } @@ -348,21 +348,8 @@ public abstract class Level implements Bundlable { mapped = bundle.getBooleanArray( MAPPED ); transitions = new ArrayList<>(); - if (bundle.contains(TRANSITIONS)){ - for (Bundlable b : bundle.getCollection( TRANSITIONS )){ - transitions.add((LevelTransition) b); - } - //pre-1.3.0 saves, converts old entrance/exit to new transitions - } else { - if (bundle.contains("entrance")){ - transitions.add(new LevelTransition( - this, - bundle.getInt("entrance"), - Dungeon.depth == 1 ? LevelTransition.Type.SURFACE : LevelTransition.Type.REGULAR_ENTRANCE)); - } - if (bundle.contains("exit")){ - transitions.add(new LevelTransition(this, bundle.getInt("exit"), LevelTransition.Type.REGULAR_EXIT)); - } + for (Bundlable b : bundle.getCollection( TRANSITIONS )){ + transitions.add((LevelTransition) b); } locked = bundle.getBoolean( LOCKED ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index e70d2c965..3e6f6712f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -132,20 +132,6 @@ public class PrisonBossLevel extends Level { public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); state = bundle.getEnum( STATE, State.class ); - - //pre-1.3.0 saves, recreates custom exit and entrance transitions - if (bundle.contains("entrance")){ - transitions.clear(); - if (state == State.START || state == State.WON){ - transitions.add(new LevelTransition(this, ENTRANCE_POS, LevelTransition.Type.REGULAR_ENTRANCE)); - } - if (state == State.WON){ - LevelTransition exit = new LevelTransition(this, pointToCell(levelExit), LevelTransition.Type.REGULAR_EXIT); - exit.right+=2; - exit.bottom+=3; - transitions.add(exit); - } - } //in some states tengu won't be in the world, in others he will be. if (state == State.START || state == State.FIGHT_PAUSE) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java index ffa149eaa..32fb02eff 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/SewerBossLevel.java @@ -222,11 +222,6 @@ public class SewerBossLevel extends SewerLevel { @Override public void restoreFromBundle( Bundle bundle ) { - //pre-1.3.0 saves - if (bundle.getInt("stairs") != 0){ - bundle.put("entrance", bundle.getInt("stairs")); - bundle.remove("stairs"); - } super.restoreFromBundle( bundle ); roomExit = roomEntrance; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java index 55c53068b..62e85882e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/features/HighGrass.java @@ -88,13 +88,6 @@ public class HighGrass { if (ch instanceof Hero && ((Hero) ch).hasTalent(Talent.NATURES_BOUNTY)){ int berriesAvailable = 2 + 2*((Hero) ch).pointsInTalent(Talent.NATURES_BOUNTY); - //pre-1.3.0 saves - Talent.NatureBerriesAvailable oldAvailable = ch.buff(Talent.NatureBerriesAvailable.class); - if (oldAvailable != null){ - Buff.affect(ch, Talent.NatureBerriesDropped.class).countUp(berriesAvailable - oldAvailable.count()); - oldAvailable.detach(); - } - Talent.NatureBerriesDropped dropped = Buff.affect(ch, Talent.NatureBerriesDropped.class); berriesAvailable -= dropped.count(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java index 31c54d3c2..aa4166003 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/HeroSelectScene.java @@ -654,9 +654,9 @@ public class HeroSelectScene extends PixelScene { if (diff <= 0) { long time = Game.realTime - (Game.realTime % DAY); - //earliest possible daily for v1.4.0 is Sept 10 2022 - //which is 19,245 days after Jan 1 1970 - time = Math.max(time, 19_245 * DAY); + //earliest possible daily for v2.2.X is Oct 05 2023 + //which is 19,635 days after Jan 1 1970 + time = Math.max(time, 19_635 * DAY); SPDSettings.lastDaily(time); Dungeon.dailyReplay = false; 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 6e672c4bb..148434ca2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java @@ -53,7 +53,7 @@ import java.util.Collections; public class WelcomeScene extends PixelScene { - private static final int LATEST_UPDATE = ShatteredPixelDungeon.v2_2_0; + private static final int LATEST_UPDATE = ShatteredPixelDungeon.v2_2_1; //used so that the game does not keep showing the window forever if cleaning fails private static boolean triedCleaningTemp = false;