v0.4.0: refactored artifacts storing their image reference
This commit is contained in:
parent
07ec295889
commit
c96966f54d
|
@ -241,7 +241,6 @@ public class Artifact extends KindofMisc {
|
|||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle(bundle);
|
||||
bundle.put( IMAGE, image );
|
||||
bundle.put( EXP , exp );
|
||||
bundle.put( CHARGE , charge );
|
||||
bundle.put( PARTIALCHARGE , partialCharge );
|
||||
|
@ -250,7 +249,6 @@ public class Artifact extends KindofMisc {
|
|||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle(bundle);
|
||||
if (bundle.contains( IMAGE )) image = bundle.getInt( IMAGE );
|
||||
exp = bundle.getInt( EXP );
|
||||
charge = bundle.getInt( CHARGE );
|
||||
partialCharge = bundle.getFloat( PARTIALCHARGE );
|
||||
|
|
|
@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -123,6 +124,13 @@ public class ChaliceOfBlood extends Artifact {
|
|||
return super.upgrade();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
if (level() >= 7) image = ItemSpriteSheet.ARTIFACT_CHALICE3;
|
||||
else if (level() >= 3) image = ItemSpriteSheet.ARTIFACT_CHALICE2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ArtifactBuff passiveBuff() {
|
||||
return new chaliceRegen();
|
||||
|
|
|
@ -41,6 +41,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -154,6 +155,14 @@ public class HornOfPlenty extends Artifact {
|
|||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
if (charge == chargeCap)image = ItemSpriteSheet.ARTIFACT_HORN4;
|
||||
else if (charge >= 7) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
||||
else if (charge >= 3) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
||||
}
|
||||
|
||||
public class hornRecharge extends ArtifactBuff{
|
||||
|
||||
@Override
|
||||
|
@ -170,14 +179,10 @@ public class HornOfPlenty extends Artifact {
|
|||
charge++;
|
||||
partialCharge -= 36;
|
||||
|
||||
if (charge == chargeCap)
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN4;
|
||||
else if (charge >= 7)
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN3;
|
||||
else if (charge >= 3)
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN2;
|
||||
else
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||
if (charge == chargeCap)image = ItemSpriteSheet.ARTIFACT_HORN4;
|
||||
else if (charge >= 7) image = ItemSpriteSheet.ARTIFACT_HORN3;
|
||||
else if (charge >= 3) image = ItemSpriteSheet.ARTIFACT_HORN2;
|
||||
else image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||
|
||||
if (charge == chargeCap){
|
||||
GLog.p( Messages.get(HornOfPlenty.class, "full") );
|
||||
|
@ -220,5 +225,4 @@ public class HornOfPlenty extends Artifact {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -124,14 +124,10 @@ public class SandalsOfNature extends Artifact {
|
|||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
if (level() < 0)
|
||||
image = ItemSpriteSheet.ARTIFACT_SANDALS;
|
||||
else if (level() == 0)
|
||||
image = ItemSpriteSheet.ARTIFACT_SHOES;
|
||||
else if (level() == 1)
|
||||
image = ItemSpriteSheet.ARTIFACT_BOOTS;
|
||||
else if (level() >= 2)
|
||||
image = ItemSpriteSheet.ARTIFACT_GREAVES;
|
||||
if (level() < 0) image = ItemSpriteSheet.ARTIFACT_SANDALS;
|
||||
else if (level() == 0) image = ItemSpriteSheet.ARTIFACT_SHOES;
|
||||
else if (level() == 1) image = ItemSpriteSheet.ARTIFACT_BOOTS;
|
||||
else if (level() >= 2) image = ItemSpriteSheet.ARTIFACT_GREAVES;
|
||||
name = Messages.get(this, "name_" + (level()+1));
|
||||
return super.upgrade();
|
||||
}
|
||||
|
@ -151,6 +147,9 @@ public class SandalsOfNature extends Artifact {
|
|||
if (level() > 0) name = Messages.get(this, "name_" + level());
|
||||
if (bundle.contains(SEEDS))
|
||||
Collections.addAll(seeds , bundle.getClassArray(SEEDS));
|
||||
if (level() == 1) image = ItemSpriteSheet.ARTIFACT_SHOES;
|
||||
else if (level() == 2) image = ItemSpriteSheet.ARTIFACT_BOOTS;
|
||||
else if (level() >= 3) image = ItemSpriteSheet.ARTIFACT_GREAVES;
|
||||
}
|
||||
|
||||
public class Naturalism extends ArtifactBuff{
|
||||
|
|
Loading…
Reference in New Issue
Block a user