Search in sources :

Example 1 with Light

use of com.watabou.pixeldungeon.actors.buffs.Light in project pixel-dungeon by watabou.

the class Dungeon method switchLevel.

@SuppressWarnings("deprecation")
public static void switchLevel(final Level level, int pos) {
    nightMode = new Date().getHours() < 7;
    Dungeon.level = level;
    Actor.init();
    Actor respawner = level.respawner();
    if (respawner != null) {
        Actor.add(level.respawner());
    }
    hero.pos = pos != -1 ? pos : level.exit;
    Light light = hero.buff(Light.class);
    hero.viewDistance = light == null ? level.viewDistance : Math.max(Light.DISTANCE, level.viewDistance);
    observe();
}
Also used : Light(com.watabou.pixeldungeon.actors.buffs.Light) Actor(com.watabou.pixeldungeon.actors.Actor) Date(java.util.Date)

Aggregations

Actor (com.watabou.pixeldungeon.actors.Actor)1 Light (com.watabou.pixeldungeon.actors.buffs.Light)1 Date (java.util.Date)1