v0.2.2: fixed a bug with the ghost quest.

This commit is contained in:
Evan Debenham 2014-10-25 14:11:08 -04:00
parent 161b444d67
commit 2d176b4b62

View File

@ -155,21 +155,25 @@ public class Ghost extends NPC {
Sample.INSTANCE.play( Assets.SND_GHOST ); Sample.INSTANCE.play( Assets.SND_GHOST );
if (Quest.given) { if (Quest.given) {
if (Quest.weapon != null) {
if (Quest.processed || Dungeon.hero.belongings.getItem( RatSkull.class ) != null){ if (Quest.processed || Dungeon.hero.belongings.getItem(RatSkull.class) != null) {
GameScene.show( new WndSadGhost( this, Quest.type ) ); GameScene.show(new WndSadGhost(this, Quest.type));
} else { } else {
switch (Quest.type){ switch (Quest.type) {
case 1: default: case 1:
GameScene.show( new WndQuest( this, TXT_RAT2 ) ); break; default:
GameScene.show(new WndQuest(this, TXT_RAT2));
break;
case 2: case 2:
GameScene.show( new WndQuest( this, TXT_GNOLL2 ) ); break; GameScene.show(new WndQuest(this, TXT_GNOLL2));
break;
case 3: case 3:
GameScene.show( new WndQuest( this, TXT_CRAB2 ) ); break; GameScene.show(new WndQuest(this, TXT_CRAB2));
break;
} }
int newPos = -1; int newPos = -1;
for (int i=0; i < 10; i++) { for (int i = 0; i < 10; i++) {
newPos = Dungeon.level.randomRespawnCell(); newPos = Dungeon.level.randomRespawnCell();
if (newPos != -1) { if (newPos != -1) {
break; break;
@ -177,15 +181,15 @@ public class Ghost extends NPC {
} }
if (newPos != -1) { if (newPos != -1) {
Actor.freeCell( pos ); Actor.freeCell(pos);
CellEmitter.get( pos ).start( Speck.factory( Speck.LIGHT ), 0.2f, 3 ); CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
pos = newPos; pos = newPos;
sprite.place( pos ); sprite.place(pos);
sprite.visible = Dungeon.visible[pos]; sprite.visible = Dungeon.visible[pos];
} }
} }
}
} else { } else {
Mob questBoss; Mob questBoss;
String txt_quest; String txt_quest;