From 09f91c321ef7041a6733865fae5013e09c214988 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 23 Feb 2015 11:49:58 -0500 Subject: [PATCH] v0.2.4: bombs now properly submit a ranking if they kill the player --- .../shatteredpixel/shatteredpixeldungeon/items/Bomb.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java index 6fe5d06b0..a6d52e064 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Bomb.java @@ -17,10 +17,12 @@ */ package com.shatteredpixel.shatteredpixeldungeon.items; +import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; +import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; import com.watabou.noosa.audio.Sample; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; @@ -135,6 +137,10 @@ public class Bomb extends Item { if (dmg > 0) { ch.damage( dmg, this ); } + + if (ch == Dungeon.hero && !ch.isAlive()) + //constant is used here in the rare instance a player is killed by a double bomb. + Dungeon.fail(Utils.format(ResultDescriptions.ITEM, "bomb")); } //destroys items / triggers bombs caught in the blast.