Search in sources :

Example 1 with WndQuest

use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.

the class AzuterronNPC method interact.

@Override
public boolean interact(final Hero hero) {
    getSprite().turnTo(getPos(), hero.getPos());
    if (Quest.completed) {
        sell();
        return true;
    }
    if (Quest.given) {
        Item item = hero.belongings.getItem(HeartOfDarkness.class);
        if (item != null) {
            item.removeItemFrom(Dungeon.hero);
            Item reward = new PotionOfMight();
            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));
        } else {
            GameScene.show(new WndQuest(this, TXT_QUEST));
        }
    } else {
        GameScene.show(new WndQuest(this, TXT_QUEST_START));
        Quest.given = true;
        Quest.process();
        Journal.add(Journal.Feature.AZUTERRON.desc());
    }
    return true;
}
Also used : Item(com.watabou.pixeldungeon.items.Item) WndTradeItem(com.watabou.pixeldungeon.windows.WndTradeItem) WndQuest(com.watabou.pixeldungeon.windows.WndQuest) PotionOfMight(com.watabou.pixeldungeon.items.potions.PotionOfMight)

Example 2 with WndQuest

use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.

the class BellaNPC method interact.

@Override
public boolean interact(final Hero hero) {
    getSprite().turnTo(getPos(), hero.getPos());
    GameScene.show(new WndQuest(this, TXT_MESSAGE));
    return true;
}
Also used : WndQuest(com.watabou.pixeldungeon.windows.WndQuest)

Example 3 with WndQuest

use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.

the class ScarecrowNPC method interact.

@Override
public boolean interact(final Hero hero) {
    getSprite().turnTo(getPos(), hero.getPos());
    if (Quest.completed) {
        this.die(null);
        return true;
    }
    if (Quest.given) {
        Item item = hero.belongings.getItem(Candy.class);
        if (item != null && item.quantity() == 5) {
            item.removeItemFrom(Dungeon.hero);
            Item reward = new PumpkinPie();
            reward.quantity(5);
            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));
        } else {
            GameScene.show(new WndQuest(this, TXT_QUEST));
        }
    } else {
        String txtQuestStart = TXT_QUEST_START_M;
        if (Dungeon.hero.getGender() == Utils.FEMININE) {
            txtQuestStart = TXT_QUEST_START_F;
        }
        GameScene.show(new WndQuest(this, txtQuestStart));
        Quest.given = true;
        Quest.process(hero.getPos());
        Journal.add(Journal.Feature.SCARECROW.desc());
    }
    return true;
}
Also used : Item(com.watabou.pixeldungeon.items.Item) WndTradeItem(com.watabou.pixeldungeon.windows.WndTradeItem) PumpkinPie(com.nyrds.pixeldungeon.items.food.PumpkinPie) WndQuest(com.watabou.pixeldungeon.windows.WndQuest)

Example 4 with WndQuest

use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.

the class TownGuardNPC 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;
}
Also used : WndQuest(com.watabou.pixeldungeon.windows.WndQuest)

Example 5 with WndQuest

use of com.watabou.pixeldungeon.windows.WndQuest in project pixel-dungeon-remix by NYRDS.

the class TownsfolkSilentNPC 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;
}
Also used : WndQuest(com.watabou.pixeldungeon.windows.WndQuest)

Aggregations

WndQuest (com.watabou.pixeldungeon.windows.WndQuest)14 Item (com.watabou.pixeldungeon.items.Item)5 DarkGold (com.watabou.pixeldungeon.items.quest.DarkGold)2 Pickaxe (com.watabou.pixeldungeon.items.quest.Pickaxe)2 WndBlacksmith (com.watabou.pixeldungeon.windows.WndBlacksmith)2 WndTradeItem (com.watabou.pixeldungeon.windows.WndTradeItem)2 CandleOfMindVision (com.nyrds.pixeldungeon.items.artifacts.CandleOfMindVision)1 RatArmor (com.nyrds.pixeldungeon.items.common.RatArmor)1 PumpkinPie (com.nyrds.pixeldungeon.items.food.PumpkinPie)1 WndSadGhostNecro (com.nyrds.pixeldungeon.windows.WndSadGhostNecro)1 SkeletonKey (com.watabou.pixeldungeon.items.keys.SkeletonKey)1 PotionOfMight (com.watabou.pixeldungeon.items.potions.PotionOfMight)1 DriedRose (com.watabou.pixeldungeon.items.quest.DriedRose)1 RatSkull (com.watabou.pixeldungeon.items.quest.RatSkull)1 WndSadGhost (com.watabou.pixeldungeon.windows.WndSadGhost)1