public static void reallyDie(Object cause) { int length = Level.LENGTH; int[] map = Dungeon.level.map; boolean[] visited = Dungeon.level.visited; boolean[] discoverable = Level.discoverable; for (int i = 0; i < length; i++) { int terr = map[i]; if (discoverable[i]) { visited[i] = true; if ((Terrain.flags[terr] & Terrain.SECRET) != 0) { Level.set(i, Terrain.discover(terr)); GameScene.updateMap(i); } } } Bones.leave(); Dungeon.observe(); Dungeon.hero.belongings.identify(); GameScene.gameOver(); if (cause instanceof Hero.Doom) { ((Hero.Doom) cause).onDeath(); } Dungeon.deleteGame(Dungeon.hero.heroClass, true); }
@Override public void onMotionComplete() { Dungeon.observe(); search(false); super.onMotionComplete(); }
@Override public boolean attachTo(Char target) { if (super.attachTo(target)) { Sample.INSTANCE.play(Assets.SND_MELD); Dungeon.observe(); return true; } else { return false; } }
@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(); }
@Override public void detach() { super.detach(); Dungeon.observe(); }