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;
}
}
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);
}
}
}
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;
}
}
Aggregations