V0.2.0: bugfix/light class restructure

This commit is contained in:
Evan Debenham 2014-08-28 00:29:29 -04:00
parent d1fae63918
commit 871e00f597
2 changed files with 8 additions and 3 deletions

View File

@ -21,7 +21,7 @@ public class Artifact extends KindofMisc {
protected Buff activeBuff; protected Buff activeBuff;
//level is used internally to track upgrades to artifacts, size/logic varies per artifact. //level is used internally to track upgrades to artifacts, size/logic varies per artifact.
protected int level = 1;
//the current artifact charge //the current artifact charge
protected int charge = 0; protected int charge = 0;
//the % towards next charge, should roll over at a value of 1 or higher. //the % towards next charge, should roll over at a value of 1 or higher.

View File

@ -26,7 +26,7 @@ import java.util.ArrayList;
*/ */
public class HornOfPlenty extends Artifact { 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"; name = "Horn of Plenty";
@ -131,7 +131,7 @@ public class HornOfPlenty extends Artifact {
public boolean act() { public boolean act() {
if (charge < chargeCap) { if (charge < chargeCap) {
partialCharge += (1/(200-level)); partialCharge += (1f/(200-level));
if (partialCharge >= 1) { if (partialCharge >= 1) {
charge++; charge++;
@ -160,6 +160,11 @@ public class HornOfPlenty extends Artifact {
if (item instanceof Blandfruit && ((Blandfruit) item).potionAttrib == null){ if (item instanceof Blandfruit && ((Blandfruit) item).potionAttrib == null){
GLog.w("the horn rejects your unprepared blandfruit."); GLog.w("the horn rejects your unprepared blandfruit.");
} else { } else {
Hero hero = Dungeon.hero;
hero.sprite.operate( hero.pos );
hero.busy();
hero.spend( TIME_TO_EAT );
curItem.level += ((Food)item).hornValue; curItem.level += ((Food)item).hornValue;
if (curItem.level >= 150){ if (curItem.level >= 150){
curItem.level = 150; curItem.level = 150;