use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.
the class TownsfolkMovieNPC method interact.
@Override
public boolean interact(final Hero hero) {
getSprite().turnTo(getPos(), hero.getPos());
GameScene.show(new WndQuest(this, TXT_MESSAGE));
return true;
}
use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.
the class TownsfolkNPC method interact.
@Override
public boolean interact(final Hero hero) {
getSprite().turnTo(getPos(), hero.getPos());
int index = Random.Int(0, TXT_PHRASES.length);
GameScene.show(new WndQuest(this, TXT_PHRASES[index]));
return true;
}
use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.
the class CagedKobold method interact.
@Override
public boolean interact(final Hero hero) {
getSprite().turnTo(getPos(), hero.getPos());
if (Quest.completed) {
return true;
}
if (Quest.given) {
Item item = hero.belongings.getItem(IceKey.class);
if (item != null) {
item.removeItemFrom(Dungeon.hero);
Item reward = new CandleOfMindVision();
if (reward.doPickUp(Dungeon.hero)) {
GLog.i(Hero.TXT_YOU_NOW_HAVE, reward.name());
} else {
Dungeon.level.drop(reward, hero.getPos()).sprite.drop();
}
Quest.complete();
GameScene.show(new WndQuest(this, TXT_QUEST_END));
CellEmitter.get(getPos()).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
getSprite().killAndErase();
destroy();
} else {
int index = Random.Int(0, TXT_PHRASES.length);
say(TXT_PHRASES[index]);
}
} else {
GameScene.show(new WndQuest(this, TXT_QUEST_START));
Quest.given = true;
Quest.process();
Journal.add(Journal.Feature.CAGEDKOBOLD.desc());
}
return true;
}
use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.
the class Ghost method interact.
@Override
public boolean interact(final Hero hero) {
getSprite().turnTo(getPos(), hero.getPos());
if (hero.heroClass.equals(HeroClass.NECROMANCER)) {
if (!introduced) {
window = new WndSadGhostNecro();
GameScene.show(window);
introduced = true;
return true;
} else {
if (window != null) {
persuade = window.getPersuade();
}
}
}
Sample.INSTANCE.play(Assets.SND_GHOST);
if (persuade || Quest.given) {
Item item = Quest.alternative ? hero.belongings.getItem(RatSkull.class) : hero.belongings.getItem(DriedRose.class);
if (persuade) {
item = Quest.alternative ? new RatSkull() : new DriedRose();
}
if (persuade || item != null) {
GameScene.show(new WndSadGhost(this, item));
} else {
GameScene.show(new WndQuest(this, Quest.alternative ? TXT_RAT2 : TXT_ROSE2));
int newPos = -1;
for (int i = 0; i < 10; i++) {
newPos = Dungeon.level.randomRespawnCell();
if (newPos != -1) {
break;
}
}
if (newPos != -1) {
Actor.freeCell(getPos());
CellEmitter.get(getPos()).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
setPos(newPos);
getSprite().place(getPos());
getSprite().setVisible(Dungeon.visible[getPos()]);
}
}
} else {
GameScene.show(new WndQuest(this, Quest.alternative ? TXT_RAT1 : TXT_ROSE1));
Quest.given = true;
Journal.add(Journal.Feature.GHOST.desc());
}
return true;
}
Aggregations