From f1f68163ada4f3e57006fac31d97e6b88c5a5e74 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 23 May 2015 03:40:31 -0400 Subject: [PATCH] v0.3.0: improved game crash cursed wand effect --- .../shatteredpixeldungeon/items/wands/CursedWand.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java index fc0be03e8..ae129a4d9 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java @@ -46,6 +46,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; import com.shatteredpixel.shatteredpixeldungeon.ui.HealthIndicator; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.Utils; +import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; import com.watabou.noosa.Game; import com.watabou.noosa.audio.Sample; import com.watabou.utils.Callback; @@ -376,8 +377,14 @@ public class CursedWand { case 2: try { Dungeon.saveAll(); - //TODO: consider a more elegant way to accomplish this effect. - throw new RuntimeException("critical wand exception"); + GameScene.show( + new WndOptions("CURSED WAND ERROR", "this application will now self-destruct", "abort", "retry", "fail") { + @Override + public void hide() { + throw new RuntimeException("critical wand exception"); + } + } + ); } catch(IOException e){ //oookay maybe don't kill the game if the save failed. GLog.i("nothing happens");