v1.1.0: dropped support for saves prior to v0.9.0b
This commit is contained in:
parent
e582de3132
commit
5a091dd781
|
@ -102,8 +102,8 @@ public class GamesInProgress {
|
|||
info.slot = slot;
|
||||
Dungeon.preview(info, bundle);
|
||||
|
||||
//saves from before v0.8.0b are not supported
|
||||
if (info.version < ShatteredPixelDungeon.v0_8_0b) {
|
||||
//saves from before v0.9.0b are not supported
|
||||
if (info.version < ShatteredPixelDungeon.v0_9_0b) {
|
||||
info = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,11 +34,7 @@ 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 v0.8.0b are no longer supported, and data from them is ignored
|
||||
public static final int v0_8_0b = 414;
|
||||
public static final int v0_8_1a = 422;
|
||||
public static final int v0_8_2d = 463;
|
||||
|
||||
//versions older than v0.9.0b are no longer supported, and data from them is ignored
|
||||
public static final int v0_9_0b = 489;
|
||||
public static final int v0_9_1d = 511;
|
||||
public static final int v0_9_2b = 531;
|
||||
|
|
|
@ -152,46 +152,19 @@ public class Belongings implements Iterable<Item> {
|
|||
backpack.restoreFromBundle( bundle );
|
||||
|
||||
weapon = (KindOfWeapon) bundle.get(WEAPON);
|
||||
if (weapon() != null) {
|
||||
weapon().activate(owner);
|
||||
}
|
||||
if (weapon() != null) weapon().activate(owner);
|
||||
|
||||
armor = (Armor)bundle.get( ARMOR );
|
||||
if (armor() != null){
|
||||
armor().activate( owner );
|
||||
}
|
||||
if (armor() != null) armor().activate( owner );
|
||||
|
||||
//pre-0.8.2
|
||||
if (bundle.contains("misc1") || bundle.contains("misc2")){
|
||||
artifact = null;
|
||||
misc = null;
|
||||
ring = null;
|
||||
artifact = (Artifact) bundle.get(ARTIFACT);
|
||||
if (artifact() != null) artifact().activate(owner);
|
||||
|
||||
KindofMisc m = (KindofMisc)bundle.get("misc1");
|
||||
if (m instanceof Artifact){
|
||||
artifact = (Artifact) m;
|
||||
} else if (m instanceof Ring) {
|
||||
ring = (Ring) m;
|
||||
}
|
||||
misc = (KindofMisc) bundle.get(MISC);
|
||||
if (misc() != null) misc().activate( owner );
|
||||
|
||||
m = (KindofMisc)bundle.get("misc2");
|
||||
if (m instanceof Artifact){
|
||||
if (artifact == null) artifact = (Artifact) m;
|
||||
else misc = (Artifact) m;
|
||||
} else if (m instanceof Ring) {
|
||||
if (ring == null) ring = (Ring) m;
|
||||
else misc = (Ring) m;
|
||||
}
|
||||
|
||||
} else {
|
||||
artifact = (Artifact) bundle.get(ARTIFACT);
|
||||
misc = (KindofMisc) bundle.get(MISC);
|
||||
ring = (Ring) bundle.get(RING);
|
||||
}
|
||||
|
||||
if (artifact() != null) artifact().activate(owner);
|
||||
if (misc() != null) misc().activate( owner );
|
||||
if (ring() != null) ring().activate( owner );
|
||||
ring = (Ring) bundle.get(RING);
|
||||
if (ring() != null) ring().activate( owner );
|
||||
}
|
||||
|
||||
public static void preview( GamesInProgress.Info info, Bundle bundle ) {
|
||||
|
|
|
@ -674,18 +674,6 @@ public class Generator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//pre-0.8.1
|
||||
if (bundle.contains("spawned_artifacts")) {
|
||||
for (Class<? extends Artifact> artifact : bundle.getClassArray("spawned_artifacts")) {
|
||||
Category cat = Category.ARTIFACT;
|
||||
for (int i = 0; i < cat.classes.length; i++) {
|
||||
if (cat.classes[i].equals(artifact)) {
|
||||
cat.probs[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -334,21 +334,15 @@ public enum Catalog {
|
|||
}
|
||||
|
||||
//general save/load
|
||||
//includes "catalogs" for pre-0.8.2 saves
|
||||
if (bundle.contains("catalogs") || bundle.contains(CATALOG_ITEMS)) {
|
||||
if (bundle.contains(CATALOG_ITEMS)) {
|
||||
List<Class> seenClasses = new ArrayList<>();
|
||||
if (bundle.contains(CATALOG_ITEMS)) {
|
||||
seenClasses = Arrays.asList(bundle.getClassArray(CATALOG_ITEMS));
|
||||
}
|
||||
List<String> seenItems = new ArrayList<>();
|
||||
if (bundle.contains("catalogs")) {
|
||||
Journal.saveNeeded = true; //we want to overwrite with the newer storage format
|
||||
seenItems = Arrays.asList(bundle.getStringArray("catalogs"));
|
||||
}
|
||||
|
||||
for (Catalog cat : values()) {
|
||||
for (Class<? extends Item> item : cat.items()) {
|
||||
if (seenClasses.contains(item) || seenItems.contains(item.getSimpleName())) {
|
||||
if (seenClasses.contains(item)) {
|
||||
cat.seen.put(item, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,20 +157,6 @@ public class CavesBossLevel extends Level {
|
|||
customArenaVisuals = (ArenaVisuals) c;
|
||||
}
|
||||
}
|
||||
|
||||
//pre-0.8.1 saves that may not have had pylons added
|
||||
int gatePos = pointToCell(new Point(gate.left, gate.top));
|
||||
if (!locked && solid[gatePos]){
|
||||
|
||||
for (int i : pylonPositions) {
|
||||
if (findMob(i) == null) {
|
||||
Pylon pylon = new Pylon();
|
||||
pylon.pos = i;
|
||||
mobs.add(pylon);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -309,8 +309,8 @@ public abstract class Level implements Bundlable {
|
|||
|
||||
version = bundle.getInt( VERSION );
|
||||
|
||||
//saves from before v0.8.0b are not supported
|
||||
if (version < ShatteredPixelDungeon.v0_8_0b){
|
||||
//saves from before v0.9.0b are not supported
|
||||
if (version < ShatteredPixelDungeon.v0_9_0b){
|
||||
throw new RuntimeException("old save");
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,6 @@ public class PrisonBossLevel extends Level {
|
|||
public enum State {
|
||||
START,
|
||||
FIGHT_START,
|
||||
TRAP_MAZES, //pre-0.8.1 saves
|
||||
FIGHT_PAUSE,
|
||||
FIGHT_ARENA,
|
||||
WON
|
||||
|
@ -118,7 +117,7 @@ public class PrisonBossLevel extends Level {
|
|||
state = bundle.getEnum( STATE, State.class );
|
||||
|
||||
//in some states tengu won't be in the world, in others he will be.
|
||||
if (state == State.START || state == State.TRAP_MAZES || state == State.FIGHT_PAUSE) {
|
||||
if (state == State.START || state == State.FIGHT_PAUSE) {
|
||||
tengu = (Tengu)bundle.get( TENGU );
|
||||
} else {
|
||||
for (Mob mob : mobs){
|
||||
|
@ -417,7 +416,6 @@ public class PrisonBossLevel extends Level {
|
|||
state = State.FIGHT_PAUSE;
|
||||
break;
|
||||
|
||||
case TRAP_MAZES: //for pre-0.8.1 saves
|
||||
case FIGHT_PAUSE:
|
||||
|
||||
Dungeon.hero.interrupt();
|
||||
|
@ -503,7 +501,6 @@ public class PrisonBossLevel extends Level {
|
|||
progress();
|
||||
}
|
||||
break;
|
||||
case TRAP_MAZES: //pre-0.8.1
|
||||
case FIGHT_PAUSE:
|
||||
|
||||
if (cellToPoint(ch.pos).y <= startHallway.top+1){
|
||||
|
|
Loading…
Reference in New Issue
Block a user