diff --git a/assets/items.png b/assets/items.png index c758c8c5c..9fd3e9be4 100644 Binary files a/assets/items.png and b/assets/items.png differ diff --git a/assets/plants.png b/assets/plants.png index 72604346b..af9f52a3e 100644 Binary files a/assets/plants.png and b/assets/plants.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/food/BlandFruit.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/food/BlandFruit.java index e5e28e6c8..92b94ad62 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/food/BlandFruit.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/food/BlandFruit.java @@ -1,27 +1,35 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Badges; +import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.potions.*; +import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.plants.Plant.Seed; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.watabou.noosa.audio.Sample; /** * Created by debenhame on 12/08/2014. */ -public class BlandFruit extends Food { +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 Potion potionAttrib = null; { - name = "BlandFruit"; + name = "Blandfruit"; stackable = false; - image = ItemSpriteSheet.STEAK; + image = ItemSpriteSheet.BLANDFRUIT; energy = (Hunger.STARVING - Hunger.HUNGRY)/2; } @@ -29,7 +37,20 @@ public class BlandFruit extends Food { public void execute( Hero hero, String action ) { if (potionAttrib == null){ - super.execute(hero, action); + detach( hero.belongings.backpack ); + + ((Hunger)hero.buff( Hunger.class )).satisfy( energy ); + GLog.i(message); + + hero.sprite.operate( hero.pos ); + hero.busy(); + SpellSprite.show(hero, SpellSprite.FOOD); + Sample.INSTANCE.play( Assets.SND_EAT ); + + hero.spend( 1f ); + + Statistics.foodEaten++; + Badges.validateFoodEaten(); } else if (action.equals( AC_EAT )){ @@ -45,11 +66,27 @@ public class BlandFruit extends Food { hero.sprite.operate(hero.pos); + switch (hero.heroClass) { + case WARRIOR: + if (hero.HP < hero.HT) { + hero.HP = Math.min( hero.HP + 5, hero.HT ); + hero.sprite.emitter().burst( Speck.factory(Speck.HEALING), 1 ); + } + break; + case MAGE: + hero.belongings.charge( false ); + ScrollOfRecharging.charge(hero); + break; + case ROGUE: + case HUNTRESS: + break; + } + } else if (action.equals( AC_THROW )){ //need to finish this GameScene.selectCell(thrower); - potionAttrib.splash(hero.pos); + //potionAttrib.splash(hero.pos); } else { super.execute(hero, action); @@ -77,31 +114,78 @@ public class BlandFruit extends Food { } //implement pixmap - potionAttrib.image = 0; + potionAttrib.image = ItemSpriteSheet.BLANDFRUIT; //need to finish this if (potionAttrib instanceof PotionOfHealing){ - name = "HealFruit"; - message = ""; - info = ""; + + name = "Healthfruit"; + //message = "You eat the HealthFruit, your whole body tingles."; + 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!"; + + } else if (potionAttrib instanceof PotionOfStrength){ + name = "Powerfruit"; + //message = ""; + 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!"; + } else if (potionAttrib instanceof PotionOfParalyticGas){ + name = "Paralyzefruit"; + //message = ""; + 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."; + } else if (potionAttrib instanceof PotionOfInvisibility){ + name = "Invisifruit"; + //message = ""; + 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!"; + } else if (potionAttrib instanceof PotionOfLiquidFlame){ + name = "Flamefruit"; + //message = ""; + 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."; + } else if (potionAttrib instanceof PotionOfFrost){ + name = "Frostfruit"; + //message = ""; + 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!"; + } else if (potionAttrib instanceof PotionOfMindVision){ + name = "Visionfruit"; + //message = ""; + 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!"; + } else if (potionAttrib instanceof PotionOfToxicGas){ + name = "Toxicfruit"; + //message = ""; + 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."; + } else { } + return this; } + private static final ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x2EE62E ); + + @Override + public ItemSprite.Glowing glowing() { + return (potionAttrib != null) ? GREEN : null; + } + } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java index e65d166b4..7aa6861a9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/Potion.java @@ -208,7 +208,7 @@ public class Potion extends Item { } } - protected void apply( Hero hero ) { + public void apply( Hero hero ) { shatter( hero.pos ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java index 01ceea376..00b4f4a97 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfExperience.java @@ -26,7 +26,7 @@ public class PotionOfExperience extends Potion { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { setKnown(); hero.earnExp( hero.maxExp() - hero.exp ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java index a161e7805..d79354af7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java @@ -34,7 +34,7 @@ public class PotionOfHealing extends Potion { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { setKnown(); heal( Dungeon.hero ); GLog.p( "Your wounds heal completely." ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java index aa65b25a7..3fe8e4fa5 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfInvisibility.java @@ -35,7 +35,7 @@ public class PotionOfInvisibility extends Potion { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { setKnown(); Buff.affect( hero, Invisibility.class, Invisibility.DURATION ); GLog.i( "You see your hands turn invisible!" ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java index c0b4c5521..57f0a5c10 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfLevitation.java @@ -29,7 +29,7 @@ public class PotionOfLevitation extends Potion { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { setKnown(); Buff.affect( hero, Levitation.class, Levitation.DURATION ); GLog.i( "You float into the air!" ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java index c49d42fc0..165010790 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMight.java @@ -28,7 +28,7 @@ public class PotionOfMight extends PotionOfStrength { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { setKnown(); hero.STR++; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java index 555538794..f88e2e4d6 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfMindVision.java @@ -30,7 +30,7 @@ public class PotionOfMindVision extends Potion { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { setKnown(); Buff.affect( hero, MindVision.class, MindVision.DURATION ); Dungeon.observe(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java index 1bc7381f2..62b685ffa 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfPurity.java @@ -106,7 +106,7 @@ public class PotionOfPurity extends Potion { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { GLog.w( TXT_NO_SMELL ); Buff.prolong( hero, GasesImmunity.class, GasesImmunity.DURATION ); setKnown(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java index becb676a7..c3db3bec7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfStrength.java @@ -29,7 +29,7 @@ public class PotionOfStrength extends Potion { } @Override - protected void apply( Hero hero ) { + public void apply( Hero hero ) { setKnown(); hero.STR++; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index 68f4cff1b..82892ff69 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -152,6 +152,7 @@ public class ItemSpriteSheet { public static final int STEAK = 114; public static final int OVERPRICED = 115; public static final int CARPACCIO = 116; + public static final int BLANDFRUIT = 117; // Bags public static final int POUCH = 83;