V0.2.0: Partially implemented Chalice of Blood, needs testing/refining
This commit is contained in:
parent
d84ed470cd
commit
41d0ca00da
|
@ -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 {
|
||||
|
||||
|
@ -32,12 +33,9 @@ public class Regeneration extends Buff {
|
|||
target.HP += 1;
|
||||
}
|
||||
|
||||
int bonus = 0;
|
||||
for (Buff buff : target.buffs( RingOfMending.Rejuvenation.class )) {
|
||||
bonus += ((RingOfMending.Rejuvenation)buff).level;
|
||||
}
|
||||
ChaliceOfBlood.chaliceRegen regenBuff = Dungeon.hero.buff( ChaliceOfBlood.chaliceRegen.class);
|
||||
|
||||
spend( (float)(REGENERATION_DELAY / Math.pow( 1.2, bonus )) );
|
||||
spend( REGENERATION_DELAY - regenBuff.level() );
|
||||
|
||||
} else {
|
||||
|
||||
|
|
|
@ -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<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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user