Search in sources :

Example 1 with WndMessage

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

the class Hero method actAscend.

private boolean actAscend(HeroAction.Ascend action) {
    int stairs = action.dst;
    if (pos == stairs && pos == Dungeon.level.entrance) {
        if (Dungeon.depth == 1) {
            if (belongings.getItem(Amulet.class) == null) {
                GameScene.show(new WndMessage(Messages.get(this, "leave")));
                ready();
            } else {
                Dungeon.win(Amulet.class);
                Dungeon.deleteGame(GamesInProgress.curSlot, true);
                Game.switchScene(SurfaceScene.class);
            }
        } else {
            curAction = null;
            Buff buff = buff(TimekeepersHourglass.timeFreeze.class);
            if (buff != null)
                buff.detach();
            InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
            Game.switchScene(InterlevelScene.class);
        }
        return false;
    } else if (getCloser(stairs)) {
        return true;
    } else {
        ready();
        return false;
    }
}
Also used : Amulet(com.shatteredpixel.shatteredpixeldungeon.items.Amulet) TimekeepersHourglass(com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass) WndMessage(com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage) Buff(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff) FlavourBuff(com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff)

Aggregations

Buff (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff)1 FlavourBuff (com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff)1 Amulet (com.shatteredpixel.shatteredpixeldungeon.items.Amulet)1 TimekeepersHourglass (com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass)1 WndMessage (com.shatteredpixel.shatteredpixeldungeon.windows.WndMessage)1