From b3b39bdbb2f380caf26d6c713cfb561bb7bf3010 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 30 Aug 2014 02:30:43 -0400 Subject: [PATCH] V0.2.0: added death interaction with Chalice of Blood --- .../items/artifacts/ChaliceOfBlood.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java index 3e420c2c0..8b88afa53 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java @@ -1,7 +1,11 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import java.util.ArrayList; @@ -31,13 +35,21 @@ public class ChaliceOfBlood extends Artifact { @Override public void execute( Hero hero, String action ) { + super.execute(hero, action); if (action.equals(AC_PRICK)){ //TODO: add warning screen if chalice would take more than 75% current hp. + hero.spendAndNext(1f); hero.damage((level*2)*(level*2), this); - level++; - } else - super.execute(hero, action); + + if (!hero.isAlive()) { + Dungeon.fail(Utils.format(ResultDescriptions.ITEM, name, Dungeon.depth)); + GLog.n("The Chalice sucks your life essence dry..."); + } else + level++; + + } + } @Override