/** 艦隊が出撃中で大破した場合に警告を行います */ private void postFatal(List<ShipDto> badlyDamaged) { if (badlyDamaged.size() > 0) { if (AppConfig.get().isBalloonBybadlyDamage()) { StringBuilder sb = new StringBuilder(); sb.append(AppConstants.MESSAGE_STOP_SORTIE); sb.append("\n"); for (ShipDto shipDto : badlyDamaged) { sb.append(shipDto.getName()); sb.append("(" + shipDto.getLv() + ")"); sb.append(" : "); List<ItemInfoDto> items = shipDto.getItem(); List<String> names = new ArrayList<String>(); for (ItemInfoDto itemDto : items) { if (itemDto != null) { names.add(itemDto.getName()); } } sb.append(StringUtils.join(names, ",")); sb.append("\n"); } ToolTip tip = new ToolTip(this.main.getShell(), SWT.BALLOON | SWT.ICON_ERROR); tip.setText("大破警告"); tip.setMessage(sb.toString()); this.main.getTrayItem().setToolTip(tip); tip.setVisible(true); } // 大破時にサウンドを再生する Sound.randomBadlySoundPlay(); } }
/** * 装備でフィルタ * * @param ship * @param filter */ private static boolean itemFilter(ShipDto ship, ShipFilterDto filter) { List<ItemDto> item = ship.getItem(); boolean hit = false; for (ItemDto itemDto : item) { if (itemDto != null) { if (filter.itemname.equals(itemDto.getName())) { hit = true; break; } } } if (!hit) { return false; } return true; }
/** * 所有艦娘一覧の内容 * * @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); }