Search in sources :

Example 1 with GnollTrickster

use of com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollTrickster in project shattered-pixel-dungeon-gdx by 00-Evan.

the class Ghost method interact.

@Override
public boolean interact() {
    sprite.turnTo(pos, Dungeon.hero.pos);
    Sample.INSTANCE.play(Assets.SND_GHOST);
    if (Quest.given) {
        if (Quest.weapon != null) {
            if (Quest.processed) {
                GameScene.show(new WndSadGhost(this, Quest.type));
            } else {
                switch(Quest.type) {
                    case 1:
                    default:
                        GameScene.show(new WndQuest(this, Messages.get(this, "rat_2")));
                        break;
                    case 2:
                        GameScene.show(new WndQuest(this, Messages.get(this, "gnoll_2")));
                        break;
                    case 3:
                        GameScene.show(new WndQuest(this, Messages.get(this, "crab_2")));
                        break;
                }
                int newPos = -1;
                for (int i = 0; i < 10; i++) {
                    newPos = Dungeon.level.randomRespawnCell();
                    if (newPos != -1) {
                        break;
                    }
                }
                if (newPos != -1) {
                    CellEmitter.get(pos).start(Speck.factory(Speck.LIGHT), 0.2f, 3);
                    pos = newPos;
                    sprite.place(pos);
                    sprite.visible = Dungeon.level.heroFOV[pos];
                }
            }
        }
    } else {
        Mob questBoss;
        String txt_quest;
        switch(Quest.type) {
            case 1:
            default:
                questBoss = new FetidRat();
                txt_quest = Messages.get(this, "rat_1", Dungeon.hero.givenName());
                break;
            case 2:
                questBoss = new GnollTrickster();
                txt_quest = Messages.get(this, "gnoll_1", Dungeon.hero.givenName());
                break;
            case 3:
                questBoss = new GreatCrab();
                txt_quest = Messages.get(this, "crab_1", Dungeon.hero.givenName());
                break;
        }
        questBoss.pos = Dungeon.level.randomRespawnCell();
        if (questBoss.pos != -1) {
            GameScene.add(questBoss);
            GameScene.show(new WndQuest(this, txt_quest));
            Quest.given = true;
            Notes.add(Notes.Landmark.GHOST);
        }
    }
    return false;
}
Also used : WndQuest(com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest) Mob(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob) GreatCrab(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GreatCrab) FetidRat(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.FetidRat) GnollTrickster(com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollTrickster) WndSadGhost(com.shatteredpixel.shatteredpixeldungeon.windows.WndSadGhost)

Aggregations

FetidRat (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.FetidRat)1 GnollTrickster (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GnollTrickster)1 GreatCrab (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.GreatCrab)1 Mob (com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob)1 WndQuest (com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest)1 WndSadGhost (com.shatteredpixel.shatteredpixeldungeon.windows.WndSadGhost)1