Search in sources :

Example 1 with CandleOfMindVision

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;
}
Also used : Item(com.watabou.pixeldungeon.items.Item) WndQuest(com.watabou.pixeldungeon.windows.WndQuest) CandleOfMindVision(com.nyrds.pixeldungeon.items.artifacts.CandleOfMindVision)

Aggregations

CandleOfMindVision (com.nyrds.pixeldungeon.items.artifacts.CandleOfMindVision)1 Item (com.watabou.pixeldungeon.items.Item)1 WndQuest (com.watabou.pixeldungeon.windows.WndQuest)1