diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java index 434c9a4bf..bcde74270 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Regeneration.java @@ -17,8 +17,9 @@ */ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfMending; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.ChaliceOfBlood; public class Regeneration extends Buff { @@ -31,13 +32,10 @@ public class Regeneration extends Buff { if (target.HP < target.HT && !((Hero)target).isStarving()) { target.HP += 1; } + + ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class); - int bonus = 0; - for (Buff buff : target.buffs( RingOfMending.Rejuvenation.class )) { - bonus += ((RingOfMending.Rejuvenation)buff).level; - } - - spend( (float)(REGENERATION_DELAY / Math.pow( 1.2, bonus )) ); + spend( REGENERATION_DELAY - regenBuff.level() ); } else { diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java index 72d5fcd77..3e420c2c0 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java @@ -1,11 +1,16 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import java.util.ArrayList; + /** * Created by debenhame on 27/08/2014. */ public class ChaliceOfBlood extends Artifact { + //TODO: add polish + //TODO: add sprite switching { name = "Chalice of Blood"; @@ -14,5 +19,36 @@ public class ChaliceOfBlood extends Artifact { //charge & chargecap are unused } + public static final String AC_PRICK = "PRICK"; + + @Override + public ArrayList actions( Hero hero ) { + ArrayList actions = super.actions( hero ); + if (isEquipped( hero ) && level < 8) + actions.add(AC_PRICK); + return actions; + } + + @Override + public void execute( Hero hero, String action ) { + if (action.equals(AC_PRICK)){ + //TODO: add warning screen if chalice would take more than 75% current hp. + + hero.damage((level*2)*(level*2), this); + level++; + } else + super.execute(hero, action); + } + + @Override + protected ArtifactBuff passiveBuff() { + return new chaliceRegen(); + } + + public class chaliceRegen extends ArtifactBuff { + public int level() { + return level; + } + } }