Search in sources :

Example 1 with WndWandmaker

use of com.shatteredpixel.shatteredpixeldungeon.windows.WndWandmaker in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Wandmaker method interact.

@Override
public boolean interact() {
    sprite.turnTo(pos, Dungeon.hero.pos);
    if (Quest.given) {
        Item item;
        switch(Quest.type) {
            case 1:
            default:
                item = Dungeon.hero.belongings.getItem(CorpseDust.class);
                break;
            case 2:
                item = Dungeon.hero.belongings.getItem(Embers.class);
                break;
            case 3:
                item = Dungeon.hero.belongings.getItem(Rotberry.Seed.class);
                break;
        }
        if (item != null) {
            GameScene.show(new WndWandmaker(this, item));
        } else {
            String msg = "";
            switch(Quest.type) {
                case 1:
                    msg = Messages.get(this, "reminder_dust", Dungeon.hero.givenName());
                    break;
                case 2:
                    msg = Messages.get(this, "reminder_ember", Dungeon.hero.givenName());
                    break;
                case 3:
                    msg = Messages.get(this, "reminder_berry", Dungeon.hero.givenName());
                    break;
            }
            GameScene.show(new WndQuest(this, msg));
        }
    } else {
        String msg1 = "";
        String msg2 = "";
        switch(Dungeon.hero.heroClass) {
            case WARRIOR:
                msg1 += Messages.get(this, "intro_warrior");
                break;
            case ROGUE:
                msg1 += Messages.get(this, "intro_rogue");
                break;
            case MAGE:
                msg1 += Messages.get(this, "intro_mage", Dungeon.hero.givenName());
                break;
            case HUNTRESS:
                msg1 += Messages.get(this, "intro_huntress");
                break;
        }
        msg1 += Messages.get(this, "intro_1");
        switch(Quest.type) {
            case 1:
                msg2 += Messages.get(this, "intro_dust");
                break;
            case 2:
                msg2 += Messages.get(this, "intro_ember");
                break;
            case 3:
                msg2 += Messages.get(this, "intro_berry");
                break;
        }
        msg2 += Messages.get(this, "intro_2");
        final String msg2final = msg2;
        final NPC wandmaker = this;
        GameScene.show(new WndQuest(wandmaker, msg1) {

            @Override
            public void hide() {
                super.hide();
                GameScene.show(new WndQuest(wandmaker, msg2final));
            }
        });
        Notes.add(Notes.Landmark.WANDMAKER);
        Quest.given = true;
    }
    return false;
}
Also used : Embers(com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers) WndWandmaker(com.shatteredpixel.shatteredpixeldungeon.windows.WndWandmaker) Item(com.shatteredpixel.shatteredpixeldungeon.items.Item) WndQuest(com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest) CorpseDust(com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust)

Aggregations

Item (com.shatteredpixel.shatteredpixeldungeon.items.Item)1 CorpseDust (com.shatteredpixel.shatteredpixeldungeon.items.quest.CorpseDust)1 Embers (com.shatteredpixel.shatteredpixeldungeon.items.quest.Embers)1 WndQuest (com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest)1 WndWandmaker (com.shatteredpixel.shatteredpixeldungeon.windows.WndWandmaker)1