V0.2.0: Partially implemented Chalice of Blood, needs testing/refining

This commit is contained in:
Evan Debenham 2014-08-29 15:19:35 -04:00
parent d84ed470cd
commit 41d0ca00da
2 changed files with 41 additions and 7 deletions

View File

@ -17,8 +17,9 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; 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 { public class Regeneration extends Buff {
@ -32,12 +33,9 @@ public class Regeneration extends Buff {
target.HP += 1; target.HP += 1;
} }
int bonus = 0; ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
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 { } else {

View File

@ -1,11 +1,16 @@
package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; package com.shatteredpixel.shatteredpixeldungeon.items.artifacts;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import java.util.ArrayList;
/** /**
* Created by debenhame on 27/08/2014. * Created by debenhame on 27/08/2014.
*/ */
public class ChaliceOfBlood extends Artifact { public class ChaliceOfBlood extends Artifact {
//TODO: add polish
//TODO: add sprite switching
{ {
name = "Chalice of Blood"; name = "Chalice of Blood";
@ -14,5 +19,36 @@ public class ChaliceOfBlood extends Artifact {
//charge & chargecap are unused //charge & chargecap are unused
} }
public static final String AC_PRICK = "PRICK";
@Override
public ArrayList<String> actions( Hero hero ) {
ArrayList<String> 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;
}
}
} }