v0.8.2c: dropped compatibility from saves prior to v0.7.3b
This commit is contained in:
parent
4f1829af63
commit
72147a297c
|
@ -36,7 +36,6 @@ import com.watabou.utils.FileUtils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -176,15 +175,12 @@ public class Badges {
|
||||||
|
|
||||||
private static final HashSet<String> removedBadges = new HashSet<>();
|
private static final HashSet<String> removedBadges = new HashSet<>();
|
||||||
static{
|
static{
|
||||||
//removed in 0.6.5
|
//no recently removed badges
|
||||||
removedBadges.addAll(Arrays.asList("RARE_ALBINO", "RARE_BANDIT", "RARE_SHIELDED",
|
|
||||||
"RARE_SENIOR", "RARE_ACIDIC", "RARE", "TUTORIAL_WARRIOR", "TUTORIAL_MAGE"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final HashMap<String, String> renamedBadges = new HashMap<>();
|
private static final HashMap<String, String> renamedBadges = new HashMap<>();
|
||||||
static{
|
static{
|
||||||
//0.6.5
|
//no recently renamed badges
|
||||||
renamedBadges.put("CHAMPION", "CHAMPION_1");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HashSet<Badge> restore( Bundle bundle ) {
|
public static HashSet<Badge> restore( Bundle bundle ) {
|
||||||
|
|
|
@ -41,19 +41,17 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesi
|
||||||
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.scrolls.ScrollOfUpgrade;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
import com.shatteredpixel.shatteredpixeldungeon.journal.Notes;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.CavesLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.CityLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.DeadEndLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.DeadEndLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.NewHallsBossLevel;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.HallsLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.HallsLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.LastLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.LastLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.LastShopLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.NewCavesBossLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.NewCavesBossLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.NewCityBossLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.NewCityBossLevel;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.NewHallsBossLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.NewPrisonBossLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.NewPrisonBossLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.PrisonLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerBossLevel;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.SewerBossLevel;
|
||||||
|
@ -388,35 +386,6 @@ public class Dungeon {
|
||||||
|
|
||||||
hero.curAction = hero.lastAction = null;
|
hero.curAction = hero.lastAction = null;
|
||||||
|
|
||||||
//pre-0.7.1 saves. Adjusting for spirit bows in weapon slot or with upgrades.
|
|
||||||
SpiritBow bow;
|
|
||||||
if (hero.belongings.weapon instanceof SpiritBow){
|
|
||||||
bow = (SpiritBow)hero.belongings.weapon;
|
|
||||||
hero.belongings.weapon = null;
|
|
||||||
|
|
||||||
if (!bow.collect()){
|
|
||||||
level.drop(bow, hero.pos);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
bow = hero.belongings.getItem(SpiritBow.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
//pre-0.7.1 saves. refunding upgrades previously spend on a boomerang
|
|
||||||
if (bow != null && bow.spentUpgrades() > 0){
|
|
||||||
ScrollOfUpgrade refund = new ScrollOfUpgrade();
|
|
||||||
refund.quantity(bow.spentUpgrades());
|
|
||||||
bow.level(0);
|
|
||||||
|
|
||||||
//to prevent exploits, some SoU are lost in the conversion of a boomerang higher than +1
|
|
||||||
if (refund.quantity() > 1){
|
|
||||||
refund.quantity(1 + (int)Math.floor((refund.quantity()-1)*0.8f));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!refund.collect()){
|
|
||||||
level.drop(refund, hero.pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
observe();
|
observe();
|
||||||
try {
|
try {
|
||||||
saveAll();
|
saveAll();
|
||||||
|
@ -643,17 +612,6 @@ public class Dungeon {
|
||||||
|
|
||||||
hero = null;
|
hero = null;
|
||||||
hero = (Hero)bundle.get( HERO );
|
hero = (Hero)bundle.get( HERO );
|
||||||
|
|
||||||
//pre-0.7.0 saves, back when alchemy had a window which could store items
|
|
||||||
if (bundle.contains("alchemy_inputs")){
|
|
||||||
for (Bundlable item : bundle.getCollection("alchemy_inputs")){
|
|
||||||
|
|
||||||
//try to add normally, force-add otherwise.
|
|
||||||
if (!((Item)item).collect(hero.belongings.backpack)){
|
|
||||||
hero.belongings.backpack.items.add((Item)item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gold = bundle.getInt( GOLD );
|
gold = bundle.getInt( GOLD );
|
||||||
depth = bundle.getInt( DEPTH );
|
depth = bundle.getInt( DEPTH );
|
||||||
|
|
|
@ -102,8 +102,8 @@ public class GamesInProgress {
|
||||||
info.slot = slot;
|
info.slot = slot;
|
||||||
Dungeon.preview(info, bundle);
|
Dungeon.preview(info, bundle);
|
||||||
|
|
||||||
//saves from before 0.6.5c are not supported
|
//saves from before v0.7.3b are not supported
|
||||||
if (info.version < ShatteredPixelDungeon.v0_6_5c) {
|
if (info.version < ShatteredPixelDungeon.v0_7_3b) {
|
||||||
info = null;
|
info = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,9 @@ import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.PlatformSupport;
|
import com.watabou.utils.PlatformSupport;
|
||||||
|
|
||||||
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.5c are no longer supported, and data from them is ignored
|
//versions older than v0.7.3b are no longer supported, and data from them is ignored
|
||||||
public static final int v0_6_5c = 264;
|
|
||||||
|
|
||||||
public static final int v0_7_0c = 311;
|
|
||||||
public static final int v0_7_1d = 323;
|
|
||||||
public static final int v0_7_2d = 340;
|
|
||||||
public static final int v0_7_3b = 349;
|
public static final int v0_7_3b = 349;
|
||||||
public static final int v0_7_4c = 362;
|
public static final int v0_7_4c = 362;
|
||||||
public static final int v0_7_5e = 382;
|
public static final int v0_7_5e = 382;
|
||||||
|
@ -48,62 +43,7 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
|
|
||||||
public ShatteredPixelDungeon( PlatformSupport platform ) {
|
public ShatteredPixelDungeon( PlatformSupport platform ) {
|
||||||
super( sceneClass == null ? WelcomeScene.class : sceneClass, platform );
|
super( sceneClass == null ? WelcomeScene.class : sceneClass, platform );
|
||||||
|
|
||||||
//v0.7.0
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.Bomb" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.potions.elixirs.ElixirOfMight.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMight" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.spells.MagicalInfusion.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion" );
|
|
||||||
|
|
||||||
//v0.7.1
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang" );
|
|
||||||
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Gloves.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles" );
|
|
||||||
|
|
||||||
//v0.7.2
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfDisarming.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfDetectCurse" );
|
|
||||||
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Elastic" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Dazzling" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Eldritch" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Stunning" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Chilling.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Venomous" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Kinetic.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vorpal" );
|
|
||||||
|
|
||||||
//v0.7.3
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Kinetic.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Precise" );
|
|
||||||
com.watabou.utils.Bundle.addAlias(
|
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Kinetic.class,
|
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Swift" );
|
|
||||||
|
|
||||||
//v0.7.5
|
//v0.7.5
|
||||||
com.watabou.utils.Bundle.addAlias(
|
com.watabou.utils.Bundle.addAlias(
|
||||||
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss.SewerBossEntranceRoom.class,
|
com.shatteredpixel.shatteredpixeldungeon.levels.rooms.sewerboss.SewerBossEntranceRoom.class,
|
||||||
|
|
|
@ -62,10 +62,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Weakness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Elemental;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Elemental;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution;
|
||||||
|
@ -240,18 +238,6 @@ public abstract class Char extends Actor {
|
||||||
((Buff)b).attachTo( this );
|
((Buff)b).attachTo( this );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//pre-0.7.0
|
|
||||||
if (bundle.contains( "SHLD" )){
|
|
||||||
int legacySHLD = bundle.getInt( "SHLD" );
|
|
||||||
//attempt to find the buff that may have given the shield
|
|
||||||
ShieldBuff buff = buff(Brimstone.BrimstoneShield.class);
|
|
||||||
if (buff != null) legacySHLD -= buff.shielding();
|
|
||||||
if (legacySHLD > 0){
|
|
||||||
BrokenSeal.WarriorShield buff2 = buff(BrokenSeal.WarriorShield.class);
|
|
||||||
if (buff != null) buff2.supercharge(legacySHLD);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean attack( Char enemy ) {
|
public boolean attack( Char enemy ) {
|
||||||
|
|
|
@ -91,11 +91,6 @@ public class AdrenalineSurge extends Buff {
|
||||||
public void restoreFromBundle( Bundle bundle ) {
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
super.restoreFromBundle( bundle );
|
super.restoreFromBundle( bundle );
|
||||||
boost = bundle.getInt( BOOST );
|
boost = bundle.getInt( BOOST );
|
||||||
//pre-0.7.1
|
interval = bundle.getFloat(INTERVAL);
|
||||||
if (bundle.contains(INTERVAL)) {
|
|
||||||
interval = bundle.getFloat(INTERVAL);
|
|
||||||
} else {
|
|
||||||
interval = 800f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,17 +60,9 @@ public class Berserk extends Buff {
|
||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle(Bundle bundle) {
|
public void restoreFromBundle(Bundle bundle) {
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
//pre-0.6.5 saves
|
|
||||||
if (bundle.contains("exhaustion")){
|
state = bundle.getEnum(STATE, State.class);
|
||||||
state = State.RECOVERING;
|
power = bundle.getFloat(POWER);
|
||||||
} else {
|
|
||||||
state = bundle.getEnum(STATE, State.class);
|
|
||||||
}
|
|
||||||
if (bundle.contains(POWER)){
|
|
||||||
power = bundle.getFloat(POWER);
|
|
||||||
} else {
|
|
||||||
power = 1f;
|
|
||||||
}
|
|
||||||
if (state == State.RECOVERING) levelRecovery = bundle.getFloat(LEVEL_RECOVERY);
|
if (state == State.RECOVERING) levelRecovery = bundle.getFloat(LEVEL_RECOVERY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,12 +49,7 @@ public class Ooze extends Buff {
|
||||||
@Override
|
@Override
|
||||||
public void restoreFromBundle( Bundle bundle ) {
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
super.restoreFromBundle(bundle);
|
super.restoreFromBundle(bundle);
|
||||||
//pre-0.7.0
|
left = bundle.getFloat(LEFT);
|
||||||
if (bundle.contains( LEFT )) {
|
|
||||||
left = bundle.getFloat(LEFT);
|
|
||||||
} else {
|
|
||||||
left = 20;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -175,11 +175,6 @@ public class MirrorImage extends NPC {
|
||||||
public CharSprite sprite() {
|
public CharSprite sprite() {
|
||||||
CharSprite s = super.sprite();
|
CharSprite s = super.sprite();
|
||||||
|
|
||||||
//pre-0.7.0 saves
|
|
||||||
if (heroID == 0){
|
|
||||||
heroID = Dungeon.hero.id();
|
|
||||||
}
|
|
||||||
|
|
||||||
hero = (Hero)Actor.findById(heroID);
|
hero = (Hero)Actor.findById(heroID);
|
||||||
if (hero != null) {
|
if (hero != null) {
|
||||||
armTier = hero.tier();
|
armTier = hero.tier();
|
||||||
|
|
|
@ -140,12 +140,6 @@ public class Armor extends EquipableItem {
|
||||||
curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS );
|
curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS );
|
||||||
seal = (BrokenSeal)bundle.get(SEAL);
|
seal = (BrokenSeal)bundle.get(SEAL);
|
||||||
|
|
||||||
//pre-0.7.2 saves
|
|
||||||
if (bundle.contains( "unfamiliarity" )){
|
|
||||||
usesLeftToID = bundle.getInt( "unfamiliarity" );
|
|
||||||
availableUsesToID = USES_TO_ID/2f;
|
|
||||||
}
|
|
||||||
|
|
||||||
augment = bundle.getEnum(AUGMENT, Augment.class);
|
augment = bundle.getEnum(AUGMENT, Augment.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.ShieldBuff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.watabou.utils.Bundle;
|
|
||||||
|
|
||||||
public class Brimstone extends Armor.Glyph {
|
public class Brimstone extends Armor.Glyph {
|
||||||
|
|
||||||
|
@ -71,14 +70,6 @@ public class Brimstone extends Armor.Glyph {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void restoreFromBundle(Bundle bundle) {
|
|
||||||
super.restoreFromBundle(bundle);
|
|
||||||
//pre-0.7.0
|
|
||||||
if (bundle.contains("added")){
|
|
||||||
setShield(bundle.getInt("added"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,11 +284,6 @@ public class Ring extends KindofMisc {
|
||||||
public void restoreFromBundle( Bundle bundle ) {
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
super.restoreFromBundle( bundle );
|
super.restoreFromBundle( bundle );
|
||||||
levelsToID = bundle.getFloat( LEVELS_TO_ID );
|
levelsToID = bundle.getFloat( LEVELS_TO_ID );
|
||||||
|
|
||||||
//pre-0.7.2 saves
|
|
||||||
if (bundle.contains( "unfamiliarity" )){
|
|
||||||
levelsToID = bundle.getInt( "unfamiliarity" ) / 200f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onHeroGainExp( float levelPercent, Hero hero ){
|
public void onHeroGainExp( float levelPercent, Hero hero ){
|
||||||
|
|
|
@ -196,9 +196,7 @@ public class SpiritBow extends Weapon {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int level() {
|
public int level() {
|
||||||
//need to check if hero is null for loading an upgraded bow from pre-0.7.0
|
return (Dungeon.hero == null ? 0 : Dungeon.hero.lvl/5) + (curseInfusionBonus ? 1 : 0);
|
||||||
return (Dungeon.hero == null ? 0 : Dungeon.hero.lvl/5)
|
|
||||||
+ (curseInfusionBonus ? 1 : 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -206,11 +204,6 @@ public class SpiritBow extends Weapon {
|
||||||
//level isn't affected by buffs/debuffs
|
//level isn't affected by buffs/debuffs
|
||||||
return level();
|
return level();
|
||||||
}
|
}
|
||||||
|
|
||||||
//for fetching upgrades from a boomerang from pre-0.7.1
|
|
||||||
public int spentUpgrades() {
|
|
||||||
return super.level() - (curseInfusionBonus ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUpgradable() {
|
public boolean isUpgradable() {
|
||||||
|
|
|
@ -41,10 +41,10 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blazin
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blocking;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blocking;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blooming;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blooming;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Chilling;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Chilling;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Kinetic;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Corrupting;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Corrupting;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Elastic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Grim;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Kinetic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Lucky;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Lucky;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Projecting;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Projecting;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking;
|
||||||
|
@ -148,13 +148,7 @@ abstract public class Weapon extends KindOfWeapon {
|
||||||
availableUsesToID = bundle.getInt( AVAILABLE_USES );
|
availableUsesToID = bundle.getInt( AVAILABLE_USES );
|
||||||
enchantment = (Enchantment)bundle.get( ENCHANTMENT );
|
enchantment = (Enchantment)bundle.get( ENCHANTMENT );
|
||||||
curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS );
|
curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS );
|
||||||
|
|
||||||
//pre-0.7.2 saves
|
|
||||||
if (bundle.contains( "unfamiliarity" )){
|
|
||||||
usesLeftToID = bundle.getInt( "unfamiliarity" );
|
|
||||||
availableUsesToID = USES_TO_ID/2f;
|
|
||||||
}
|
|
||||||
|
|
||||||
augment = bundle.getEnum(AUGMENT, Augment.class);
|
augment = bundle.getEnum(AUGMENT, Augment.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,11 +167,6 @@ public enum Document {
|
||||||
if (doc.pages.containsKey(page)) {
|
if (doc.pages.containsKey(page)) {
|
||||||
doc.pages.put(page, true);
|
doc.pages.put(page, true);
|
||||||
}
|
}
|
||||||
//pre-0.7.2 saves
|
|
||||||
else if (page.equals("Brews")){
|
|
||||||
doc.pages.put("Catalysts", true);
|
|
||||||
doc.pages.put("Brews_Elixirs", true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,8 +299,8 @@ public abstract class Level implements Bundlable {
|
||||||
|
|
||||||
version = bundle.getInt( VERSION );
|
version = bundle.getInt( VERSION );
|
||||||
|
|
||||||
//saves from before 0.6.5c are not supported
|
//saves from before v0.7.3b are not supported
|
||||||
if (version < ShatteredPixelDungeon.v0_6_5c){
|
if (version < ShatteredPixelDungeon.v0_7_3b){
|
||||||
throw new RuntimeException("old save");
|
throw new RuntimeException("old save");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import com.watabou.utils.Reflection;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
public abstract class SpecialRoom extends Room {
|
public abstract class SpecialRoom extends Room {
|
||||||
|
|
||||||
|
@ -167,12 +168,7 @@ public abstract class SpecialRoom extends Room {
|
||||||
public static void restoreRoomsFromBundle( Bundle bundle ) {
|
public static void restoreRoomsFromBundle( Bundle bundle ) {
|
||||||
runSpecials.clear();
|
runSpecials.clear();
|
||||||
if (bundle.contains( ROOMS )) {
|
if (bundle.contains( ROOMS )) {
|
||||||
for (Class<? extends Room> type : bundle.getClassArray(ROOMS)) {
|
Collections.addAll(runSpecials, bundle.getClassArray(ROOMS));
|
||||||
//pre-0.7.0 saves
|
|
||||||
if (type != null && type != LaboratoryRoom.class) {
|
|
||||||
runSpecials.add(type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
initForRun();
|
initForRun();
|
||||||
ShatteredPixelDungeon.reportException(new Exception("specials array didn't exist!"));
|
ShatteredPixelDungeon.reportException(new Exception("specials array didn't exist!"));
|
||||||
|
|
|
@ -24,7 +24,6 @@ package com.shatteredpixel.shatteredpixeldungeon.plants;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
|
||||||
|
|
||||||
public class BlandfruitBush extends Plant {
|
public class BlandfruitBush extends Plant {
|
||||||
|
|
||||||
|
@ -37,11 +36,9 @@ public class BlandfruitBush extends Plant {
|
||||||
Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop();
|
Dungeon.level.drop( new Blandfruit(), pos ).sprite.drop();
|
||||||
}
|
}
|
||||||
|
|
||||||
//This seed no longer drops, but has a sprite as it did drop prior to 0.7.0
|
//seed is never dropped
|
||||||
public static class Seed extends Plant.Seed {
|
public static class Seed extends Plant.Seed {
|
||||||
{
|
{
|
||||||
image = ItemSpriteSheet.SEED_FADELEAF;
|
|
||||||
|
|
||||||
plantClass = BlandfruitBush.class;
|
plantClass = BlandfruitBush.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,15 +21,12 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
|
import com.shatteredpixel.shatteredpixeldungeon.Rankings;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||||
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.journal.Document;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Journal;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||||
|
@ -183,25 +180,6 @@ public class WelcomeScene extends PixelScene {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//give classes to people with saves that have previously unlocked them
|
|
||||||
if (previousVersion <= ShatteredPixelDungeon.v0_7_0c){
|
|
||||||
Badges.loadGlobal();
|
|
||||||
Badges.addGlobal(Badges.Badge.UNLOCK_MAGE);
|
|
||||||
Badges.addGlobal(Badges.Badge.UNLOCK_ROGUE);
|
|
||||||
if (Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_3)){
|
|
||||||
Badges.addGlobal(Badges.Badge.UNLOCK_HUNTRESS);
|
|
||||||
}
|
|
||||||
Badges.saveGlobal();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (previousVersion <= ShatteredPixelDungeon.v0_6_5c){
|
|
||||||
Journal.loadGlobal();
|
|
||||||
Document.ALCHEMY_GUIDE.addPage("Potions");
|
|
||||||
Document.ALCHEMY_GUIDE.addPage("Stones");
|
|
||||||
Document.ALCHEMY_GUIDE.addPage("Energy_Food");
|
|
||||||
Journal.saveGlobal();
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDSettings.version(ShatteredPixelDungeon.versionCode);
|
SPDSettings.version(ShatteredPixelDungeon.versionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user