From e9a0eb8ee252aaae118f373f1283639675620d01 Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 12 Dec 2017 22:14:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E8=A6=81=E7=B4=A0=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 一括解体への対応 * 任務:新しいデイリー工廠任務に対応 * 北方装備の特殊補正について、多摩改二に対応・複数装備時に補正が重複しないように * 戦闘:航空戦のリファクタリング --- ElectronicObserver/Data/FleetData.cs | 4 +- .../Data/Quest/ProgressDestruction.cs | 6 + .../Data/Quest/QuestProgressManager.cs | 14 +- ElectronicObserver/Data/ShipData.cs | 24 +- .../kcsapi/api_req_kousyou/destroyship.cs | 26 +- .../Other/Information/apilist.txt | 14 +- .../Other/Information/kcmemo.md | 52 +- ElectronicObserver/Window/FormBattle.cs | 673 ++++-------------- 8 files changed, 248 insertions(+), 565 deletions(-) diff --git a/ElectronicObserver/Data/FleetData.cs b/ElectronicObserver/Data/FleetData.cs index e2985854f..edf374da9 100644 --- a/ElectronicObserver/Data/FleetData.cs +++ b/ElectronicObserver/Data/FleetData.cs @@ -269,11 +269,11 @@ public override void LoadFromRequest(string apiname, Dictionary case "api_req_kousyou/destroyship": { - int shipID = int.Parse(data["api_ship_id"]); + var shipIDs = data["api_ship_id"].Split(",".ToCharArray()).Select(s => int.Parse(s)); for (int i = 0; i < _members.Length; i++) { - if (_members[i] == shipID) + if (shipIDs.Contains(_members[i])) { RemoveShip(i); break; diff --git a/ElectronicObserver/Data/Quest/ProgressDestruction.cs b/ElectronicObserver/Data/Quest/ProgressDestruction.cs index d1cf2f3c5..6a7d3ffa7 100644 --- a/ElectronicObserver/Data/Quest/ProgressDestruction.cs +++ b/ElectronicObserver/Data/Quest/ProgressDestruction.cs @@ -20,6 +20,12 @@ public ProgressDestruction(QuestData quest, int maxCount) { } + public void Increment(int amount) + { + for (int i = 0; i < amount; i++) + Increment(); + } + public override string GetClearCondition() { return "解体" + ProgressMax; diff --git a/ElectronicObserver/Data/Quest/QuestProgressManager.cs b/ElectronicObserver/Data/Quest/QuestProgressManager.cs index b3ea552b0..18c9881f3 100644 --- a/ElectronicObserver/Data/Quest/QuestProgressManager.cs +++ b/ElectronicObserver/Data/Quest/QuestProgressManager.cs @@ -105,7 +105,7 @@ public override void Initialize() ao.APIList["api_req_kousyou/createship"].RequestReceived += ShipConstructed; - ao.APIList["api_req_kousyou/destroyship"].ResponseReceived += ShipDestructed; + ao.APIList["api_req_kousyou/destroyship"].RequestReceived += ShipDestructed; // 装備廃棄はイベント前に装備データが削除されてしまうので destroyitem2 から直接呼ばれる @@ -359,6 +359,14 @@ void QuestUpdated(string apiname, dynamic data) case 638: //|638|対空機銃量産|機銃廃棄6個|回ではない Progresses.Add(new ProgressDiscard(q, 6, true, new int[] { 21 })); break; + case 673: //|673|装備開発力の整備|小口径主砲廃棄4個|進捗は1/5から始まる(3個廃棄時点で80%達成になる) + Progresses.Add(new ProgressDiscard(q, 4, true, new int[] { 1 })); + Progresses[q.QuestID].SharedCounterShift = 1; + break; + case 674: //|674|工廠環境の整備|機銃廃棄3個,鋼材300保有|進捗は2/5から始まる(2個廃棄時点で80%達成になる) + Progresses.Add(new ProgressDiscard(q, 3, true, new int[] { 21 })); + Progresses[q.QuestID].SharedCounterShift = 2; + break; case 702: //|702|艦の「近代化改修」を実施せよ!|改修成功2 Progresses.Add(new ProgressModernization(q, 2)); @@ -544,9 +552,11 @@ public void EquipmentDiscarded(string apiname, Dictionary data) void ShipDestructed(string apiname, dynamic data) { + int amount = (data["api_ship_id"] as string).Split(",".ToCharArray()).Count(); + foreach (var p in Progresses.Values.OfType()) { - p.Increment(); + p.Increment(amount); } OnProgressChanged(); diff --git a/ElectronicObserver/Data/ShipData.cs b/ElectronicObserver/Data/ShipData.cs index b05b0d63b..9127e3bdb 100644 --- a/ElectronicObserver/Data/ShipData.cs +++ b/ElectronicObserver/Data/ShipData.cs @@ -348,21 +348,23 @@ public int EvasionBase get { int param = EvasionTotal; - foreach (var eq in AllSlotInstance.Where(eq => eq != null)) + var eqs = AllSlotInstance.Where(eq => eq != null); + foreach (var eq in eqs) { param -= eq.MasterEquipment.Evasion; + } - // 北方迷彩(+北方装備) - if (eq.EquipmentID == 268) + // 北方迷彩(+北方装備) による特殊補正(重複しない) + if (eqs.Any(eq => eq.EquipmentID == 268)) + { + switch (ShipID) { - switch (ShipID) - { - case 146: // 木曽改二 - case 216: // 多摩改 - case 217: // 木曽改 - param -= 7; - break; - } + case 146: // 木曾改二 + case 216: // 多摩改 + case 217: // 木曾改 + case 547: // 多摩改二 + param -= 7; + break; } } return param; diff --git a/ElectronicObserver/Observer/kcsapi/api_req_kousyou/destroyship.cs b/ElectronicObserver/Observer/kcsapi/api_req_kousyou/destroyship.cs index 4a3860ff6..3ab76f42f 100644 --- a/ElectronicObserver/Observer/kcsapi/api_req_kousyou/destroyship.cs +++ b/ElectronicObserver/Observer/kcsapi/api_req_kousyou/destroyship.cs @@ -20,21 +20,32 @@ public override void OnRequestReceived(Dictionary data) //todo: ここに処理を書くのはみょんな感があるので、可能なら移動する - int shipID = int.Parse(data["api_ship_id"]); + var shipIDs = data["api_ship_id"].Split(",".ToCharArray()).Select(s => int.Parse(s)); + bool discardEquipment = int.Parse(data["api_slot_dest_flag"]) != 0; + + var ships = shipIDs.Select(id => db.Ships[id]); + db.Fleet.LoadFromRequest(APIName, data); - ShipData ship = db.Ships[shipID]; - Utility.Logger.Add(2, ship.NameWithLevel + " を解体しました。"); + foreach (var ship in ships) + Utility.Logger.Add(2, ship.NameWithLevel + " を解体しました。"); - for (int i = 0; i < ship.Slot.Count; i++) + + if (discardEquipment) { - if (ship.Slot[i] != -1) - db.Equipments.Remove(ship.Slot[i]); + foreach (var ship in ships) + { + foreach (var eqid in ship.AllSlot.Where(id => id != -1)) + { + db.Equipments.Remove(eqid); + } + } } - db.Ships.Remove(shipID); + foreach (int id in shipIDs) + db.Ships.Remove(id); base.OnRequestReceived(data); @@ -42,7 +53,6 @@ public override void OnRequestReceived(Dictionary data) public override void OnResponseReceived(dynamic data) { - KCDatabase.Instance.Material.LoadFromResponse(APIName, data.api_material); base.OnResponseReceived((object)data); diff --git a/ElectronicObserver/Other/Information/apilist.txt b/ElectronicObserver/Other/Information/apilist.txt index befedfb7e..c990a851a 100644 --- a/ElectronicObserver/Other/Information/apilist.txt +++ b/ElectronicObserver/Other/Information/apilist.txt @@ -628,6 +628,7 @@ api_port/port :母港情報 api_m_flag :2 api_m_flag2 :ギミック解除時に1 api_parallel_quest_count :最大受領可能任務数 + api_dest_ship_slot :解体時の装備廃棄フラグ 0=保管, 1=廃棄 api_plane_info :基地航空隊関連データ 要素があるときのみ存在(メンバも然り) api_unset_slot :更新された unsetslot? [] 基地航空隊が更新されたときに増える? api_type3No :装備カテゴリID @@ -722,11 +723,12 @@ api_req_kousyou/createitem :装備開発(失敗) Request.api_req_kousyou/destroyship :艦船解体 - api_ship_id :解体艦船のID + api_ship_id :解体艦船のID コンマ区切り + api_slot_dest_flag :装備廃棄フラグ 0=保管, 1=廃棄 api_req_kousyou/destroyship :艦船解体 api_material :各種資源の現在値 - + api_unset_list :未装備の装備IDリスト unsetslot を参照 装備保管時のみ存在 Request.api_req_kousyou/destroyitem2 :装備廃棄 api_slotitem_ids :廃棄した装備のID @@ -918,9 +920,13 @@ Request.api_get_member/picture_book :図鑑 api_get_member/picture_book :艦船図鑑 図鑑登録済みのもののみ送られてくるので注意 api_list :リスト 登録艦が0隻の場合は存在しない(api_data=nullになる) api_index_no :図鑑No. - api_state :取得フラグ? - 二重配列になっており、未改造・改造後が同じ項目で登録されている艦娘は以下データが2つ(以上)存在する + api_state :取得フラグ [][5] + 未改造・改造後が同じ項目で登録されている艦娘は以下データが2つ(以上)存在する [0]=図鑑登録, [1]=中破絵, [2]=ケッコン, [3]=?, [4]=? + api_q_voice_info :特殊ボイス再生ボタン情報 [] 対応艦のみ存在 + api_no : + api_voice_id : + api_icon_id : api_table_id :艦船ID api_name :艦船名 api_yomi :艦船名読み diff --git a/ElectronicObserver/Other/Information/kcmemo.md b/ElectronicObserver/Other/Information/kcmemo.md index d50497287..e977bb7ae 100644 --- a/ElectronicObserver/Other/Information/kcmemo.md +++ b/ElectronicObserver/Other/Information/kcmemo.md @@ -67,9 +67,27 @@ value = min + ceil( ( max - min ) * ( 0.4 or 0.8 ) * Lv / 99 ) 以下に 2017/10/18 時点における ID と対応する艦娘及び衣装を示す。 なお、ID: 787~799, 811~900 以外の名称については(参照できないため)公式のものではない。 + |ID|艦名| |--:|:--| -|773|秋狭霧| +|756|???| +|757|スリガオ海峡突入満潮改二| +|758|スリガオ海峡突入時雨改二| +|759|スリガオ海峡突入最上| +|760|スリガオ海峡突入山雲| +|761|スリガオ海峡突入朝雲| +|762|晩秋狭霧| +|763|ハロウィン瑞穂| +|764|???| +|765|秋川内| +|766|秋秋雲| +|767|秋藤波| +|768|秋天霧| +|769|秋鹿島| +|770|秋白露| +|771|秋Richelieu| +|772|秋狭霧| +|773|秋刀魚狭霧| |774|浴衣綾波| |775|浴衣敷波| |776|浴衣藤波| @@ -294,6 +312,8 @@ value = min + ceil( ( max - min ) * ( 0.4 or 0.8 ) * Lv / 99 ) |995|牛丼時雨改二| |996|牛丼龍驤改二| |997|牛丼瑞穂| +|998|観艦式磯波| +|999|観艦式浦波| なお、ID: 882 「夏三隈」について、2016/08/31 現在 API 上において「夏三隅」と誤記されている。 更に、ID: 793 「夏2017三隈」について、2017/09/12 現在 API 上において「夏2017三隅」と誤記されている。 @@ -1066,7 +1086,7 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの |:--|:--|:--|:--| |131, 143|大和, 武蔵|大口径主砲(II)|| |136, 148, 275, 276|大和改, 武蔵改, 長門改, 陸奥改|大口径主砲(II), 水上戦闘機|| -|146, 216, 217|木曽改二, 多摩改, 木曽改|追加装甲(中型)|| +|146, 216, 217|木曾改二, 多摩改, 木曾改|追加装甲(中型)|| |147|Верный|上陸用舟艇, 追加装甲(中型), 特型内火艇|| |178|Bismarck drei|魚雷|| |199, 418, 468, 487, 489, 490, 548|大潮改二, 皐月改二, 朝潮改二丁, 鬼怒改二, 満潮改二, 荒潮改二, 文月改二|上陸用舟艇, 特型内火艇|| @@ -1074,7 +1094,7 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの |343, 356|香取改, 鹿島改|探照灯|| |352|速吸改|艦上攻撃機, 大型電探, ソナー, 上陸用舟艇, 特型内火艇|| |358, 361, 446, 447|Zara改, Pola改, Italia, Roma改|水上爆撃機, 水上戦闘機|| -|372|Commandant Teste改|ソナー, オートジャイロ, 航空要員, 大型探照灯, 輸送機材|爆雷, 特殊潜航艇| +|372|Commandant Teste改|中口径主砲, ソナー, オートジャイロ, 航空要員, 大型探照灯|爆雷, 特殊潜航艇| |380|大鷹改|ソナー, 爆雷|艦上偵察機, オートジャイロ, 大型ソナー| |434, 435, 469|睦月改二, 如月改二, 江風改二|上陸用舟艇|| |445|秋津洲|大型飛行艇, 輸送機材|特殊潜航艇, 上陸用舟艇, 対地装備, 特型内火艇| @@ -1083,15 +1103,16 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの |466, 467|翔鶴改二甲, 瑞鶴改二甲|輸送機材, 噴式戦闘機, 噴式戦闘爆撃機, 噴式攻撃機, 噴式偵察機|| |470|霞改二乙|大型電探, 上陸用舟艇, 特型内火艇|| |488|由良改二|水上爆撃機, 特殊潜航艇, 上陸用舟艇, 航空要員, 水上戦闘機, 特型内火艇|| -|491|Commandant Teste|ソナー, オートジャイロ, 航空要員, 大型探照灯, 輸送機材|爆雷, 特殊潜航艇, 上陸用舟艇, 特型内火艇| +|491|Commandant Teste|中口径主砲, ソナー, オートジャイロ, 航空要員, 大型探照灯|爆雷, 特殊潜航艇, 上陸用舟艇, 特型内火艇| |496|Zara due|水上爆撃機, 航空要員, 大型探照灯, 水上戦闘機|| -|500|神威改母|副砲, ソナー, 爆雷, 上陸用舟艇, 追加装甲(中型), 探照灯, 照明弾, 司令部施設, 対地装備, 水上艦要員, 大型ソナー, 大型飛行艇, 特型内火艇, 輸送機材|| +|500|神威改母|中口径主砲, 副砲, ソナー, 爆雷, 上陸用舟艇, 追加装甲(中型), 探照灯, 照明弾, 司令部施設, 対地装備, 水上艦要員, 大型ソナー, 大型飛行艇, 特型内火艇, 輸送機材|| |521|春日丸||艦上攻撃機, 艦上偵察機, 大型電探, オートジャイロ, 対潜哨戒機, 司令部施設, 大型ソナー| |526|大鷹||艦上偵察機, オートジャイロ, 対潜哨戒機, 大型ソナー| |529|大鷹改二|ソナー, 爆雷|| |530|伊504|対空機銃, 簡易輸送部材, 輸送機材|| -|541|長門改二|小口径主砲, 上陸用舟艇, 大口径主砲(II), 水上戦闘機, 特型内火艇|| |539|UIT-25|対空機銃, 簡易輸送部材, 輸送機材|特殊潜航艇| +|541|長門改二|小口径主砲, 上陸用舟艇, 大口径主砲(II), 水上戦闘機, 特型内火艇|| +|547|多摩改二|水上爆撃機, 上陸用舟艇, オートジャイロ, 追加装甲(中型), 航空要員, 水上戦闘機, 特型内火艇|| |605|Luigi Torelli改|簡易輸送部材, 輸送機材|特殊潜航艇| (艦船IDが特殊装備リストに含まれていた場合は*マスターデータの内容にかかわらず*装備可能・不可能にする、というコードになっている) @@ -1199,6 +1220,8 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの |854|季|戦果拡張任務!「Z作戦」前段作戦|2-4・6-1・6-3ボスA勝利各1/6-4ボスS勝利1 |861|季|強行輸送艦隊、抜錨!|1-6終点到達2|要(航空戦艦or補給艦)2 |862|季|前線の航空偵察を実施せよ!|6-3ボスA勝利2|要水母1軽巡2 +|873|季|北方海域警備を実施せよ!|3-1・3-2・3-3ボスA勝利各1|要軽巡1 +|???|?|北方海域戦闘哨戒を実施せよ!|3-5ボスS勝利2|要軽母1水母1軽巡1 |303|日|「演習」で練度向上!|演習3 |304|日|「演習」で他提督を圧倒せよ!|演習勝利5 |302|週|大規模演習|演習勝利20 @@ -1219,14 +1242,17 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの |608|日|艦娘「建造」艦隊強化!|建造3|606:『新造艦「建造」指令』の進捗を引き継ぐ(1/4から始まる) |609|日|軍縮条約対応!|解体2 |619|日|装備の改修強化|装備改修1(失敗可) +|673|日|装備開発力の整備|小口径主砲廃棄4個|進捗は1/5から始まる(3個廃棄時点で80%達成になる) +|674|日|工廠環境の整備|機銃廃棄3個,鋼材300保有|進捗は2/5から始まる(1個廃棄時点で50%,2個〃で80%達成になる) |613|週|資源の再利用|廃棄24回 -|638|週|対空機銃量産|機銃廃棄6個|回ではない -|626|月|精鋭「艦戦」隊の新編成|熟練搭乗員+零式艦戦21型》装備の鳳翔旗艦+零式艦戦21型x2・九六式艦戦x1廃棄 -|628|月|機種転換|零式艦戦21型(熟練)>>装備の空母旗艦+零式艦戦52型x2廃棄 -|645|月|「洋上補給」物資の調達|三式弾廃棄+(燃料750+弾薬750+ドラム缶(輸送用)x2+九一式徹甲弾)保有 -|637|季|「熟練搭乗員」養成|九六式艦戦>>★10装備の鳳翔旗艦+勲章2 -|643|季|主力「陸攻」の調達|零式艦戦21型x2廃棄+(九六式陸攻x1+九七式艦攻x2)保有 -|663|季|新型艤装の継続研究|大口径主砲x10廃棄+鋼材18000保有 +|638|週|対空機銃量産|機銃廃棄6個 +|626|月|精鋭「艦戦」隊の新編成|熟練搭乗員,零式艦戦21型>>装備の鳳翔旗艦,(零式艦戦21型x2,九六式艦戦x1)廃棄 +|628|月|機種転換|零式艦戦21型(熟練)>>装備の空母旗艦,零式艦戦52型x2廃棄 +|645|月|「洋上補給」物資の調達|三式弾廃棄,(燃料750,弾薬750,ドラム缶(輸送用)x2,九一式徹甲弾)保有 +|637|季|「熟練搭乗員」養成|九六式艦戦>>★10装備の鳳翔旗艦,勲章2 +|643|季|主力「陸攻」の調達|零式艦戦21型x2廃棄,(九六式陸攻x1,九七式艦攻x2)保有 +|663|季|新型艤装の継続研究|大口径主砲x10廃棄,鋼材18000保有 +|675|季|運用装備の統合整備|(艦上戦闘機x6,機銃x4)廃棄,ボーキ800保有 |702|日|艦の「近代化改修」を実施せよ!|近代化改修成功2 |703|週|「近代化改修」を進め、戦備を整えよ!|近代化改修成功15 diff --git a/ElectronicObserver/Window/FormBattle.cs b/ElectronicObserver/Window/FormBattle.cs index 970412ef9..3d1e6c84c 100644 --- a/ElectronicObserver/Window/FormBattle.cs +++ b/ElectronicObserver/Window/FormBattle.cs @@ -374,19 +374,14 @@ private void Updated(string apiname, dynamic data) /// private void SetFormation(BattleManager bm) { - FormationFriend.Text = Constants.GetFormationShort(bm.FirstBattle.Searching.FormationFriend); FormationEnemy.Text = Constants.GetFormationShort(bm.FirstBattle.Searching.FormationEnemy); Formation.Text = Constants.GetEngagementForm(bm.FirstBattle.Searching.EngagementForm); if (bm.Compass != null && bm.Compass.EventID == 5) - { FleetEnemy.ForeColor = Color.Red; - } else - { FleetEnemy.ForeColor = SystemColors.ControlText; - } } /// @@ -394,19 +389,16 @@ private void SetFormation(BattleManager bm) /// private void SetSearchingResult(BattleData bd) { + void SetResult(ImageLabel label, int search) + { + label.Text = Constants.GetSearchingResultShort(search); + label.ImageAlign = search > 0 ? ContentAlignment.MiddleLeft : ContentAlignment.MiddleCenter; + label.ImageIndex = search > 0 ? (int)(search < 4 ? ResourceManager.EquipmentContent.Seaplane : ResourceManager.EquipmentContent.Radar) : -1; + ToolTipInfo.SetToolTip(label, null); + } - int searchFriend = bd.Searching.SearchingFriend; - SearchingFriend.Text = Constants.GetSearchingResultShort(searchFriend); - SearchingFriend.ImageAlign = searchFriend > 0 ? ContentAlignment.MiddleLeft : ContentAlignment.MiddleCenter; - SearchingFriend.ImageIndex = searchFriend > 0 ? (int)(searchFriend < 4 ? ResourceManager.EquipmentContent.Seaplane : ResourceManager.EquipmentContent.Radar) : -1; - ToolTipInfo.SetToolTip(SearchingFriend, null); - - int searchEnemy = bd.Searching.SearchingEnemy; - SearchingEnemy.Text = Constants.GetSearchingResultShort(searchEnemy); - SearchingEnemy.ImageAlign = searchEnemy > 0 ? ContentAlignment.MiddleLeft : ContentAlignment.MiddleCenter; - SearchingEnemy.ImageIndex = searchEnemy > 0 ? (int)(searchEnemy < 4 ? ResourceManager.EquipmentContent.Seaplane : ResourceManager.EquipmentContent.Radar) : -1; - ToolTipInfo.SetToolTip(SearchingEnemy, null); - + SetResult(SearchingFriend, bd.Searching.SearchingFriend); + SetResult(SearchingEnemy, bd.Searching.SearchingEnemy); } /// @@ -415,17 +407,16 @@ private void SetSearchingResult(BattleData bd) /// private void ClearSearchingResult() { + void ClearResult(ImageLabel label) + { + label.Text = "-"; + label.ImageAlign = ContentAlignment.MiddleCenter; + label.ImageIndex = -1; + ToolTipInfo.SetToolTip(label, null); + } - SearchingFriend.Text = "-"; - SearchingFriend.ImageAlign = ContentAlignment.MiddleCenter; - SearchingFriend.ImageIndex = -1; - ToolTipInfo.SetToolTip(SearchingFriend, null); - - SearchingEnemy.Text = "-"; - SearchingEnemy.ImageAlign = ContentAlignment.MiddleCenter; - SearchingEnemy.ImageIndex = -1; - ToolTipInfo.SetToolTip(SearchingEnemy, null); - + ClearResult(SearchingFriend); + ClearResult(SearchingEnemy); } /// @@ -433,7 +424,6 @@ private void ClearSearchingResult() /// private void SetBaseAirAttack(PhaseBaseAirAttack pd) { - if (pd != null && pd.IsAvailable) { @@ -492,570 +482,202 @@ private void ClearBaseAirAttack() /// - /// 航空戦情報を設定します。 + /// 航空戦表示用ヘルパー /// - /// 噴式航空戦を指定します。存在しない場合は null を指定してください。 - /// 通常の航空戦を指定します。 - private void SetAerialWarfare(PhaseJetAirBattle phaseJet, PhaseAirBattleBase phase1) + private class AerialWarfareFormatter { - SetAerialWarfare(phaseJet, phase1, null); - } + public readonly PhaseAirBattleBase Air; + public string PhaseName; - /// - /// 航空戦情報を設定します。 - /// - /// 噴式航空戦を指定します。存在しない場合は null を指定してください。 - /// 第1次航空戦を指定します。 - /// 第2次航空戦を指定します。存在しない場合は null を指定してください。 - private void SetAerialWarfare(PhaseJetAirBattle phaseJet, PhaseAirBattleBase phase1, PhaseAirBattleBase phase2) - { - - bool phaseJetEnabled = phaseJet != null && phaseJet.IsAvailable; - bool phase1Enabled = phase1 != null && phase1.IsAvailable; - bool phase2Enabled = phase2 != null && phase2.IsAvailable; - - - // 空対空戦闘 - if (phase1Enabled && phase1.IsStage1Available) + public AerialWarfareFormatter(PhaseAirBattleBase air, string phaseName) { + Air = air; + PhaseName = phaseName; + } - bool phaseJetStage1Enabled = phaseJetEnabled && phaseJet.IsStage1Available; - bool phase2Stage1Enabled = phase2Enabled && phase2.IsStage1Available; - bool needAppendInfo = phaseJetStage1Enabled || phase2Stage1Enabled; - - - AirSuperiority.Text = Constants.GetAirSuperiority(phase1.AirSuperiority); - - if (needAppendInfo) - { - - var sb = new StringBuilder(); - - if (phaseJetStage1Enabled) - sb.Append("噴式戦: ").AppendLine(Constants.GetAirSuperiority(phaseJet.AirSuperiority)); - - sb.Append("第1次: ").AppendLine(Constants.GetAirSuperiority(phase1.AirSuperiority)); - - if (phase2Stage1Enabled) - sb.Append("第2次: ").AppendLine(Constants.GetAirSuperiority(phase2.AirSuperiority)); - - ToolTipInfo.SetToolTip(AirSuperiority, sb.ToString()); - - } - else - { - ToolTipInfo.SetToolTip(AirSuperiority, null); - } - - - // friends - int jetLostFriend = phaseJetStage1Enabled ? phaseJet.AircraftLostStage1Friend : 0; - int phase1LostFriend = phase1.AircraftLostStage1Friend; - int phase2LostFriend = phase2Stage1Enabled ? phase2.AircraftLostStage1Friend : 0; - - int jetTotalFriend = phaseJetStage1Enabled ? phaseJet.AircraftTotalStage1Friend : 0; - int phase1TotalFriend = phase1.AircraftTotalStage1Friend; - int phase2TotalFriend = phase2Stage1Enabled ? phase2.AircraftTotalStage1Friend : 0; - - int jetTouchFriend = phaseJetStage1Enabled ? phaseJet.TouchAircraftFriend : -1; - int phase1TouchFriend = phase1.TouchAircraftFriend; - int phase2TouchFriend = phase2Stage1Enabled ? phase2.TouchAircraftFriend : -1; - - if (needAppendInfo) - { - var text = new List(); - - if (phaseJetStage1Enabled) - text.Add("-" + jetLostFriend); - - text.Add("-" + phase1LostFriend); - - if (phase2Stage1Enabled) - text.Add("-" + phase2LostFriend); - - AirStage1Friend.Text = string.Join(",", text); + public bool Enabled => Air != null && Air.IsAvailable; + public bool Stage1Enabled => Enabled && Air.IsStage1Available; + public bool Stage2Enabled => Enabled && Air.IsStage2Available; - } + public bool GetEnabled(int stage) + { + if (stage == 1) + return Stage1Enabled; + else if (stage == 2) + return Stage2Enabled; else - { - AirStage1Friend.Text = string.Format("-{0}/{1}", phase1LostFriend, phase1TotalFriend); - } - - if (needAppendInfo) - { - - var sb = new StringBuilder(); - - if (phaseJetStage1Enabled) - sb.AppendFormat("噴式戦: -{0}/{1}\r\n", jetLostFriend, jetTotalFriend); - - sb.AppendFormat("第1次: -{0}/{1}\r\n", phase1LostFriend, phase1TotalFriend); - - if (phase2Stage1Enabled) - sb.AppendFormat("第2次: -{0}/{1}\r\n", phase2LostFriend, phase2TotalFriend); + throw new ArgumentOutOfRangeException(); + } - ToolTipInfo.SetToolTip(AirStage1Friend, sb.ToString()); - } + public int GetAircraftLost(int stage, bool isFriend) + { + if (stage == 1) + return isFriend ? Air.AircraftLostStage1Friend : Air.AircraftLostStage1Enemy; + else if (stage == 2) + return isFriend ? Air.AircraftLostStage2Friend : Air.AircraftLostStage2Enemy; else - { - ToolTipInfo.SetToolTip(AirStage1Friend, null); - } + throw new ArgumentOutOfRangeException(); + } - // lost flag - if ((jetTotalFriend > 0 && jetLostFriend == jetTotalFriend) || - (phase1TotalFriend > 0 && phase1LostFriend == phase1TotalFriend) || - (phase2TotalFriend > 0 && phase2LostFriend == phase2TotalFriend)) - { - AirStage1Friend.ForeColor = Color.Red; - } + public int GetAircraftTotal(int stage, bool isFriend) + { + if (stage == 1) + return isFriend ? Air.AircraftTotalStage1Friend : Air.AircraftTotalStage1Enemy; + else if (stage == 2) + return isFriend ? Air.AircraftTotalStage2Friend : Air.AircraftTotalStage2Enemy; else - { - AirStage1Friend.ForeColor = SystemColors.ControlText; - } - - // touch - if (jetTouchFriend > 0 || phase1TouchFriend > 0 || phase2TouchFriend > 0) - { - AirStage1Friend.ImageAlign = ContentAlignment.MiddleLeft; - AirStage1Friend.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane; - - var jetTouchPlane = KCDatabase.Instance.MasterEquipments[jetTouchFriend]; - var phase1TouchPlane = KCDatabase.Instance.MasterEquipments[phase1TouchFriend]; - var phase2TouchPlane = KCDatabase.Instance.MasterEquipments[phase2TouchFriend]; + throw new ArgumentOutOfRangeException(); + } - var sb = new StringBuilder(ToolTipInfo.GetToolTip(AirStage1Friend)); - sb.AppendLine("触接中"); + public int GetTouchAircraft(bool isFriend) => isFriend ? Air.TouchAircraftFriend : Air.TouchAircraftEnemy; - if (phaseJetStage1Enabled) - sb.AppendFormat("噴式戦: {0}\r\n", jetTouchPlane?.Name ?? "(なし)"); - if (needAppendInfo) - sb.Append("第1次: "); - sb.AppendFormat("{0}\r\n", phase1TouchPlane?.Name ?? "(なし)"); - if (phase2Stage1Enabled) - sb.AppendFormat("第2次: {0}\r\n", phase2TouchPlane?.Name ?? "(なし)"); + } - ToolTipInfo.SetToolTip(AirStage1Friend, sb.ToString()); + void ClearAircraftLabel(ImageLabel label) + { + label.Text = "-"; + label.ForeColor = SystemColors.ControlText; + label.ImageAlign = ContentAlignment.MiddleCenter; + label.ImageIndex = -1; + ToolTipInfo.SetToolTip(label, null); + } - } - else - { - AirStage1Friend.ImageAlign = ContentAlignment.MiddleCenter; - AirStage1Friend.ImageIndex = -1; - } + + private void SetAerialWarfare(PhaseAirBattleBase phaseJet, PhaseAirBattleBase phase1) => SetAerialWarfare(phaseJet, phase1, null); + /// + /// 航空戦情報を設定します。 + /// + /// 噴式航空戦のデータ。発生していなければ null + /// 第一次航空戦(通常航空戦)のデータ。 + /// 第二次航空戦のデータ。発生していなければ null + private void SetAerialWarfare(PhaseAirBattleBase phaseJet, PhaseAirBattleBase phase1, PhaseAirBattleBase phase2) + { + var phases = new[] { + new AerialWarfareFormatter( phaseJet, "噴式戦: " ), + new AerialWarfareFormatter( phase1, "第1次: "), + new AerialWarfareFormatter( phase2, "第2次: "), + }; - // enemies - int jetLostEnemy = phaseJetStage1Enabled ? phaseJet.AircraftLostStage1Enemy : 0; - int phase1LostEnemy = phase1.AircraftLostStage1Enemy; - int phase2LostEnemy = phase2Stage1Enabled ? phase2.AircraftLostStage1Enemy : 0; + if (!phases[0].Enabled && !phases[2].Enabled) + phases[1].PhaseName = ""; - int jetTotalEnemy = phaseJetStage1Enabled ? phaseJet.AircraftTotalStage1Enemy : 0; - int phase1TotalEnemy = phase1.AircraftTotalStage1Enemy; - int phase2TotalEnemy = phase2Stage1Enabled ? phase2.AircraftTotalStage1Enemy : 0; - int jetTouchEnemy = phaseJetStage1Enabled ? phaseJet.TouchAircraftEnemy : -1; - int phase1TouchEnemy = phase1.TouchAircraftEnemy; - int phase2TouchEnemy = phase2Stage1Enabled ? phase2.TouchAircraftEnemy : -1; + void SetShootdown(ImageLabel label, int stage, bool isFriend, bool needAppendInfo) + { + var phasesEnabled = phases.Where(p => p.GetEnabled(stage)); if (needAppendInfo) { - var text = new List(); - - if (phaseJetStage1Enabled) - text.Add("-" + jetLostEnemy); - - text.Add("-" + phase1LostEnemy); - - if (phase2Stage1Enabled) - text.Add("-" + phase2LostEnemy); - - AirStage1Enemy.Text = string.Join(",", text); - + label.Text = string.Join(",", phasesEnabled.Select(p => "-" + p.GetAircraftLost(stage, isFriend))); + ToolTipInfo.SetToolTip(label, string.Join("", phasesEnabled.Select(p => $"{p.PhaseName}-{p.GetAircraftLost(stage, isFriend)}/{p.GetAircraftTotal(stage, isFriend)}\r\n"))); } else { - AirStage1Enemy.Text = string.Format("-{0}/{1}", phase1LostEnemy, phase1TotalEnemy); + label.Text = $"-{phases[1].GetAircraftLost(stage, isFriend)}/{phases[1].GetAircraftTotal(stage, isFriend)}"; + ToolTipInfo.SetToolTip(label, null); } - if (needAppendInfo) - { - - var sb = new StringBuilder(); - - if (phaseJetStage1Enabled) - sb.AppendFormat("噴式戦: -{0}/{1}\r\n", jetLostEnemy, jetTotalEnemy); - - sb.AppendFormat("第1次: -{0}/{1}\r\n", phase1LostEnemy, phase1TotalEnemy); - - if (phase2Stage1Enabled) - sb.AppendFormat("第2次: -{0}/{1}\r\n", phase2LostEnemy, phase2TotalEnemy); - - ToolTipInfo.SetToolTip(AirStage1Enemy, sb.ToString()); - } + if (phasesEnabled.Any(p => p.GetAircraftTotal(stage, isFriend) > 0 && p.GetAircraftLost(stage, isFriend) == p.GetAircraftTotal(stage, isFriend))) + label.ForeColor = Color.Red; else - { - ToolTipInfo.SetToolTip(AirStage1Enemy, null); - } + label.ForeColor = SystemColors.ControlText; + } - // lost flag - if ((jetTotalEnemy > 0 && jetLostEnemy == jetTotalEnemy) || - (phase1TotalEnemy > 0 && phase1LostEnemy == phase1TotalEnemy) || - (phase2TotalEnemy > 0 && phase2LostEnemy == phase2TotalEnemy)) - { - AirStage1Enemy.ForeColor = Color.Red; - } - else - { - AirStage1Enemy.ForeColor = SystemColors.ControlText; - } + void ClearAACutinLabel() + { + AACutin.Text = "対空砲火"; + AACutin.ImageAlign = ContentAlignment.MiddleCenter; + AACutin.ImageIndex = -1; + ToolTipInfo.SetToolTip(AACutin, null); + } - // touch - if (jetTouchEnemy > 0 || phase1TouchEnemy > 0 || phase2TouchEnemy > 0) - { - AirStage1Enemy.ImageAlign = ContentAlignment.MiddleLeft; - AirStage1Enemy.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane; - var jetTouchPlane = KCDatabase.Instance.MasterEquipments[jetTouchEnemy]; - var phase1TouchPlane = KCDatabase.Instance.MasterEquipments[phase1TouchEnemy]; - var phase2TouchPlane = KCDatabase.Instance.MasterEquipments[phase2TouchEnemy]; - var sb = new StringBuilder(ToolTipInfo.GetToolTip(AirStage1Enemy)); - sb.AppendLine("触接中"); + if (phases[1].Stage1Enabled) + { + bool needAppendInfo = phases[0].Stage1Enabled || phases[2].Stage1Enabled; + var phases1 = phases.Where(p => p.Stage1Enabled); - if (phaseJetStage1Enabled) - sb.AppendFormat("噴式戦: {0}\r\n", jetTouchPlane?.Name ?? "(なし)"); - if (needAppendInfo) - sb.Append("第1次: "); - sb.AppendFormat("{0}\r\n", phase1TouchPlane?.Name ?? "(なし)"); - if (phase2Stage1Enabled) - sb.AppendFormat("第2次: {0}\r\n", phase2TouchPlane?.Name ?? "(なし)"); + AirSuperiority.Text = Constants.GetAirSuperiority(phases[1].Air.AirSuperiority); - ToolTipInfo.SetToolTip(AirStage1Enemy, sb.ToString()); + ToolTipInfo.SetToolTip(AirSuperiority, + needAppendInfo ? string.Join("", phases1.Select(p => $"{p.PhaseName}{Constants.GetAirSuperiority(p.Air.AirSuperiority)}\r\n")) : null); - } - else - { - AirStage1Enemy.ImageAlign = ContentAlignment.MiddleCenter; - AirStage1Enemy.ImageIndex = -1; - } + SetShootdown(AirStage1Friend, 1, true, needAppendInfo); + SetShootdown(AirStage1Enemy, 1, false, needAppendInfo); + void SetTouch(ImageLabel label, bool isFriend) + { + if (phases1.Any(p => p.GetTouchAircraft(isFriend) > 0)) + { + label.ImageAlign = ContentAlignment.MiddleLeft; + label.ImageIndex = (int)ResourceManager.EquipmentContent.Seaplane; + ToolTipInfo.SetToolTip(label, ToolTipInfo.GetToolTip(label) + + "触接中\r\n" + string.Join("\r\n", phases1.Select(p => $"{p.PhaseName}{(KCDatabase.Instance.MasterEquipments[p.GetTouchAircraft(isFriend)]?.Name ?? "(なし)")}"))); + } + else + { + label.ImageAlign = ContentAlignment.MiddleCenter; + label.ImageIndex = -1; + } + } + SetTouch(AirStage1Friend, true); + SetTouch(AirStage1Enemy, false); } else - { // 空対空戦闘発生せず + { AirSuperiority.Text = Constants.GetAirSuperiority(-1); ToolTipInfo.SetToolTip(AirSuperiority, null); - AirStage1Friend.Text = "-"; - AirStage1Friend.ForeColor = SystemColors.ControlText; - AirStage1Friend.ImageAlign = ContentAlignment.MiddleCenter; - AirStage1Friend.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage1Friend, null); - - AirStage1Enemy.Text = "-"; - AirStage1Enemy.ForeColor = SystemColors.ControlText; - AirStage1Enemy.ImageAlign = ContentAlignment.MiddleCenter; - AirStage1Enemy.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage1Enemy, null); + ClearAircraftLabel(AirStage1Friend); + ClearAircraftLabel(AirStage1Enemy); } - - // 艦対空戦闘 - if (phase1Enabled && phase1.IsStage2Available) + if (phases[1].Stage2Enabled) { + bool needAppendInfo = phases[0].Stage2Enabled || phases[2].Stage2Enabled; + var phases2 = phases.Where(p => p.Stage2Enabled); - bool phaseJetStage2Enabled = phaseJetEnabled && phaseJet.IsStage2Available; - bool phase2Stage2Enabled = phase2Enabled && phase2.IsStage2Available; - bool needAppendInfo = phaseJetStage2Enabled || phase2Stage2Enabled; - - // friends - int jetLostFriend = phaseJetStage2Enabled ? phaseJet.AircraftLostStage2Friend : 0; - int phase1LostFriend = phase1.AircraftLostStage2Friend; - int phase2LostFriend = phase2Stage2Enabled ? phase2.AircraftLostStage2Friend : 0; - - int jetTotalFriend = phaseJetStage2Enabled ? phaseJet.AircraftTotalStage2Friend : 0; - int phase1TotalFriend = phase1.AircraftTotalStage2Friend; - int phase2TotalFriend = phase2Stage2Enabled ? phase2.AircraftTotalStage2Friend : 0; - - int jetTouchFriend = phaseJetStage2Enabled ? phaseJet.TouchAircraftFriend : -1; - int phase1TouchFriend = phase1.TouchAircraftFriend; - int phase2TouchFriend = phase2Stage2Enabled ? phase2.TouchAircraftFriend : -1; - - if (needAppendInfo) - { - var text = new List(); - - if (phaseJetStage2Enabled) - text.Add("-" + jetLostFriend); - - text.Add("-" + phase1LostFriend); - - if (phase2Stage2Enabled) - text.Add("-" + phase2LostFriend); - - AirStage2Friend.Text = string.Join(",", text); - - } - else - { - AirStage2Friend.Text = string.Format("-{0}/{1}", phase1LostFriend, phase1TotalFriend); - } - - if (needAppendInfo) - { - - var sb = new StringBuilder(); - - if (phaseJetStage2Enabled) - sb.AppendFormat("噴式戦: -{0}/{1}\r\n", jetLostFriend, jetTotalFriend); - - sb.AppendFormat("第1次: -{0}/{1}\r\n", phase1LostFriend, phase1TotalFriend); - - if (phase2Stage2Enabled) - sb.AppendFormat("第2次: -{0}/{1}\r\n", phase2LostFriend, phase2TotalFriend); - - ToolTipInfo.SetToolTip(AirStage2Friend, sb.ToString()); - } - else - { - ToolTipInfo.SetToolTip(AirStage2Friend, null); - } - - // lost flag - if ((jetTotalFriend > 0 && jetLostFriend == jetTotalFriend) || - (phase1TotalFriend > 0 && phase1LostFriend == phase1TotalFriend) || - (phase2TotalFriend > 0 && phase2LostFriend == phase2TotalFriend)) - { - AirStage2Friend.ForeColor = Color.Red; - } - else - { - AirStage2Friend.ForeColor = SystemColors.ControlText; - } - - AirStage2Friend.ImageAlign = ContentAlignment.MiddleCenter; - AirStage2Friend.ImageIndex = -1; - - - // enemies - int jetLostEnemy = phaseJetStage2Enabled ? phaseJet.AircraftLostStage2Enemy : 0; - int phase1LostEnemy = phase1.AircraftLostStage2Enemy; - int phase2LostEnemy = phase2Stage2Enabled ? phase2.AircraftLostStage2Enemy : 0; - - int jetTotalEnemy = phaseJetStage2Enabled ? phaseJet.AircraftTotalStage2Enemy : 0; - int phase1TotalEnemy = phase1.AircraftTotalStage2Enemy; - int phase2TotalEnemy = phase2Stage2Enabled ? phase2.AircraftTotalStage2Enemy : 0; - - int jetTouchEnemy = phaseJetStage2Enabled ? phaseJet.TouchAircraftEnemy : -1; - int phase1TouchEnemy = phase1.TouchAircraftEnemy; - int phase2TouchEnemy = phase2Stage2Enabled ? phase2.TouchAircraftEnemy : -1; - - if (needAppendInfo) - { - var text = new List(); - - if (phaseJetStage2Enabled) - text.Add("-" + jetLostEnemy); - - text.Add("-" + phase1LostEnemy); - - if (phase2Stage2Enabled) - text.Add("-" + phase2LostEnemy); - - AirStage2Enemy.Text = string.Join(",", text); + SetShootdown(AirStage2Friend, 2, true, needAppendInfo); + SetShootdown(AirStage2Enemy, 2, false, needAppendInfo); - } - else - { - AirStage2Enemy.Text = string.Format("-{0}/{1}", phase1LostEnemy, phase1TotalEnemy); - } - if (needAppendInfo) + if (phases2.Any(p => p.Air.IsAACutinAvailable)) { + AACutin.Text = "#" + string.Join("/", phases2.Select(p => p.Air.IsAACutinAvailable ? (p.Air.AACutInIndex + 1).ToString() : "-")); + AACutin.ImageAlign = ContentAlignment.MiddleLeft; + AACutin.ImageIndex = (int)ResourceManager.EquipmentContent.HighAngleGun; - var sb = new StringBuilder(); - - if (phaseJetStage2Enabled) - sb.AppendFormat("噴式戦: -{0}/{1}\r\n", jetLostEnemy, jetTotalEnemy); - - sb.AppendFormat("第1次: -{0}/{1}\r\n", phase1LostEnemy, phase1TotalEnemy); - - if (phase2Stage2Enabled) - sb.AppendFormat("第2次: -{0}/{1}\r\n", phase2LostEnemy, phase2TotalEnemy); - - ToolTipInfo.SetToolTip(AirStage2Enemy, sb.ToString()); + ToolTipInfo.SetToolTip(AACutin, "対空カットイン\r\n" + + string.Join("\r\n", phases2.Select(p => p.PhaseName + (p.Air.IsAACutinAvailable ? $"{p.Air.AACutInShip.NameWithLevel}\r\nカットイン種別: {p.Air.AACutInKind} ({Constants.GetAACutinKind(p.Air.AACutInKind)})" : "(発動せず)")))); } else { - ToolTipInfo.SetToolTip(AirStage2Enemy, null); - } - - // lost flag - if ((jetTotalEnemy > 0 && jetLostEnemy == jetTotalEnemy) || - (phase1TotalEnemy > 0 && phase1LostEnemy == phase1TotalEnemy) || - (phase2TotalEnemy > 0 && phase2LostEnemy == phase2TotalEnemy)) - { - AirStage2Enemy.ForeColor = Color.Red; + ClearAACutinLabel(); } - else - { - AirStage2Enemy.ForeColor = SystemColors.ControlText; - } - - AirStage2Enemy.ImageAlign = ContentAlignment.MiddleCenter; - AirStage2Enemy.ImageIndex = -1; - - - // 対空カットイン - { - int jetAACutInKind = phaseJetStage2Enabled && phaseJet.IsAACutinAvailable ? phaseJet.AACutInKind : -1; - int phase1AACutInKind = phase1.IsAACutinAvailable ? phase1.AACutInKind : -1; - int phase2AACutInKind = phase2Stage2Enabled && phase2.IsAACutinAvailable ? phase2.AACutInKind : -1; - - int jetAACutInIndex = jetAACutInKind > 0 ? phaseJet.AACutInIndex : -1; - int phase1AACutInIndex = phase1AACutInKind > 0 ? phase1.AACutInIndex : -1; - int phase2AACutInIndex = phase2AACutInKind > 0 ? phase2.AACutInIndex : -1; - - if (jetAACutInKind > 0 || phase1AACutInKind > 0 || phase2AACutInKind > 0) - { - - var text = new List(); - - if (jetAACutInKind > 0) - text.Add((jetAACutInIndex + 1).ToString()); - else if (phaseJetStage2Enabled) - text.Add("-"); - - if (phase1AACutInKind > 0) - text.Add((phase1AACutInIndex + 1).ToString()); - else - text.Add("-"); - - if (phase2AACutInKind > 0) - text.Add((phase2AACutInIndex + 1).ToString()); - else if (phase2Stage2Enabled) - text.Add("-"); - - AACutin.Text = "#" + string.Join("/", text); - AACutin.ImageAlign = ContentAlignment.MiddleLeft; - AACutin.ImageIndex = (int)ResourceManager.EquipmentContent.HighAngleGun; - - - var sb = new StringBuilder(); - sb.AppendLine("対空カットイン"); - - if (phaseJetStage2Enabled) - { - sb.Append("噴式戦: "); - - if (jetAACutInKind > 0) - { - sb.AppendLine(phaseJet.AACutInShip.NameWithLevel); - sb.AppendFormat("カットイン種別: {0} ({1})\r\n", jetAACutInKind, Constants.GetAACutinKind(jetAACutInKind)); - } - else - { - sb.AppendLine("(発動せず)"); - } - } - - if (needAppendInfo) - sb.Append("第1次: "); - if (phase1AACutInKind > 0) - { - sb.AppendLine(phase1.AACutInShip.NameWithLevel); - sb.AppendFormat("カットイン種別: {0} ({1})\r\n", phase1AACutInKind, Constants.GetAACutinKind(phase1AACutInKind)); - } - else - { - sb.AppendLine("(発動せず)"); - } - - if (phase2Stage2Enabled) - { - sb.Append("第2次: "); - - if (phase2AACutInKind > 0) - { - sb.AppendLine(phase2.AACutInShip.NameWithLevel); - sb.AppendFormat("カットイン種別: {0} ({1})\r\n", phase2AACutInKind, Constants.GetAACutinKind(phase2AACutInKind)); - } - else - { - sb.AppendLine("(発動せず)"); - } - } - - ToolTipInfo.SetToolTip(AACutin, sb.ToString()); - - } - else - { - AACutin.Text = "対空砲火"; - AACutin.ImageAlign = ContentAlignment.MiddleCenter; - AACutin.ImageIndex = -1; - ToolTipInfo.SetToolTip(AACutin, null); - } - } - } else - { // 艦対空戦闘発生せず - AirStage2Friend.Text = "-"; - AirStage2Friend.ForeColor = SystemColors.ControlText; - AirStage2Friend.ImageAlign = ContentAlignment.MiddleCenter; - AirStage2Friend.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage2Friend, null); - - AirStage2Enemy.Text = "-"; - AirStage2Enemy.ForeColor = SystemColors.ControlText; - AirStage2Enemy.ImageAlign = ContentAlignment.MiddleCenter; - AirStage2Enemy.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage2Enemy, null); - - AACutin.Text = "対空砲火"; - AACutin.ImageAlign = ContentAlignment.MiddleCenter; - AACutin.ImageIndex = -1; - ToolTipInfo.SetToolTip(AACutin, null); + { + ClearAircraftLabel(AirStage2Friend); + ClearAircraftLabel(AirStage2Enemy); + ClearAACutinLabel(); } - } - - /// - /// 航空戦情報をクリアします。 - /// private void ClearAerialWarfare() { AirSuperiority.Text = "-"; ToolTipInfo.SetToolTip(AirSuperiority, null); - AirStage1Friend.Text = "-"; - AirStage1Friend.ForeColor = SystemColors.ControlText; - AirStage1Friend.ImageAlign = ContentAlignment.MiddleCenter; - AirStage1Friend.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage1Friend, null); - - AirStage1Enemy.Text = "-"; - AirStage1Enemy.ForeColor = SystemColors.ControlText; - AirStage1Enemy.ImageAlign = ContentAlignment.MiddleCenter; - AirStage1Enemy.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage1Enemy, null); - - AirStage2Friend.Text = "-"; - AirStage2Friend.ForeColor = SystemColors.ControlText; - AirStage2Friend.ImageAlign = ContentAlignment.MiddleCenter; - AirStage2Friend.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage2Friend, null); - - AirStage2Enemy.Text = "-"; - AirStage2Enemy.ImageAlign = ContentAlignment.MiddleCenter; - AirStage2Enemy.ForeColor = SystemColors.ControlText; - AirStage2Enemy.ImageIndex = -1; - ToolTipInfo.SetToolTip(AirStage2Enemy, null); + ClearAircraftLabel(AirStage1Friend); + ClearAircraftLabel(AirStage1Enemy); + ClearAircraftLabel(AirStage2Friend); + ClearAircraftLabel(AirStage2Enemy); AACutin.Text = "-"; AACutin.ImageAlign = ContentAlignment.MiddleCenter; @@ -1064,6 +686,7 @@ private void ClearAerialWarfare() } + /// /// 両軍のHPゲージを設定します。 /// From 5c78b42375a73c347f6c90e2f97ca5f1b0c198ed Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 12 Dec 2017 23:11:10 +0900 Subject: [PATCH 2/2] Version 3.0.6 --- ElectronicObserver/Utility/SoftwareInformation.cs | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ElectronicObserver/Utility/SoftwareInformation.cs b/ElectronicObserver/Utility/SoftwareInformation.cs index b5d845f5b..9b8207661 100644 --- a/ElectronicObserver/Utility/SoftwareInformation.cs +++ b/ElectronicObserver/Utility/SoftwareInformation.cs @@ -29,20 +29,20 @@ public static class SoftwareInformation /// /// バージョン(日本語, ソフトウェア名を含みます) /// - public static string VersionJapanese => SoftwareNameJapanese + "三〇型改五"; + public static string VersionJapanese => SoftwareNameJapanese + "三〇型改六"; /// /// バージョン(英語) /// - public static string VersionEnglish => "3.0.5"; + public static string VersionEnglish => "3.0.6"; /// /// 更新日時 /// - public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2017/12/06 00:00:00"); + public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2017/12/12 22:00:00"); diff --git a/README.md b/README.md index 95ffbfb20..273506414 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ *このリンクの更新は遅れる可能性があります。最新版は[こちら](http://electronicobserver.blog.fc2.com/)で確認してください。* -[ver. 3.0.5 (2017/12/06)](http://bit.ly/2BJWLFb) +[ver. 3.0.6 (2017/12/12)](http://bit.ly/2C7hyCs) [更新内容・履歴はこちらで確認できます。](https://github.com/andanteyk/ElectronicObserver/wiki/ChangeLog)