Search in sources :

Example 11 with WndQuest

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

Example 12 with WndQuest

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

Example 13 with WndQuest

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

Example 14 with WndQuest

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;
}
Also used : Item(com.watabou.pixeldungeon.items.Item) WndQuest(com.watabou.pixeldungeon.windows.WndQuest) WndSadGhostNecro(com.nyrds.pixeldungeon.windows.WndSadGhostNecro) WndSadGhost(com.watabou.pixeldungeon.windows.WndSadGhost) DriedRose(com.watabou.pixeldungeon.items.quest.DriedRose) RatSkull(com.watabou.pixeldungeon.items.quest.RatSkull)

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