diff --git a/core/src/main/assets/buffs.png b/core/src/main/assets/buffs.png index d27cca047..9534c1829 100644 Binary files a/core/src/main/assets/buffs.png and b/core/src/main/assets/buffs.png differ diff --git a/core/src/main/assets/large_buffs.png b/core/src/main/assets/large_buffs.png index e08d35f9b..37a4eceb5 100644 Binary files a/core/src/main/assets/large_buffs.png and b/core/src/main/assets/large_buffs.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index 259ab28b8..6c939cd13 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; -import com.shatteredpixel.shatteredpixeldungeon.items.food.Feast; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; @@ -62,7 +61,7 @@ public class Hunger extends Buff implements Hero.Doom { @Override public boolean act() { - if (Dungeon.level.locked || target.buff(Feast.WellFed.class) == null){ + if (Dungeon.level.locked || target.buff(WellFed.class) != null){ spend(STEP); return true; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java new file mode 100644 index 000000000..e5a424912 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java @@ -0,0 +1,80 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; + +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; +import com.watabou.utils.Bundle; + +public class WellFed extends Buff { + + { + type = buffType.POSITIVE; + announced = true; + } + + //heals one HP every 10 turns for 450 turns + int left = (int)Hunger.STARVING; + + @Override + public boolean act() { + left --; + if (left < 0){ + detach(); + return true; + } else if (left % 10 == 0){ + target.HP = Math.min(target.HT, target.HP + 1); + } + + spend(TICK); + return true; + } + + @Override + public int icon() { + return BuffIndicator.WELL_FED; + } + + @Override + public String toString() { + return Messages.get(this, "name"); + } + + @Override + public String desc() { + return Messages.get(this, "desc", left + 1); + } + + private static final String LEFT = "left"; + + @Override + public void storeInBundle(Bundle bundle) { + super.storeInBundle(bundle); + bundle.put(LEFT, left); + } + + @Override + public void restoreFromBundle(Bundle bundle) { + super.restoreFromBundle(bundle); + left = bundle.getInt(LEFT); + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Feast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Feast.java index ea35d49a4..ad9410dc3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Feast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/food/Feast.java @@ -22,8 +22,8 @@ package com.shatteredpixel.shatteredpixeldungeon.items.food; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; -import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WellFed; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -40,18 +40,12 @@ public class Feast extends Food { @Override protected void satisfy(Hero hero) { super.satisfy( hero ); - - Buff.affect(hero, WellFed.class, Hunger.STARVING); + Buff.affect(hero, WellFed.class); } @Override public int price() { - return 50 * quantity; - } - - //TODO visuals, is this the effect we want as well? - public static class WellFed extends FlavourBuff { - + return 30 * quantity; } public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index 5a5848a91..1d8a63c23 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -87,6 +87,7 @@ public class BuffIndicator extends Component { public static final int BERSERK = 40; public static final int MOMENTUM = 41; public static final int PREPARATION = 42; + public static final int WELL_FED = 43; public static final int SIZE = 7; diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index a6e89dda0..ef268dcdf 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -264,6 +264,9 @@ actors.buffs.weakness.name=Weakened actors.buffs.weakness.heromsg=You feel weakened! actors.buffs.weakness.desc=Everything suddenly seems much heavier.\n\nWeakening magic reduces a character's physical strength. The hero will lose 2 points of effective strength, while enemies will deal reduced damage.\n\nTurns of weakness remaining: %s. +actors.buffs.wellfed.name=Well Fed +actors.buffs.wellfed.desc=You feel quite satisfied and full.\n\nWhile well fed, your hunger will not increase, and you will heal an additional amount of health over time.\n\nTurns remaining: %d. + ###hero diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index fedc552ae..b849783ff 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -410,7 +410,8 @@ items.food.chargrilledmeat.name=chargrilled meat items.food.chargrilledmeat.desc=It looks like a decent steak. items.food.feast.name=feast -items.food.feast.desc=TODO +items.food.feast.eat_msg=That meal was incredible! +items.food.feast.desc=A great variety of delicious food! This with satiate you far more than any other meal. items.food.food.name=ration of food items.food.food.ac_eat=EAT @@ -445,7 +446,7 @@ items.food.smallration.desc=It looks exactly like a standard ration of food but items.food.stewedmeat.name=stewed meat items.food.stewedmeat.eat_msg=That food tasted ok. -items.food.stewedmeat.desc=TODO +items.food.stewedmeat.desc=Stewing the meat has cleansed it of any disease or parasites. It should be safe to eat.