private void updateNoticeAkashi(DockDto dock, AkashiTimer.RepairState repairState) {
   if (this.main.getAkashiNotice().getSelection()) {
     if (repairState.isFirstNotify() && AppConfig.get().isAkashiNotifyFirstStep()) {
       this.noticeAkashi.add(dock.getName() + " の泊地修理が20分経過しました");
     }
     for (AkashiTimer.ShipState state : repairState.get()) {
       if (state != null) {
         ShipDto ship = state.getShip();
         if (state.isStepNotify()) {
           int estimatedHp = state.getCurrentGain() + ship.getNowhp();
           boolean full = (estimatedHp == ship.getMaxhp());
           if (full) {
             this.noticeAkashi.add(ship.getFriendlyName() + " がまもなく修理完了します");
           }
           // 20分経過通知があるときはそれで代用する
           else if (!repairState.isFirstNotify() && AppConfig.get().isAkashiNotifyEveryStep()) {
             this.noticeAkashi.add(
                 ship.getFriendlyName()
                     + " がHP1ポイント回復("
                     + (estimatedHp - 1)
                     + "→"
                     + estimatedHp
                     + "/"
                     + ship.getMaxhp()
                     + ")");
           }
         }
       }
     }
   }
 }
Ejemplo n.º 2
0
  /**
   * 所有艦娘一覧の内容
   *
   * @param specdiff 成長余地
   * @param filter 鍵付きのみ
   * @return 内容
   */
  public static List<String[]> getShipListBody(boolean specdiff, ShipFilterDto filter) {
    Set<Entry<Long, ShipDto>> ships = ShipContext.get().entrySet();
    List<Object[]> body = new ArrayList<Object[]>();
    int count = 0;
    for (Entry<Long, ShipDto> entry : ships) {
      ShipDto ship = entry.getValue();

      if ((filter != null) && !ShipFilterLogic.shipFilter(ship, filter)) {
        continue;
      }

      count++;

      if (!specdiff) {
        // 通常
        body.add(
            new Object[] {
              count,
              ship.getId(),
              ship.getFleetid(),
              ship.getName(),
              ship.getType(),
              ship.getCond(),
              ship.getCondClearDateString(),
              ship.getLv(),
              ship.getNext(),
              ship.getExp(),
              ship.getSallyArea().getName(),
              ship.getSeiku(),
              ship.getSlot().get(0),
              ship.getSlot().get(1),
              ship.getSlot().get(2),
              ship.getSlot().get(3),
              ship.getSlot().get(5),
              ship.getMaxhp(),
              ship.getKaryoku(),
              ship.getRaisou(),
              ship.getTaiku(),
              ship.getSoukou(),
              ship.getKaihi(),
              ship.getTaisen(),
              ship.getSakuteki(),
              ship.getLucky(),
              ship.getAccuracy(),
              ship.getHougekiPower(),
              ship.getRaigekiPower(),
              ship.getTaisenPower(),
              ship.getYasenPower()
            });
      } else {
        // 成長の余地
        // 火力
        long karyoku = ship.getKaryokuMax() - ship.getKaryoku();
        // 雷装
        long raisou = ship.getRaisouMax() - ship.getRaisou();
        // 対空
        long taiku = ship.getTaikuMax() - ship.getTaiku();
        // 装甲
        long soukou = ship.getSoukouMax() - ship.getSoukou();
        // 回避
        long kaihi = ship.getKaihiMax() - ship.getKaihi();
        // 対潜
        long taisen = ship.getTaisenMax() - ship.getTaisen();
        // 索敵
        long sakuteki = ship.getSakutekiMax() - ship.getSakuteki();
        // 運
        long lucky = ship.getLuckyMax() - ship.getLucky();

        for (ItemDto item : ship.getItem()) {
          if (item != null) {
            karyoku += item.getHoug();
            raisou += item.getRaig();
            taiku += item.getTyku();
            soukou += item.getSouk();
            kaihi += item.getHouk();
            taisen += item.getTais();
            sakuteki += item.getSaku();
            lucky += item.getLuck();
          }
        }
        body.add(
            new Object[] {
              count,
              ship.getId(),
              ship.getFleetid(),
              ship.getName(),
              ship.getType(),
              ship.getCond(),
              ship.getCondClearDateString(),
              ship.getLv(),
              ship.getNext(),
              ship.getExp(),
              ship.getSallyArea().getName(),
              ship.getSeiku(),
              ship.getSlot().get(0),
              ship.getSlot().get(1),
              ship.getSlot().get(2),
              ship.getSlot().get(3),
              ship.getSlot().get(5),
              ship.getMaxhp(),
              karyoku,
              raisou,
              taiku,
              soukou,
              kaihi,
              taisen,
              sakuteki,
              lucky,
              ship.getAccuracy(),
              ship.getHougekiPower(),
              ship.getRaigekiPower(),
              ship.getTaisenPower(),
              ship.getYasenPower()
            });
      }
    }
    return toListStringArray(body);
  }