From b465f050709ef5a7a23a4be55227145a01b6c6f0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 24 Mar 2016 18:53:57 -0400 Subject: [PATCH] v0.3.5: Corrections to game win behaviour - Fixed a rare bug where the player could die as they win the game. - Winning the game now always takes you to the rankings page. --- .../shatteredpixeldungeon/items/Amulet.java | 10 +++++----- .../shatteredpixeldungeon/scenes/AmuletScene.java | 2 +- .../shatteredpixeldungeon/scenes/SurfaceScene.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java index f8a4cb8b1..699ee7837 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Amulet.java @@ -20,16 +20,16 @@ */ package com.shatteredpixel.shatteredpixeldungeon.items; -import java.io.IOException; -import java.util.ArrayList; - -import com.watabou.noosa.Game; import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.scenes.AmuletScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.watabou.noosa.Game; + +import java.io.IOException; +import java.util.ArrayList; public class Amulet extends Item { @@ -68,7 +68,7 @@ public class Amulet extends Item { if (!Statistics.amuletObtained) { Statistics.amuletObtained = true; Badges.validateVictory(); - + hero.spend(-TIME_TO_PICK_UP); showAmuletScene( true ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/AmuletScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/AmuletScene.java index dd0e3774d..44388335f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/AmuletScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/AmuletScene.java @@ -63,7 +63,7 @@ public class AmuletScene extends PixelScene { protected void onClick() { Dungeon.win( Amulet.class ); Dungeon.deleteGame( Dungeon.hero.heroClass, true ); - Game.switchScene( noText ? TitleScene.class : RankingsScene.class ); + Game.switchScene( RankingsScene.class ); } }; btnExit.setSize( WIDTH, BTN_HEIGHT ); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java index abd56272e..e3371fa96 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/SurfaceScene.java @@ -170,7 +170,7 @@ public class SurfaceScene extends PixelScene { RedButton gameOver = new RedButton( Messages.get(this, "exit") ) { protected void onClick() { - Game.switchScene( TitleScene.class ); + Game.switchScene( RankingsScene.class ); } }; gameOver.setSize( SKY_WIDTH - FRAME_MARGIN_X * 2, BUTTON_HEIGHT );