Exemplo n.º 1
0
  @Override
  public void execute(Hero hero, String action) {
    if (action.equals(AC_READ)) {

      if (hero.buff(Blindness.class) != null) {
        GLog.w(TXT_BLINDED);
      } else {
        curUser = hero;
        curItem = detach(hero.belongings.backpack);
        doRead();
      }

    } else {

      super.execute(hero, action);
    }
  }
Exemplo n.º 2
0
  @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();
  }