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.
This commit is contained in:
Evan Debenham 2016-03-24 18:53:57 -04:00
parent a5fc42c80d
commit b465f05070
3 changed files with 7 additions and 7 deletions

View File

@ -20,16 +20,16 @@
*/ */
package com.shatteredpixel.shatteredpixeldungeon.items; 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.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.Statistics; import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.scenes.AmuletScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.AmuletScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.watabou.noosa.Game;
import java.io.IOException;
import java.util.ArrayList;
public class Amulet extends Item { public class Amulet extends Item {
@ -68,7 +68,7 @@ public class Amulet extends Item {
if (!Statistics.amuletObtained) { if (!Statistics.amuletObtained) {
Statistics.amuletObtained = true; Statistics.amuletObtained = true;
Badges.validateVictory(); Badges.validateVictory();
hero.spend(-TIME_TO_PICK_UP);
showAmuletScene( true ); showAmuletScene( true );
} }

View File

@ -63,7 +63,7 @@ public class AmuletScene extends PixelScene {
protected void onClick() { protected void onClick() {
Dungeon.win( Amulet.class ); Dungeon.win( Amulet.class );
Dungeon.deleteGame( Dungeon.hero.heroClass, true ); Dungeon.deleteGame( Dungeon.hero.heroClass, true );
Game.switchScene( noText ? TitleScene.class : RankingsScene.class ); Game.switchScene( RankingsScene.class );
} }
}; };
btnExit.setSize( WIDTH, BTN_HEIGHT ); btnExit.setSize( WIDTH, BTN_HEIGHT );

View File

@ -170,7 +170,7 @@ public class SurfaceScene extends PixelScene {
RedButton gameOver = new RedButton( Messages.get(this, "exit") ) { RedButton gameOver = new RedButton( Messages.get(this, "exit") ) {
protected void onClick() { protected void onClick() {
Game.switchScene( TitleScene.class ); Game.switchScene( RankingsScene.class );
} }
}; };
gameOver.setSize( SKY_WIDTH - FRAME_MARGIN_X * 2, BUTTON_HEIGHT ); gameOver.setSize( SKY_WIDTH - FRAME_MARGIN_X * 2, BUTTON_HEIGHT );