cleaned up formatting:
- removed trailing whitespace - changed all leading whitespace to tabs - removed IDE created author comments
This commit is contained in:
@@ -31,28 +31,28 @@ import java.util.ArrayList;
|
||||
|
||||
public class Ankh extends Item {
|
||||
|
||||
public static final String AC_BLESS = "BLESS";
|
||||
public static final String AC_BLESS = "BLESS";
|
||||
|
||||
public static final String TXT_DESC_NOBLESS = "Upon resurrection all non-equipped items are lost. " +
|
||||
"Using a full dew vial, the ankh can be blessed with extra strength.";
|
||||
public static final String TXT_DESC_BLESSED = "The ankh has been blessed and is now much stronger. " +
|
||||
"The Ankh will sacrifice itself to save you in a moment of deadly peril.";
|
||||
public static final String TXT_DESC_NOBLESS = "Upon resurrection all non-equipped items are lost. " +
|
||||
"Using a full dew vial, the ankh can be blessed with extra strength.";
|
||||
public static final String TXT_DESC_BLESSED = "The ankh has been blessed and is now much stronger. " +
|
||||
"The Ankh will sacrifice itself to save you in a moment of deadly peril.";
|
||||
|
||||
public static final String TXT_BLESS = "You bless the ankh with clean water.";
|
||||
public static final String TXT_REVIVE = "The ankh explodes with life-giving energy!";
|
||||
public static final String TXT_BLESS = "You bless the ankh with clean water.";
|
||||
public static final String TXT_REVIVE = "The ankh explodes with life-giving energy!";
|
||||
|
||||
|
||||
|
||||
{
|
||||
{
|
||||
name = "Ankh";
|
||||
image = ItemSpriteSheet.ANKH;
|
||||
|
||||
//You tell the ankh no, don't revive me, and then it comes back to revive you again in another run.
|
||||
//I'm not sure if that's enthusiasm or passive-aggression.
|
||||
bones = true;
|
||||
}
|
||||
//You tell the ankh no, don't revive me, and then it comes back to revive you again in another run.
|
||||
//I'm not sure if that's enthusiasm or passive-aggression.
|
||||
bones = true;
|
||||
}
|
||||
|
||||
private Boolean blessed = false;
|
||||
private Boolean blessed = false;
|
||||
|
||||
@Override
|
||||
public boolean isUpgradable() {
|
||||
@@ -64,76 +64,76 @@ public class Ankh extends Item {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions(hero);
|
||||
DewVial vial = hero.belongings.getItem(DewVial.class);
|
||||
if (vial != null && vial.isFull() && !blessed)
|
||||
actions.add( AC_BLESS );
|
||||
return actions;
|
||||
}
|
||||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions(hero);
|
||||
DewVial vial = hero.belongings.getItem(DewVial.class);
|
||||
if (vial != null && vial.isFull() && !blessed)
|
||||
actions.add( AC_BLESS );
|
||||
return actions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute( final Hero hero, String action ) {
|
||||
if (action.equals( AC_BLESS )) {
|
||||
@Override
|
||||
public void execute( final Hero hero, String action ) {
|
||||
if (action.equals( AC_BLESS )) {
|
||||
|
||||
DewVial vial = hero.belongings.getItem(DewVial.class);
|
||||
if (vial != null){
|
||||
blessed = true;
|
||||
vial.empty();
|
||||
GLog.p( TXT_BLESS );
|
||||
hero.spend( 1f );
|
||||
hero.busy();
|
||||
DewVial vial = hero.belongings.getItem(DewVial.class);
|
||||
if (vial != null){
|
||||
blessed = true;
|
||||
vial.empty();
|
||||
GLog.p( TXT_BLESS );
|
||||
hero.spend( 1f );
|
||||
hero.busy();
|
||||
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_DRINK );
|
||||
CellEmitter.get(hero.pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
|
||||
hero.sprite.operate( hero.pos );
|
||||
}
|
||||
} else {
|
||||
Sample.INSTANCE.play( Assets.SND_DRINK );
|
||||
CellEmitter.get(hero.pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
|
||||
hero.sprite.operate( hero.pos );
|
||||
}
|
||||
} else {
|
||||
|
||||
super.execute( hero, action );
|
||||
super.execute( hero, action );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String info() {
|
||||
if (blessed)
|
||||
return
|
||||
"This ancient symbol of immortality grants the ability to return to life after death. " +
|
||||
TXT_DESC_BLESSED;
|
||||
else
|
||||
return
|
||||
return
|
||||
"This ancient symbol of immortality grants the ability to return to life after death. " +
|
||||
TXT_DESC_NOBLESS;
|
||||
TXT_DESC_BLESSED;
|
||||
else
|
||||
return
|
||||
"This ancient symbol of immortality grants the ability to return to life after death. " +
|
||||
TXT_DESC_NOBLESS;
|
||||
}
|
||||
|
||||
public Boolean isBlessed(){
|
||||
return blessed;
|
||||
}
|
||||
public Boolean isBlessed(){
|
||||
return blessed;
|
||||
}
|
||||
|
||||
private static final Glowing WHITE = new Glowing( 0xFFFFCC );
|
||||
private static final Glowing WHITE = new Glowing( 0xFFFFCC );
|
||||
|
||||
@Override
|
||||
public Glowing glowing() {
|
||||
return isBlessed() ? WHITE : null;
|
||||
}
|
||||
@Override
|
||||
public Glowing glowing() {
|
||||
return isBlessed() ? WHITE : null;
|
||||
}
|
||||
|
||||
private static final String BLESSED = "blessed";
|
||||
private static final String BLESSED = "blessed";
|
||||
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( BLESSED, blessed );
|
||||
}
|
||||
@Override
|
||||
public void storeInBundle( Bundle bundle ) {
|
||||
super.storeInBundle( bundle );
|
||||
bundle.put( BLESSED, blessed );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
blessed = bundle.getBoolean( BLESSED );
|
||||
}
|
||||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
blessed = bundle.getBoolean( BLESSED );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int price() {
|
||||
|
||||
Reference in New Issue
Block a user