From 2d176b4b6282d3367f31722e65d285cb337c6359 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 25 Oct 2014 14:11:08 -0400 Subject: [PATCH] v0.2.2: fixed a bug with the ghost quest. --- .../actors/mobs/npcs/Ghost.java | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java index 28880fbc6..a20fca641 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Ghost.java @@ -155,37 +155,41 @@ public class Ghost extends NPC { Sample.INSTANCE.play( Assets.SND_GHOST ); if (Quest.given) { - - if (Quest.processed || Dungeon.hero.belongings.getItem( RatSkull.class ) != null){ - GameScene.show( new WndSadGhost( this, Quest.type ) ); - } else { - switch (Quest.type){ - case 1: default: - GameScene.show( new WndQuest( this, TXT_RAT2 ) ); break; - case 2: - GameScene.show( new WndQuest( this, TXT_GNOLL2 ) ); break; - case 3: - GameScene.show( new WndQuest( this, TXT_CRAB2 ) ); break; + if (Quest.weapon != null) { + if (Quest.processed || Dungeon.hero.belongings.getItem(RatSkull.class) != null) { + GameScene.show(new WndSadGhost(this, Quest.type)); + } else { + switch (Quest.type) { + case 1: + default: + GameScene.show(new WndQuest(this, TXT_RAT2)); + break; + case 2: + GameScene.show(new WndQuest(this, TXT_GNOLL2)); + break; + case 3: + GameScene.show(new WndQuest(this, TXT_CRAB2)); + break; + } + + int newPos = -1; + for (int i = 0; i < 10; i++) { + newPos = Dungeon.level.randomRespawnCell(); + if (newPos != -1) { + break; + } + } + if (newPos != -1) { + + Actor.freeCell(pos); + + CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3); + pos = newPos; + sprite.place(pos); + sprite.visible = Dungeon.visible[pos]; + } } - - int newPos = -1; - for (int i=0; i < 10; i++) { - newPos = Dungeon.level.randomRespawnCell(); - if (newPos != -1) { - break; - } - } - if (newPos != -1) { - - Actor.freeCell( pos ); - - CellEmitter.get( pos ).start( Speck.factory( Speck.LIGHT ), 0.2f, 3 ); - pos = newPos; - sprite.place( pos ); - sprite.visible = Dungeon.visible[pos]; - } - } - + } } else { Mob questBoss; String txt_quest;