use of com.nyrds.pixeldungeon.items.artifacts.CandleOfMindVision 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;
}
Aggregations