v0.7.3: removed support for pre-0.6.5c saves
This commit is contained in:
parent
1cad02e2a4
commit
7ac7727093
|
@ -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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,8 +103,8 @@ public class GamesInProgress {
|
||||||
info.slot = slot;
|
info.slot = slot;
|
||||||
Dungeon.preview(info, bundle);
|
Dungeon.preview(info, bundle);
|
||||||
|
|
||||||
//saves from before 0.6.2e are not supported
|
//saves from before 0.6.5c are not supported
|
||||||
if (info.version < ShatteredPixelDungeon.v0_6_2e) {
|
if (info.version < ShatteredPixelDungeon.v0_6_5c) {
|
||||||
info = null;
|
info = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,7 @@ import javax.microedition.khronos.opengles.GL10;
|
||||||
public class ShatteredPixelDungeon extends Game {
|
public class ShatteredPixelDungeon extends Game {
|
||||||
|
|
||||||
//variable constants for specific older versions of shattered, used for data conversion
|
//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
|
//versions older than v0.6.5c 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;
|
|
||||||
public static final int v0_6_5c = 264;
|
public static final int v0_6_5c = 264;
|
||||||
|
|
||||||
public static final int v0_7_0c = 311;
|
public static final int v0_7_0c = 311;
|
||||||
|
@ -53,48 +50,6 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
public ShatteredPixelDungeon() {
|
public ShatteredPixelDungeon() {
|
||||||
super( sceneClass == null ? WelcomeScene.class : sceneClass );
|
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
|
//v0.7.0
|
||||||
com.watabou.utils.Bundle.addAlias(
|
com.watabou.utils.Bundle.addAlias(
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb.class,
|
com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb.class,
|
||||||
|
|
|
@ -145,8 +145,7 @@ public class Armor extends EquipableItem {
|
||||||
availableUsesToID = USES_TO_ID/2f;
|
availableUsesToID = USES_TO_ID/2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
//pre-0.6.5 saves
|
augment = bundle.getEnum(AUGMENT, Augment.class);
|
||||||
if (bundle.contains(AUGMENT)) augment = bundle.getEnum(AUGMENT, Augment.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -289,11 +289,6 @@ public class Ring extends KindofMisc {
|
||||||
if (bundle.contains( "unfamiliarity" )){
|
if (bundle.contains( "unfamiliarity" )){
|
||||||
levelsToID = bundle.getInt( "unfamiliarity" ) / 200f;
|
levelsToID = bundle.getInt( "unfamiliarity" ) / 200f;
|
||||||
}
|
}
|
||||||
|
|
||||||
//pre-0.6.1 saves
|
|
||||||
if (level() < 0){
|
|
||||||
upgrade(-level());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onHeroGainExp( float levelPercent, Hero hero ){
|
public void onHeroGainExp( float levelPercent, Hero hero ){
|
||||||
|
|
|
@ -155,16 +155,8 @@ abstract public class Weapon extends KindOfWeapon {
|
||||||
availableUsesToID = USES_TO_ID/2f;
|
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
|
@Override
|
||||||
public void reset() {
|
public void reset() {
|
||||||
|
|
|
@ -384,15 +384,6 @@ abstract public class MissileWeapon extends Weapon {
|
||||||
bundleRestoring = true;
|
bundleRestoring = true;
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
bundleRestoring = false;
|
bundleRestoring = false;
|
||||||
//compatibility with pre-0.6.3 saves
|
|
||||||
if (bundle.contains(DURABILITY)) {
|
|
||||||
durability = bundle.getInt(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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -336,12 +336,7 @@ public enum Catalog {
|
||||||
if (bundle.contains(CATALOGS)) {
|
if (bundle.contains(CATALOGS)) {
|
||||||
List<String> seen = Arrays.asList(bundle.getStringArray(CATALOGS));
|
List<String> seen = Arrays.asList(bundle.getStringArray(CATALOGS));
|
||||||
|
|
||||||
//pre-0.6.3 saves
|
|
||||||
//TODO should adjust this to tie into the bundling system's class array
|
//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 (Catalog cat : values()) {
|
||||||
for (Class<? extends Item> item : cat.items()) {
|
for (Class<? extends Item> item : cat.items()) {
|
||||||
if (seen.contains(item.getSimpleName())) {
|
if (seen.contains(item.getSimpleName())) {
|
||||||
|
|
|
@ -302,8 +302,8 @@ public abstract class Level implements Bundlable {
|
||||||
|
|
||||||
version = bundle.getInt( VERSION );
|
version = bundle.getInt( VERSION );
|
||||||
|
|
||||||
//saves from before 0.6.2e are not supported
|
//saves from before 0.6.5c are not supported
|
||||||
if (version < ShatteredPixelDungeon.v0_6_2e){
|
if (version < ShatteredPixelDungeon.v0_6_5c){
|
||||||
throw new RuntimeException("old save");
|
throw new RuntimeException("old save");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,38 +187,10 @@ public class WelcomeScene extends PixelScene {
|
||||||
Journal.loadGlobal();
|
Journal.loadGlobal();
|
||||||
Document.ALCHEMY_GUIDE.addPage("Potions");
|
Document.ALCHEMY_GUIDE.addPage("Potions");
|
||||||
Document.ALCHEMY_GUIDE.addPage("Stones");
|
Document.ALCHEMY_GUIDE.addPage("Stones");
|
||||||
Document.ALCHEMY_GUIDE.addPage("Darts");
|
Document.ALCHEMY_GUIDE.addPage("Energy_Food");
|
||||||
Journal.saveGlobal();
|
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);
|
SPDSettings.version(ShatteredPixelDungeon.versionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user