コード例 #1
0
ファイル: SpecialRegain.java プロジェクト: brianwyn/Project
  @Override
  public void loop(Action currentAction) {

    currentAction.setActionTick(currentAction.getActionTick() - 1);

    if (currentAction.getActionTick() == 0) {

      currentAction.setActionTick(REPEAT_DELAY);

      for (Player p : PlayerManager.getSingleton().getPlayers()) {

        if (p == null) continue;

        Client client = (Client) p;

        if (client.specialAmount >= 100) continue;

        int extraAmount = 0;

        switch (client.privileges) {
          case 1:
            extraAmount = 5;
            break;
          case 2:
            extraAmount = 10;
            break;
          case 3:
            extraAmount = 15;
            break;
        }
        client.specialAmount += (10 + extraAmount);

        if (client.getSpecialAmount() > 100) client.setSpecialAmount(100);

        Specials.updateSpecialBar(client);
      }
    }
  }