v1.4.1: fixed cursed horn of plenty affecting more than food
This commit is contained in:
@@ -124,13 +124,6 @@ public class Hunger extends Buff implements Hero.Doom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void satisfy( float energy ) {
|
public void satisfy( float energy ) {
|
||||||
|
|
||||||
Artifact.ArtifactBuff buff = target.buff( HornOfPlenty.hornRecharge.class );
|
|
||||||
if (buff != null && buff.isCursed()){
|
|
||||||
energy *= 0.67f;
|
|
||||||
GLog.n( Messages.get(this, "cursedhorn") );
|
|
||||||
}
|
|
||||||
|
|
||||||
affectHunger( energy, false );
|
affectHunger( energy, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
@@ -102,11 +104,18 @@ public class Food extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void satisfy( Hero hero ){
|
protected void satisfy( Hero hero ){
|
||||||
|
float foodVal = energy;
|
||||||
if (Dungeon.isChallenged(Challenges.NO_FOOD)){
|
if (Dungeon.isChallenged(Challenges.NO_FOOD)){
|
||||||
Buff.affect(hero, Hunger.class).satisfy(energy/3f);
|
foodVal /= 3f;
|
||||||
} else {
|
|
||||||
Buff.affect(hero, Hunger.class).satisfy(energy);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Artifact.ArtifactBuff buff = hero.buff( HornOfPlenty.hornRecharge.class );
|
||||||
|
if (buff != null && buff.isCursed()){
|
||||||
|
foodVal *= 0.67f;
|
||||||
|
GLog.n( Messages.get(Hunger.class, "cursedhorn") );
|
||||||
|
}
|
||||||
|
|
||||||
|
Buff.affect(hero, Hunger.class).satisfy(foodVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user