V0.1.1: more partial Blandfruit coding
This commit is contained in:
parent
5c1526e430
commit
ffa746be18
|
@ -25,6 +25,7 @@ public class Blandfruit extends Food {
|
||||||
public String message = "You eat the Blandfruit, bleugh!";
|
public String message = "You eat the Blandfruit, bleugh!";
|
||||||
public String info = "So dry and insubstantial, perhaps cooking could improve it.";
|
public String info = "So dry and insubstantial, perhaps cooking could improve it.";
|
||||||
public Potion potionAttrib = null;
|
public Potion potionAttrib = null;
|
||||||
|
public ItemSprite.Glowing potionGlow = null;
|
||||||
|
|
||||||
{
|
{
|
||||||
name = "Blandfruit";
|
name = "Blandfruit";
|
||||||
|
@ -37,20 +38,26 @@ public class Blandfruit extends Food {
|
||||||
public void execute( Hero hero, String action ) {
|
public void execute( Hero hero, String action ) {
|
||||||
if (potionAttrib == null){
|
if (potionAttrib == null){
|
||||||
|
|
||||||
detach( hero.belongings.backpack );
|
if (action.equals( AC_EAT )) {
|
||||||
|
|
||||||
((Hunger)hero.buff( Hunger.class )).satisfy( energy );
|
detach(hero.belongings.backpack);
|
||||||
|
|
||||||
|
((Hunger) hero.buff(Hunger.class)).satisfy(energy);
|
||||||
GLog.i(message);
|
GLog.i(message);
|
||||||
|
|
||||||
hero.sprite.operate( hero.pos );
|
hero.sprite.operate(hero.pos);
|
||||||
hero.busy();
|
hero.busy();
|
||||||
SpellSprite.show(hero, SpellSprite.FOOD);
|
SpellSprite.show(hero, SpellSprite.FOOD);
|
||||||
Sample.INSTANCE.play( Assets.SND_EAT );
|
Sample.INSTANCE.play(Assets.SND_EAT);
|
||||||
|
|
||||||
hero.spend( 1f );
|
hero.spend(1f);
|
||||||
|
|
||||||
Statistics.foodEaten++;
|
Statistics.foodEaten++;
|
||||||
Badges.validateFoodEaten();
|
Badges.validateFoodEaten();
|
||||||
|
}
|
||||||
|
|
||||||
|
else super.execute(hero, action);
|
||||||
|
|
||||||
|
|
||||||
} else if (action.equals( AC_EAT )){
|
} else if (action.equals( AC_EAT )){
|
||||||
|
|
||||||
|
@ -84,9 +91,14 @@ public class Blandfruit extends Food {
|
||||||
|
|
||||||
} else if (action.equals( AC_THROW )){
|
} else if (action.equals( AC_THROW )){
|
||||||
|
|
||||||
//need to finish this
|
if (potionAttrib instanceof PotionOfLiquidFlame ||
|
||||||
GameScene.selectCell(thrower);
|
potionAttrib instanceof PotionOfToxicGas ||
|
||||||
//potionAttrib.splash(hero.pos);
|
potionAttrib instanceof PotionOfParalyticGas){
|
||||||
|
potionAttrib.execute(hero, action);
|
||||||
|
detach( hero.belongings.backpack );
|
||||||
|
} else {
|
||||||
|
super.execute(hero, action);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
super.execute(hero, action);
|
super.execute(hero, action);
|
||||||
|
@ -116,11 +128,10 @@ public class Blandfruit extends Food {
|
||||||
//implement pixmap
|
//implement pixmap
|
||||||
potionAttrib.image = ItemSpriteSheet.BLANDFRUIT;
|
potionAttrib.image = ItemSpriteSheet.BLANDFRUIT;
|
||||||
|
|
||||||
//need to finish this
|
|
||||||
if (potionAttrib instanceof PotionOfHealing){
|
if (potionAttrib instanceof PotionOfHealing){
|
||||||
|
|
||||||
name = "Healthfruit";
|
name = "Healthfruit";
|
||||||
//message = "You eat the HealthFruit, your whole body tingles.";
|
potionGlow = new ItemSprite.Glowing( 0x2EE62E );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Sungrass seed it was cooked with. It looks delicious and hearty, ready to be eaten!";
|
"of the Sungrass seed it was cooked with. It looks delicious and hearty, ready to be eaten!";
|
||||||
|
|
||||||
|
@ -128,51 +139,51 @@ public class Blandfruit extends Food {
|
||||||
} else if (potionAttrib instanceof PotionOfStrength){
|
} else if (potionAttrib instanceof PotionOfStrength){
|
||||||
|
|
||||||
name = "Powerfruit";
|
name = "Powerfruit";
|
||||||
//message = "";
|
potionGlow = new ItemSprite.Glowing( 0xCC0022 );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Rotberry seed it was cooked with. It looks delicious and powerful, ready to be eaten!";
|
"of the Rotberry seed it was cooked with. It looks delicious and powerful, ready to be eaten!";
|
||||||
|
|
||||||
} else if (potionAttrib instanceof PotionOfParalyticGas){
|
} else if (potionAttrib instanceof PotionOfParalyticGas){
|
||||||
|
|
||||||
name = "Paralyzefruit";
|
name = "Paralyzefruit";
|
||||||
//message = "";
|
potionGlow = new ItemSprite.Glowing( 0x67583D );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Earthroot seed it was cooked with. It looks delicious and firm, but eating it is probably a bad idea.";
|
"of the Earthroot seed it was cooked with. It looks firm and volatile, I shouldn't eat this.";
|
||||||
|
|
||||||
} else if (potionAttrib instanceof PotionOfInvisibility){
|
} else if (potionAttrib instanceof PotionOfInvisibility){
|
||||||
|
|
||||||
name = "Invisifruit";
|
name = "Invisifruit";
|
||||||
//message = "";
|
potionGlow = new ItemSprite.Glowing( 0xE5D273 );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Blindweed seed it was cooked with. It looks delicious and shiny, ready to be eaten!";
|
"of the Blindweed seed it was cooked with. It looks delicious and shiny, ready to be eaten!";
|
||||||
|
|
||||||
} else if (potionAttrib instanceof PotionOfLiquidFlame){
|
} else if (potionAttrib instanceof PotionOfLiquidFlame){
|
||||||
|
|
||||||
name = "Flamefruit";
|
name = "Flamefruit";
|
||||||
//message = "";
|
potionGlow = new ItemSprite.Glowing( 0xFF7F00 );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Firebloom seed it was cooked with. It looks delicious and spicy, but eating it is probably a bad idea.";
|
"of the Firebloom seed it was cooked with. It looks spicy and volatile, I shouldn't eat this.";
|
||||||
|
|
||||||
} else if (potionAttrib instanceof PotionOfFrost){
|
} else if (potionAttrib instanceof PotionOfFrost){
|
||||||
|
|
||||||
name = "Frostfruit";
|
name = "Frostfruit";
|
||||||
//message = "";
|
potionGlow = new ItemSprite.Glowing( 0x66B3FF );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Icecap seed it was cooked with. It looks delicious and refreshing, ready to be eaten!";
|
"of the Icecap seed it was cooked with. It looks delicious and refreshing, ready to be eaten!";
|
||||||
|
|
||||||
} else if (potionAttrib instanceof PotionOfMindVision){
|
} else if (potionAttrib instanceof PotionOfMindVision){
|
||||||
|
|
||||||
name = "Visionfruit";
|
name = "Visionfruit";
|
||||||
//message = "";
|
potionGlow = new ItemSprite.Glowing( 0xB8E6CF );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Fadeleaf seed it was cooked with. It looks delicious and shadowy, ready to be eaten!";
|
"of the Fadeleaf seed it was cooked with. It looks delicious and shadowy, ready to be eaten!";
|
||||||
|
|
||||||
} else if (potionAttrib instanceof PotionOfToxicGas){
|
} else if (potionAttrib instanceof PotionOfToxicGas){
|
||||||
|
|
||||||
name = "Toxicfruit";
|
name = "Toxicfruit";
|
||||||
//message = "";
|
potionGlow = new ItemSprite.Glowing( 0xA15CE5 );
|
||||||
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
info = "The fruit has plumped up from its time soaking in the pot and has even absorbed the properties "+
|
||||||
"of the Sorrowmoss seed it was cooked with. It looks delicious and crisp, but eating it is probably a bad idea.";
|
"of the Sorrowmoss seed it was cooked with. It looks crisp and volatile, I shouldn't eat this.";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -181,11 +192,10 @@ public class Blandfruit extends Food {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x2EE62E );
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemSprite.Glowing glowing() {
|
public ItemSprite.Glowing glowing() {
|
||||||
return (potionAttrib != null) ? GREEN : null;
|
return potionGlow;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user