Search in sources :

Example 1 with WndMessage

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

the class Hero method actAscend.

private boolean actAscend(HeroAction.Ascend action) {
    refreshPets();
    int stairs = action.dst;
    if (getPos() == stairs && getPos() == Dungeon.level.entrance) {
        Position nextLevel = DungeonGenerator.ascend(Dungeon.currentPosition());
        if (nextLevel.levelId.equals("0")) {
            if (belongings.getItem(Amulet.class) == null) {
                GameScene.show(new WndMessage(TXT_LEAVE));
                ready();
            } else {
                Dungeon.win(ResultDescriptions.WIN, Rankings.gameOver.WIN_HAPPY);
                Dungeon.gameOver();
                Game.switchScene(SurfaceScene.class);
            }
        } else {
            clearActions();
            Hunger hunger = buff(Hunger.class);
            if (hunger != null && !hunger.isStarving() && !Dungeon.level.isSafe()) {
                hunger.satisfy(-Hunger.STARVING / 10);
            }
            InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
            Game.switchScene(InterlevelScene.class);
        }
        return false;
    } else if (getCloser(stairs)) {
        return true;
    } else {
        ready();
        return false;
    }
}
Also used : Hunger(com.watabou.pixeldungeon.actors.buffs.Hunger) Amulet(com.watabou.pixeldungeon.items.Amulet) Position(com.nyrds.pixeldungeon.utils.Position) WndMessage(com.watabou.pixeldungeon.windows.WndMessage)

Example 2 with WndMessage

use of com.watabou.pixeldungeon.windows.WndMessage in project pixel-dungeon by watabou.

the class Sign method read.

public static void read(int pos) {
    if (Dungeon.level instanceof DeadEndLevel) {
        GameScene.show(new WndMessage(TXT_DEAD_END));
    } else {
        int index = Dungeon.depth - 1;
        if (index < TIPS.length) {
            GameScene.show(new WndMessage(TIPS[index]));
        } else {
            Dungeon.level.destroy(pos);
            GameScene.updateMap(pos);
            GameScene.discoverTile(pos, Terrain.SIGN);
            CellEmitter.get(pos).burst(ElmoParticle.FACTORY, 6);
            Sample.INSTANCE.play(Assets.SND_BURNING);
            GLog.w(TXT_BURN);
        }
    }
}
Also used : DeadEndLevel(com.watabou.pixeldungeon.levels.DeadEndLevel) WndMessage(com.watabou.pixeldungeon.windows.WndMessage)

Example 3 with WndMessage

use of com.watabou.pixeldungeon.windows.WndMessage in project pixel-dungeon by watabou.

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(TXT_LEAVE));
                ready();
            } else {
                Dungeon.win(ResultDescriptions.WIN);
                Dungeon.deleteGame(Dungeon.hero.heroClass, true);
                Game.switchScene(SurfaceScene.class);
            }
        } else {
            curAction = null;
            Hunger hunger = buff(Hunger.class);
            if (hunger != null && !hunger.isStarving()) {
                hunger.satisfy(-Hunger.STARVING / 10);
            }
            InterlevelScene.mode = InterlevelScene.Mode.ASCEND;
            Game.switchScene(InterlevelScene.class);
        }
        return false;
    } else if (getCloser(stairs)) {
        return true;
    } else {
        ready();
        return false;
    }
}
Also used : Hunger(com.watabou.pixeldungeon.actors.buffs.Hunger) Amulet(com.watabou.pixeldungeon.items.Amulet) WndMessage(com.watabou.pixeldungeon.windows.WndMessage)

Aggregations

WndMessage (com.watabou.pixeldungeon.windows.WndMessage)3 Hunger (com.watabou.pixeldungeon.actors.buffs.Hunger)2 Amulet (com.watabou.pixeldungeon.items.Amulet)2 Position (com.nyrds.pixeldungeon.utils.Position)1 DeadEndLevel (com.watabou.pixeldungeon.levels.DeadEndLevel)1