v3.2.0: dropped support for saves older than v2.4.2

This commit is contained in:
Evan Debenham
2025-07-31 12:10:05 -04:00
parent 826aed42eb
commit a369095ee8
7 changed files with 8 additions and 37 deletions
@@ -112,7 +112,7 @@ public class GamesInProgress {
Bundle bundle = FileUtils.bundleFromFile(gameFile(slot)); Bundle bundle = FileUtils.bundleFromFile(gameFile(slot));
if (bundle.getInt( "version" ) < ShatteredPixelDungeon.v2_3_2) { if (bundle.getInt( "version" ) < ShatteredPixelDungeon.v2_4_2) {
info = null; info = null;
} else { } else {
@@ -36,8 +36,7 @@ public class ShatteredPixelDungeon extends Game {
//rankings from v1.2.3 and older use a different score formula, so this reference is kept //rankings from v1.2.3 and older use a different score formula, so this reference is kept
public static final int v1_2_3 = 628; public static final int v1_2_3 = 628;
//savegames from versions older than v2.3.2 are no longer supported, and data from them is ignored //savegames from versions older than v2.4.2 are no longer supported, and data from them is ignored
public static final int v2_3_2 = 768;
public static final int v2_4_2 = 782; public static final int v2_4_2 = 782;
public static final int v2_5_4 = 802; public static final int v2_5_4 = 802;
@@ -67,30 +66,6 @@ public class ShatteredPixelDungeon extends Game {
com.watabou.utils.Bundle.addAlias( com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invulnerability.class, com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invulnerability.class,
"com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AnkhInvulnerability" ); "com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AnkhInvulnerability" );
//pre-v2.4.0
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.UnstableBrew.class,
"com.shatteredpixel.shatteredpixeldungeon.items.potions.AlchemicalCatalyst" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.spells.UnstableSpell.class,
"com.shatteredpixel.shatteredpixeldungeon.items.spells.ArcaneCatalyst" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfFeatherFall.class,
"com.shatteredpixel.shatteredpixeldungeon.items.spells.FeatherFall" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfFeatherFall.FeatherBuff.class,
"com.shatteredpixel.shatteredpixeldungeon.items.spells.FeatherFall$FeatherBuff" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.AquaBrew.class,
"com.shatteredpixel.shatteredpixeldungeon.items.spells.AquaBlast" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.entrance.EntranceRoom.class,
"com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom" );
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.exit.ExitRoom.class,
"com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.ExitRoom" );
} }
@Override @Override
@@ -1149,15 +1149,12 @@ public enum Talent {
private static final HashSet<String> removedTalents = new HashSet<>(); private static final HashSet<String> removedTalents = new HashSet<>();
static{ static{
//v2.4.0 //nothing atm
removedTalents.add("TEST_SUBJECT");
removedTalents.add("TESTED_HYPOTHESIS");
} }
private static final HashMap<String, String> renamedTalents = new HashMap<>(); private static final HashMap<String, String> renamedTalents = new HashMap<>();
static{ static{
//v2.4.0 //nothing atm
renamedTalents.put("SECONDARY_CHARGE", "VARIED_CHARGE");
} }
public static void restoreTalentsFromBundle( Bundle bundle, Hero hero ){ public static void restoreTalentsFromBundle( Bundle bundle, Hero hero ){
@@ -364,7 +364,7 @@ public abstract class Level implements Bundlable {
version = bundle.getInt( VERSION ); version = bundle.getInt( VERSION );
//saves from before v2.3.2 are not supported //saves from before v2.3.2 are not supported
if (version < ShatteredPixelDungeon.v2_3_2){ if (version < ShatteredPixelDungeon.v2_4_2){
throw new RuntimeException("old save"); throw new RuntimeException("old save");
} }
@@ -525,7 +525,7 @@ public abstract class RegularLevel extends Level {
Random.popGenerator(); Random.popGenerator();
//cached rations try to drop in a special room on floors 2/4/7, to a max of 2/3 //cached rations try to drop in a special room on floors 2/4/7, to a max of 2/3
//we incremented dropped by 2 for compatibility with pre-v2.4 saves (when the talent dropped 4/6 items) //we increment dropped by 2 for compatibility with old saves, when the talent dropped 4/6 items
Random.pushGenerator( Random.Long() ); Random.pushGenerator( Random.Long() );
if (Dungeon.hero.hasTalent(Talent.CACHED_RATIONS)){ if (Dungeon.hero.hasTalent(Talent.CACHED_RATIONS)){
Talent.CachedRationsDropped dropped = Buff.affect(Dungeon.hero, Talent.CachedRationsDropped.class); Talent.CachedRationsDropped dropped = Buff.affect(Dungeon.hero, Talent.CachedRationsDropped.class);
@@ -301,7 +301,7 @@ public class WelcomeScene extends PixelScene {
} }
Dungeon.daily = Dungeon.dailyReplay = false; Dungeon.daily = Dungeon.dailyReplay = false;
if (previousVersion <= ShatteredPixelDungeon.v2_3_2){ if (previousVersion <= ShatteredPixelDungeon.v2_4_2){
Document.ADVENTURERS_GUIDE.findPage(Document.GUIDE_ALCHEMY); Document.ADVENTURERS_GUIDE.findPage(Document.GUIDE_ALCHEMY);
} }
@@ -204,8 +204,7 @@ public class WndBlacksmith extends Window {
} }
//public so that it can be directly called for pre-v2.2.0 quest completions protected static class WndReforge extends Window {
public static class WndReforge extends Window {
private static final int WIDTH = 120; private static final int WIDTH = 120;