From 871e00f5974789b91211622492e91bbe402cf57a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 28 Aug 2014 00:29:29 -0400 Subject: [PATCH] V0.2.0: bugfix/light class restructure --- .../shatteredpixeldungeon/items/artifacts/Artifact.java | 2 +- .../items/artifacts/HornOfPlenty.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 9168b4e2d..860bc0b54 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -21,7 +21,7 @@ public class Artifact extends KindofMisc { protected Buff activeBuff; //level is used internally to track upgrades to artifacts, size/logic varies per artifact. - protected int level = 1; + //the current artifact charge protected int charge = 0; //the % towards next charge, should roll over at a value of 1 or higher. diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java index 4787b27d5..98da767a2 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/HornOfPlenty.java @@ -26,7 +26,7 @@ import java.util.ArrayList; */ public class HornOfPlenty extends Artifact { - //TODO: test for bugs, tune numbers, add sprite switching. + //TODO: tune numbers, add sprite switching, add polish. { name = "Horn of Plenty"; @@ -131,7 +131,7 @@ public class HornOfPlenty extends Artifact { public boolean act() { if (charge < chargeCap) { - partialCharge += (1/(200-level)); + partialCharge += (1f/(200-level)); if (partialCharge >= 1) { charge++; @@ -160,6 +160,11 @@ public class HornOfPlenty extends Artifact { if (item instanceof Blandfruit && ((Blandfruit) item).potionAttrib == null){ GLog.w("the horn rejects your unprepared blandfruit."); } else { + Hero hero = Dungeon.hero; + hero.sprite.operate( hero.pos ); + hero.busy(); + hero.spend( TIME_TO_EAT ); + curItem.level += ((Food)item).hornValue; if (curItem.level >= 150){ curItem.level = 150;