use of com.nyrds.pixeldungeon.windows.WndSadGhostNecro 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