v0.4.0: Removed a bunch of legacy logic
This commit is contained in:
parent
96c9ca6de4
commit
3e5db4af17
|
@ -36,7 +36,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesBossLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesBossLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CityBossLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.CityBossLevel;
|
||||||
|
@ -308,15 +307,6 @@ public class Dungeon {
|
||||||
Light light = hero.buff( Light.class );
|
Light light = hero.buff( Light.class );
|
||||||
hero.viewDistance = light == null ? level.viewDistance : Math.max( Light.DISTANCE, level.viewDistance );
|
hero.viewDistance = light == null ? level.viewDistance : Math.max( Light.DISTANCE, level.viewDistance );
|
||||||
|
|
||||||
//logic for pre 0.3.0 saves, need to give mages a staff.
|
|
||||||
if (Dungeon.version <= 38 && Dungeon.hero.heroClass == HeroClass.MAGE){
|
|
||||||
MagesStaff staff = new MagesStaff();
|
|
||||||
staff.identify();
|
|
||||||
if (!staff.collect(Dungeon.hero.belongings.backpack)){
|
|
||||||
Dungeon.level.drop(staff, Dungeon.hero.pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
observe();
|
observe();
|
||||||
try {
|
try {
|
||||||
saveAll();
|
saveAll();
|
||||||
|
@ -388,11 +378,6 @@ public class Dungeon {
|
||||||
private static final String QUESTS = "quests";
|
private static final String QUESTS = "quests";
|
||||||
private static final String BADGES = "badges";
|
private static final String BADGES = "badges";
|
||||||
|
|
||||||
//TODO: to support pre-0.2.3 saves, remove when needed
|
|
||||||
private static final String POS = "potionsOfStrength";
|
|
||||||
private static final String SOU = "scrollsOfEnhancement";
|
|
||||||
private static final String AS = "arcaneStyli";
|
|
||||||
|
|
||||||
public static String gameFile( HeroClass cl ) {
|
public static String gameFile( HeroClass cl ) {
|
||||||
switch (cl) {
|
switch (cl) {
|
||||||
case WARRIOR:
|
case WARRIOR:
|
||||||
|
@ -549,21 +534,10 @@ public class Dungeon {
|
||||||
if (fullLoad) {
|
if (fullLoad) {
|
||||||
transmutation = bundle.getInt( WT );
|
transmutation = bundle.getInt( WT );
|
||||||
|
|
||||||
//TODO: adjust this when dropping support for pre-0.2.3 saves
|
|
||||||
if (bundle.contains( LIMDROPS )) {
|
|
||||||
int[] dropValues = bundle.getIntArray(LIMDROPS);
|
int[] dropValues = bundle.getIntArray(LIMDROPS);
|
||||||
for (limitedDrops value : limitedDrops.values())
|
for (limitedDrops value : limitedDrops.values())
|
||||||
value.count = value.ordinal() < dropValues.length ?
|
value.count = value.ordinal() < dropValues.length ?
|
||||||
dropValues[value.ordinal()] : 0;
|
dropValues[value.ordinal()] : 0;
|
||||||
} else {
|
|
||||||
for (limitedDrops value : limitedDrops.values())
|
|
||||||
value.count = 0;
|
|
||||||
limitedDrops.strengthPotions.count = bundle.getInt(POS);
|
|
||||||
limitedDrops.upgradeScrolls.count = bundle.getInt(SOU);
|
|
||||||
limitedDrops.arcaneStyli.count = bundle.getInt(AS);
|
|
||||||
}
|
|
||||||
//for pre-0.2.4 saves
|
|
||||||
if (bundle.getBoolean(DV)) limitedDrops.dewVial.drop();
|
|
||||||
|
|
||||||
chapters = new HashSet<Integer>();
|
chapters = new HashSet<Integer>();
|
||||||
int ids[] = bundle.getIntArray( CHAPTERS );
|
int ids[] = bundle.getIntArray( CHAPTERS );
|
||||||
|
@ -616,14 +590,6 @@ public class Dungeon {
|
||||||
droppedItems.put( i, dropped );
|
droppedItems.put( i, dropped );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//logic for pre 0.2.4 bags, remove when no longer supporting those saves.
|
|
||||||
if (version <= 32){
|
|
||||||
int deepest = Statistics.deepestFloor;
|
|
||||||
if (deepest > 15) limitedDrops.wandBag.count = 1;
|
|
||||||
if (deepest > 10) limitedDrops.scrollBag.count = 1;
|
|
||||||
if (deepest > 5) limitedDrops.seedBag.count = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Level loadLevel( HeroClass cl ) throws IOException {
|
public static Level loadLevel( HeroClass cl ) throws IOException {
|
||||||
|
|
|
@ -67,7 +67,6 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.HighGrass;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.HighGrass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WornTrap;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
|
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
|
||||||
|
@ -362,18 +361,6 @@ public abstract class Level implements Bundlable {
|
||||||
customTiles.add( vis );
|
customTiles.add( vis );
|
||||||
}
|
}
|
||||||
|
|
||||||
//for pre-0.3.1 saves
|
|
||||||
if (version < 52){
|
|
||||||
for (int i=0; i < map.length; i++){
|
|
||||||
if (map[i] == Terrain.INACTIVE_TRAP){
|
|
||||||
Trap t = new WornTrap().reveal();
|
|
||||||
t.active = false;
|
|
||||||
t.pos = i;
|
|
||||||
traps.put( i, t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
collection = bundle.getCollection( MOBS );
|
collection = bundle.getCollection( MOBS );
|
||||||
for (Bundlable m : collection) {
|
for (Bundlable m : collection) {
|
||||||
Mob mob = (Mob)m;
|
Mob mob = (Mob)m;
|
||||||
|
|
|
@ -22,8 +22,6 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import android.opengl.GLES20;
|
import android.opengl.GLES20;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.BannerSprites;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Fireball;
|
||||||
|
@ -146,17 +144,6 @@ public class WelcomeScene extends PixelScene {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateVersion(int previousVersion){
|
private void updateVersion(int previousVersion){
|
||||||
if (previousVersion <= 32){
|
|
||||||
//removes all bags bought badge from pre-0.2.4 saves.
|
|
||||||
Badges.disown(Badges.Badge.ALL_BAGS_BOUGHT);
|
|
||||||
Badges.saveGlobal();
|
|
||||||
|
|
||||||
//imports new ranking data for pre-0.2.3 saves.
|
|
||||||
if (previousVersion <= 29){
|
|
||||||
Rankings.INSTANCE.load();
|
|
||||||
Rankings.INSTANCE.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ShatteredPixelDungeon.version(ShatteredPixelDungeon.versionCode);
|
ShatteredPixelDungeon.version(ShatteredPixelDungeon.versionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user