From a429a55007bba8cb836b810e83b862a2ec8d0a91 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 21 Aug 2018 13:46:48 -0400 Subject: [PATCH] v0.7.0: polished new food items --- core/src/main/assets/buffs.png | Bin 1122 -> 1147 bytes core/src/main/assets/large_buffs.png | Bin 2249 -> 2297 bytes .../actors/buffs/Hunger.java | 3 +- .../actors/buffs/WellFed.java | 80 ++++++++++++++++++ .../items/food/Feast.java | 12 +-- .../ui/BuffIndicator.java | 1 + .../messages/actors/actors.properties | 3 + .../messages/items/items.properties | 5 +- 8 files changed, 91 insertions(+), 13 deletions(-) create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java diff --git a/core/src/main/assets/buffs.png b/core/src/main/assets/buffs.png index d27cca047d6bd4fb386b4cbf3d91b6a84ed8fad0..9534c18292ee179df3b0dafa71650b761918b9e0 100644 GIT binary patch delta 674 zcmV;T0$u&$2>S?-Bmv=(CE^F6#gPU4w;PiS0U-f5lPv+ve_k1|rVT|=7-lHrma+{b zz<|ggfo!hER&{A>)K+6%|Njr#cXI3NW|&ZB8Gzr*D+Pu7<>WkLMgj@rlkf;~1adus zFKp(^fblF6NK+!<{y(rkn$~X#NTB;H@Kp)K2NHPC)_miS#)JD30C)mHK(`Nj3A8%! zO#y@iVng9@e+NvEK+k#xF$;m5B>_cn(Pw@i0nPtg2U@3~(@_W1saKr>8AyO70TD`g z_!OA)-MMrIPT>rl3+KwYcFb(V9y=3f>ilrdoCvIp%y|*$C8Edh8wuQs%fa1jFuOyb zswxELRW(Q8wpmx_LIR6MU^!YMaL@U<4+0ND0xJouf5lm88XwgS2w>p?O^fygW@1oO zbyQcyuo~*RxYR({muZ;jCFrS;%br1*% z+=!L{u^}-0sRV+6C$JFLqfyBkJqtWeCb~4A&HNPx%r^|8(#RkPVBn8H_s`xXAOm$k z^FsoN)s0xt>B03|TlOq77;2LVqYGFD`5ft~^g0vLD+nIAf!5>%8>^AS)0 z{s>w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I{C-oDH+}Z z09!x}ymG9zz#K)e=*malF^J%twiV|0ilFeo`~nI9$c+%Tz+RgG7~p&a1B&K9vhWm8 z&~Oam7!YK11TZ=V_5sZA9D`T@4<v0?|C{r+ACeUBB$J;o!%iqE#-5(MbC{{{sz#R}%9fv8Z~ zpn$J}378cSmnPs_Mg>HGL`?!Z00oGx0-yr%0R@c5r~z*pJAL^we=LF!)puPFXUtCn z$p3?57BC)j1z^Wv;tGgVpi?pgNsAYN^f4v}2$axQPXKPp6kq{V05(h4Vcx-i_y1KE z0@gr^FHE=vA_c~-5P&x&g;$m#!1A{V==n!ieXD@+6t4zw3zz`bW2Ik04bWAu61Wo@ z1SoxvxoHbbW(D-v{22R>rvTG0s|X@{DS+HNjZk$8G!;P!|MO?s1G;pGzUKV;5mb!Q zFY6ej0FDyda0S>o(8so8Q1kzOOiLi*7!YLaVm<}nKnAj00WyN7PO$6Jr?C;5lqzB0RR91I{{ZRX60px&pH4A002ovPDHLkV1mr!dSL(n 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.