diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 01c4609d6..93953499d 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -165,20 +165,27 @@ public class Artifact extends KindofMisc { } + private static final String IMAGE = "image"; + private static final String EXP = "exp"; + private static final String CHARGE = "charge"; + private static final String PARTIALCHARGE = "partialcharge"; + @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle(bundle); - bundle.put( "exp", exp ); - bundle.put( "charge", charge ); - bundle.put( "partialcharge", partialCharge); + bundle.put( IMAGE, image ); + bundle.put( EXP , exp ); + bundle.put( CHARGE , charge ); + bundle.put( PARTIALCHARGE , partialCharge ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); - exp = bundle.getInt("exp"); - charge = bundle.getInt("charge"); - partialCharge = bundle.getFloat("partialcharge"); + image = bundle.getInt( IMAGE ); + exp = bundle.getInt( EXP ); + charge = bundle.getInt( CHARGE ); + partialCharge = bundle.getFloat( PARTIALCHARGE ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java index 2e57de530..93bf6b42c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java @@ -31,8 +31,6 @@ public class CapeOfThorns extends Artifact { private int timer = 0; - private int exp = 0; - @Override public String status() { if (timer == 0) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java index e1323f6eb..e5a93001a 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java @@ -128,6 +128,26 @@ public class CloakOfShadows extends Artifact { return Utils.format(TXT_CD, cooldown); } + private static final String CHARGECAP = "chargecap"; + private static final String STEALTHED = "stealthed"; + private static final String COOLDOWN = "cooldown"; + + @Override + public void storeInBundle( Bundle bundle ) { + super.storeInBundle(bundle); + bundle.put( CHARGECAP, chargeCap ); + bundle.put( STEALTHED, stealthed ); + bundle.put( COOLDOWN, cooldown ); + } + + @Override + public void restoreFromBundle( Bundle bundle ) { + super.restoreFromBundle(bundle); + chargeCap = bundle.getInt( CHARGECAP ); + stealthed = bundle.getBoolean( STEALTHED ); + cooldown = bundle.getInt( COOLDOWN ); + } + public class cloakRecharge extends ArtifactBuff{ @Override public boolean act() { @@ -217,20 +237,4 @@ public class CloakOfShadows extends Artifact { super.detach(); } } - - @Override - public void storeInBundle( Bundle bundle ) { - super.storeInBundle(bundle); - bundle.put("chargecap", chargeCap); - bundle.put("stealthed", stealthed); - bundle.put("cooldown", cooldown); - } - - @Override - public void restoreFromBundle( Bundle bundle ) { - super.restoreFromBundle(bundle); - chargeCap = bundle.getInt("chargecap"); - stealthed = bundle.getBoolean("stealthed"); - cooldown = bundle.getInt("cooldown"); - } } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java index 991dbfbff..7ad3ba495 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/SandalsOfNature.java @@ -17,8 +17,10 @@ import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.watabou.noosa.Camera; +import com.watabou.utils.Bundle; import java.util.ArrayList; +import java.util.Collections; /** * Created by debenhame on 08/09/2014. @@ -61,7 +63,7 @@ public class SandalsOfNature extends Artifact { if (charge > 0){ Buff.prolong( hero, Roots.class, 5); Buff.affect( hero, Earthroot.Armor.class ).level( charge ); - CellEmitter.bottom(hero.pos).start( EarthParticle.FACTORY, 0.05f, 8 ); + CellEmitter.bottom(hero.pos).start(EarthParticle.FACTORY, 0.05f, 8); Camera.main.shake( 1, 0.4f ); charge = 0; } @@ -87,7 +89,21 @@ public class SandalsOfNature extends Artifact { return ""; } - //TODO: add bundle logic + + private static final String SEEDS = "seeds"; + + @Override + public void storeInBundle( Bundle bundle ) { + super.storeInBundle(bundle); + bundle.put(SEEDS, seeds.toArray(new String[seeds.size()])); + } + + @Override + public void restoreFromBundle( Bundle bundle ) { + super.restoreFromBundle(bundle); + if (bundle.contains(SEEDS)) + Collections.addAll(seeds , bundle.getStringArray(SEEDS)); + } public class Naturalism extends ArtifactBuff{ public int level() { return level; }