From 2924722dbe577e5384604f1594507e06868f7a62 Mon Sep 17 00:00:00 2001 From: Andante Date: Mon, 20 Nov 2017 10:36:20 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A4=9C=E6=88=A6=E5=BE=8C=E3=81=AE?= =?UTF-8?q?=E6=88=A6=E9=97=98=E8=A9=95=E4=BE=A1=E4=BA=88=E6=B8=AC=E3=81=8C?= =?UTF-8?q?=E8=AA=A4=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/Battle/BattleManager.cs | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/ElectronicObserver/Data/Battle/BattleManager.cs b/ElectronicObserver/Data/Battle/BattleManager.cs index ca094675a..9dc1cb276 100644 --- a/ElectronicObserver/Data/Battle/BattleManager.cs +++ b/ElectronicObserver/Data/Battle/BattleManager.cs @@ -205,7 +205,6 @@ public override void LoadFromResponse(string apiname, dynamic data) case "api_req_sortie/night_to_day": BattleMode = BattleModes.NightDay; BattleDay = new BattleDayFromNight(); - BattleDay.TakeOverParameters(BattleNight); BattleDay.LoadFromResponse(apiname, data); break; @@ -261,8 +260,8 @@ public override void LoadFromResponse(string apiname, dynamic data) break; case "api_req_combined_battle/ec_night_to_day": + BattleMode = BattleModes.NightDay | BattleModes.EnemyCombinedFleet; BattleDay = new BattleEnemyCombinedDayFromNight(); - BattleDay.TakeOverParameters(BattleNight); BattleDay.LoadFromResponse(apiname, data); break; @@ -500,7 +499,7 @@ public int PredictWinRank(out double friendrate, out double enemyrate) int enemysunk = 0; BattleData activeBattle = SecondBattle ?? FirstBattle; - + var firstInitial = FirstBattle.Initial; var friend = activeBattle.Initial.FriendFleet.MembersWithoutEscaped; var friendescort = activeBattle.Initial.FriendFleetEscort?.MembersWithoutEscaped; @@ -509,9 +508,9 @@ public int PredictWinRank(out double friendrate, out double enemyrate) - for (int i = 0; i < activeBattle.Initial.FriendInitialHPs.Length; i++) + for (int i = 0; i < firstInitial.FriendInitialHPs.Length; i++) { - int initial = activeBattle.Initial.FriendInitialHPs[i]; + int initial = firstInitial.FriendInitialHPs[i]; if (initial < 0) continue; @@ -521,15 +520,15 @@ public int PredictWinRank(out double friendrate, out double enemyrate) friendafter += Math.Max(result, 0); friendcount++; - if (result < 0) + if (result <= 0) friendsunk++; } - if (IsCombinedBattle) + if (firstInitial.FriendInitialHPsEscort != null) { - for (int i = 0; i < activeBattle.Initial.FriendInitialHPsEscort.Length; i++) + for (int i = 0; i < firstInitial.FriendInitialHPsEscort.Length; i++) { - int initial = activeBattle.Initial.FriendInitialHPsEscort[i]; + int initial = firstInitial.FriendInitialHPsEscort[i]; if (initial < 0) continue; @@ -539,14 +538,14 @@ public int PredictWinRank(out double friendrate, out double enemyrate) friendafter += Math.Max(result, 0); friendcount++; - if (result < 0) + if (result <= 0) friendsunk++; } } - for (int i = 0; i < activeBattle.Initial.EnemyInitialHPs.Length; i++) + for (int i = 0; i < firstInitial.EnemyInitialHPs.Length; i++) { - int initial = activeBattle.Initial.EnemyInitialHPs[i]; + int initial = firstInitial.EnemyInitialHPs[i]; if (initial < 0) continue; @@ -556,15 +555,15 @@ public int PredictWinRank(out double friendrate, out double enemyrate) enemyafter += Math.Max(result, 0); enemycount++; - if (result < 0) + if (result <= 0) enemysunk++; } - if (IsEnemyCombined) + if (firstInitial.EnemyInitialHPsEscort != null) { - for (int i = 0; i < activeBattle.Initial.EnemyInitialHPsEscort.Length; i++) + for (int i = 0; i < firstInitial.EnemyInitialHPsEscort.Length; i++) { - int initial = activeBattle.Initial.EnemyInitialHPsEscort[i]; + int initial = firstInitial.EnemyInitialHPsEscort[i]; if (initial < 0) continue; @@ -574,7 +573,7 @@ public int PredictWinRank(out double friendrate, out double enemyrate) enemyafter += Math.Max(result, 0); enemycount++; - if (result < 0) + if (result <= 0) enemysunk++; } @@ -588,9 +587,8 @@ public int PredictWinRank(out double friendrate, out double enemyrate) if ((BattleMode & BattleModes.BattlePhaseMask) == BattleModes.AirRaid) return GetWinRankAirRaid(friendcount, friendsunk, friendrate); else - return GetWinRank(friendcount, enemycount, friendsunk, enemysunk, friendrate, enemyrate, - friend[0].HPRate <= 0.25, resultHPs[BattleIndex.Get(BattleSides.EnemyMain, 0)] <= 0); - + return GetWinRank(friendcount, enemycount, friendsunk, enemysunk, friendrate, enemyrate, + friend[0].HPRate <= 0.25, resultHPs[BattleIndex.EnemyMain1] <= 0); } From b434c784606fbb35ce6d1142a0ead0aa59f785a2 Mon Sep 17 00:00:00 2001 From: Andante Date: Mon, 20 Nov 2017 23:42:35 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E6=88=A6=E9=97=98=EF=BC=9A=E9=95=B7?= =?UTF-8?q?=E8=B7=9D=E9=9B=A2=E7=A9=BA=E8=A5=B2=E6=88=A6=E3=81=A7=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=8C=E7=99=BA=E7=94=9F=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * api_frai などの配列の中に null が含まれることがあるため * 任務:撃沈系任務のカウントが倒さなくても進む不具合を修正 * グループ:艦種を含むフィルタを追加したときにエラーが出る不具合を修正 --- .../Data/Battle/Phase/PhaseAirBattleBase.cs | 42 ++++++++++++------- .../Data/Quest/QuestProgressManager.cs | 4 +- .../Window/Dialog/DialogShipGroupFilter.cs | 3 +- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/ElectronicObserver/Data/Battle/Phase/PhaseAirBattleBase.cs b/ElectronicObserver/Data/Battle/Phase/PhaseAirBattleBase.cs index 29a5cd258..6fdd9a91b 100644 --- a/ElectronicObserver/Data/Battle/Phase/PhaseAirBattleBase.cs +++ b/ElectronicObserver/Data/Battle/Phase/PhaseAirBattleBase.cs @@ -220,29 +220,39 @@ protected T[] ConcatStage3Array(string friendName, string enemyName) where T T[] ret = new T[24]; - if (IsStage3Available) + void SetArray(string stage3Name, string sideName, int retIndex) { - T[] friend = AirBattleData.api_stage3.IsDefined(friendName) ? (T[])AirBattleData.api_stage3[friendName] ?? new T[0] : new T[0]; - T[] enemy = AirBattleData.api_stage3.IsDefined(enemyName) ? (T[])AirBattleData.api_stage3[enemyName] ?? new T[0] : new T[0]; + if (!AirBattleData[stage3Name].IsDefined(sideName)) + return; - Array.Copy(friend, 0, ret, 0, friend.Length); - Array.Copy(enemy, 0, ret, 12, enemy.Length); - } - if (IsStage3CombinedAvailable) - { - T[] friend = AirBattleData.api_stage3_combined.IsDefined(friendName) ? (T[])AirBattleData.api_stage3_combined[friendName] ?? new T[0] : new T[0]; - T[] enemy = AirBattleData.api_stage3_combined.IsDefined(enemyName) ? (T[])AirBattleData.api_stage3_combined[enemyName] ?? new T[0] : new T[0]; + var ar = (dynamic[])AirBattleData[stage3Name][sideName]; + if (ar == null) + return; - Array.Copy(friend, 0, ret, 6, friend.Length); - Array.Copy(enemy, 0, ret, 18, enemy.Length); + for (int i = 0; i < ar.Length; i++) + { + var value = (T?)ar[i] ?? default(T); + + // Max(value, 0) + if (value.CompareTo(default(T)) < 0) + value = default(T); + + ret[retIndex + i] = value; + } } - for (int i = 0; i < ret.Length; i++) + + if (IsStage3Available) + { + SetArray("api_stage3", friendName, 0); + SetArray("api_stage3", enemyName, 12); + } + if (IsStage3CombinedAvailable) { - // Max( ret[i], 0 ) - if (ret[i].CompareTo(default(T)) < 0) - ret[i] = default(T); + SetArray("api_stage3_combined", friendName, 6); + SetArray("api_stage3_combined", enemyName, 18); } + return ret; } diff --git a/ElectronicObserver/Data/Quest/QuestProgressManager.cs b/ElectronicObserver/Data/Quest/QuestProgressManager.cs index 35e8fe924..b3ea552b0 100644 --- a/ElectronicObserver/Data/Quest/QuestProgressManager.cs +++ b/ElectronicObserver/Data/Quest/QuestProgressManager.cs @@ -404,7 +404,7 @@ void BattleFinished(string apiname, dynamic data) for (int i = 0; i < 6; i++) { - if (hps[i + 6] <= 0) + if (hps[Battle.BattleIndex.Get(Battle.BattleSides.EnemyMain, i)] <= 0) { var ship = battle.Initial.EnemyMembersInstance[i]; if (ship == null) @@ -414,7 +414,7 @@ void BattleFinished(string apiname, dynamic data) p.Increment(ship.ShipType); } - if (bm.IsEnemyCombined && hps[i + 18] <= 0) + if (bm.IsEnemyCombined && hps[Battle.BattleIndex.Get(Battle.BattleSides.EnemyEscort, i)] <= 0) { var ship = battle.Initial.EnemyMembersEscortInstance[i]; if (ship == null) diff --git a/ElectronicObserver/Window/Dialog/DialogShipGroupFilter.cs b/ElectronicObserver/Window/Dialog/DialogShipGroupFilter.cs index d725556d4..6004f6189 100644 --- a/ElectronicObserver/Window/Dialog/DialogShipGroupFilter.cs +++ b/ElectronicObserver/Window/Dialog/DialogShipGroupFilter.cs @@ -799,7 +799,8 @@ private ExpressionData BuildExpressionDataFromUI() Type type = exp.GetLeftOperandType(); if (type != null && type != typeof(string) && type.GetInterface("IEnumerable") != null) type = type.GetElementType() ?? type.GetGenericArguments().First(); - + if (type.IsEnum) + type = type.GetEnumUnderlyingType(); if (RightOperand_ComboBox.Enabled) { From c56bef91ed8961ff07fe976e63769e596a47e7c3 Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 21 Nov 2017 00:34:00 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E9=80=A3=E5=90=88=E8=89=A6=E9=9A=8A?= =?UTF-8?q?=E6=99=82=E3=81=AB=E5=A4=A7=E7=A0=B4=E9=80=9A=E7=9F=A5=E3=81=8C?= =?UTF-8?q?=E6=AD=A3=E3=81=97=E3=81=8F=E8=A1=A8=E7=A4=BA=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 夜昼戦APIの登録をすっかり忘れていたので実装 --- ElectronicObserver/Notifier/NotifierDamage.cs | 64 ++----------- .../Resource/Record/ShipParameterRecord.cs | 2 + ElectronicObserver/Utility/SyncBGMPlayer.cs | 2 + ElectronicObserver/Window/FormBattle.cs | 91 ++++++++++++++----- ElectronicObserver/Window/FormCompass.cs | 38 ++++---- 5 files changed, 99 insertions(+), 98 deletions(-) diff --git a/ElectronicObserver/Notifier/NotifierDamage.cs b/ElectronicObserver/Notifier/NotifierDamage.cs index 77cd65b09..f5902048b 100644 --- a/ElectronicObserver/Notifier/NotifierDamage.cs +++ b/ElectronicObserver/Notifier/NotifierDamage.cs @@ -101,6 +101,7 @@ private void Initialize() o["api_req_battle_midnight/sp_midnight"].ResponseReceived += BattleStarted; o["api_req_sortie/airbattle"].ResponseReceived += BattleStarted; o["api_req_sortie/ld_airbattle"].ResponseReceived += BattleStarted; + o["api_req_sortie/night_to_day"].ResponseReceived += BattleStarted; o["api_req_combined_battle/battle"].ResponseReceived += BattleStarted; o["api_req_combined_battle/battle_water"].ResponseReceived += BattleStarted; o["api_req_combined_battle/airbattle"].ResponseReceived += BattleStarted; @@ -109,6 +110,7 @@ private void Initialize() o["api_req_combined_battle/ld_airbattle"].ResponseReceived += BattleStarted; o["api_req_combined_battle/ec_battle"].ResponseReceived += BattleStarted; o["api_req_combined_battle/ec_midnight_battle"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/ec_night_to_day"].ResponseReceived += BattleStarted; o["api_req_combined_battle/each_battle"].ResponseReceived += BattleStarted; o["api_req_combined_battle/each_battle_water"].ResponseReceived += BattleStarted; @@ -185,66 +187,17 @@ private void CheckBattle() return; - List list = new List(); + var list = new List(); - if (bm.StartsFromDayBattle) - { - if (bm.BattleNight != null) - { - list.AddRange(GetDamagedShips(bm.BattleNight.Initial.FriendFleet, bm.BattleNight.ResultHPs.ToArray())); - } - else - { - list.AddRange(GetDamagedShips(bm.BattleDay.Initial.FriendFleet, bm.BattleDay.ResultHPs.ToArray())); - } - - } - else - { - if (bm.BattleDay != null) - { - list.AddRange(GetDamagedShips(bm.BattleDay.Initial.FriendFleet, bm.BattleDay.ResultHPs.ToArray())); - } - else - { - list.AddRange(GetDamagedShips(bm.BattleNight.Initial.FriendFleet, bm.BattleNight.ResultHPs.ToArray())); - } - - } + var battle = bm.SecondBattle ?? bm.FirstBattle; + list.AddRange(GetDamagedShips(battle.Initial.FriendFleet, battle.ResultHPs.ToArray())); if (bm.IsCombinedBattle) - { - if (bm.StartsFromDayBattle) - { - if (bm.BattleNight != null) - { - list.AddRange(GetDamagedShips(KCDatabase.Instance.Fleet[2], bm.BattleNight.ResultHPs.Skip(12).ToArray())); - } - else - { - list.AddRange(GetDamagedShips(KCDatabase.Instance.Fleet[2], bm.BattleDay.ResultHPs.Skip(12).ToArray())); - } - - } - else - { - if (bm.BattleDay != null) - { - list.AddRange(GetDamagedShips(KCDatabase.Instance.Fleet[2], bm.BattleDay.ResultHPs.Skip(12).ToArray())); - } - else - { - list.AddRange(GetDamagedShips(KCDatabase.Instance.Fleet[2], bm.BattleNight.ResultHPs.Skip(12).ToArray())); - } - - } - } + list.AddRange(GetDamagedShips(battle.Initial.FriendFleetEscort, battle.ResultHPs.Skip(6).ToArray())); if (list.Count > 0) - { Notify(list.ToArray()); - } } @@ -273,15 +226,12 @@ private string[] GetDamagedShips(FleetData fleet, int[] hps) for (int i = 0; i < fleet.Members.Count; i++) { - if (i == 0 && !ContainsFlagship) continue; ShipData s = fleet.MembersInstance[i]; - if (s != null && !fleet.EscapedShipList.Contains(s.MasterID) && - IsShipDamaged(s, hps[i])) + if (s != null && !fleet.EscapedShipList.Contains(s.MasterID) && IsShipDamaged(s, hps[i])) { - list.AddLast($"{s.NameWithLevel} ({hps[i]}/{s.HPMax})"); } } diff --git a/ElectronicObserver/Resource/Record/ShipParameterRecord.cs b/ElectronicObserver/Resource/Record/ShipParameterRecord.cs index 014d22a21..70fe84a18 100644 --- a/ElectronicObserver/Resource/Record/ShipParameterRecord.cs +++ b/ElectronicObserver/Resource/Record/ShipParameterRecord.cs @@ -538,12 +538,14 @@ public override void RegisterEvents() ao["api_req_battle_midnight/sp_midnight"].ResponseReceived += BattleStart; ao["api_req_sortie/airbattle"].ResponseReceived += BattleStart; ao["api_req_sortie/ld_airbattle"].ResponseReceived += BattleStart; + ao["api_req_sortie/night_to_day"].ResponseReceived += BattleStart; ao["api_req_combined_battle/battle"].ResponseReceived += BattleStart; ao["api_req_combined_battle/sp_midnight"].ResponseReceived += BattleStart; ao["api_req_combined_battle/airbattle"].ResponseReceived += BattleStart; ao["api_req_combined_battle/battle_water"].ResponseReceived += BattleStart; ao["api_req_combined_battle/ld_airbattle"].ResponseReceived += BattleStart; ao["api_req_combined_battle/ec_battle"].ResponseReceived += BattleStart; + ao["api_req_combined_battle/ec_night_to_day"].ResponseReceived += BattleStart; ao["api_req_combined_battle/each_battle"].ResponseReceived += BattleStart; ao["api_req_combined_battle/each_battle_water"].ResponseReceived += BattleStart; diff --git a/ElectronicObserver/Utility/SyncBGMPlayer.cs b/ElectronicObserver/Utility/SyncBGMPlayer.cs index 6b687bf4d..16b563f4c 100644 --- a/ElectronicObserver/Utility/SyncBGMPlayer.cs +++ b/ElectronicObserver/Utility/SyncBGMPlayer.cs @@ -145,9 +145,11 @@ public SyncBGMPlayer() o["api_req_battle_midnight/battle"].ResponseReceived += PlayBattleNight; o["api_req_battle_midnight/sp_midnight"].ResponseReceived += PlayBattleNight; + o["api_req_sortie/night_to_day"].ResponseReceived += PlayBattleNight; o["api_req_combined_battle/midnight_battle"].ResponseReceived += PlayBattleNight; o["api_req_combined_battle/sp_midnight"].ResponseReceived += PlayBattleNight; o["api_req_combined_battle/ec_midnight_battle"].ResponseReceived += PlayBattleNight; + o["api_req_combined_battle/ec_night_to_day"].ResponseReceived += PlayBattleNight; o["api_req_sortie/airbattle"].ResponseReceived += PlayBattleAir; o["api_req_combined_battle/airbattle"].ResponseReceived += PlayBattleAir; diff --git a/ElectronicObserver/Window/FormBattle.cs b/ElectronicObserver/Window/FormBattle.cs index 966465724..922266f81 100644 --- a/ElectronicObserver/Window/FormBattle.cs +++ b/ElectronicObserver/Window/FormBattle.cs @@ -110,29 +110,31 @@ private void FormBattle_Load(object sender, EventArgs e) APIObserver o = APIObserver.Instance; - o.APIList["api_port/port"].ResponseReceived += Updated; - o.APIList["api_req_map/start"].ResponseReceived += Updated; - o.APIList["api_req_map/next"].ResponseReceived += Updated; - o.APIList["api_req_sortie/battle"].ResponseReceived += Updated; - o.APIList["api_req_sortie/battleresult"].ResponseReceived += Updated; - o.APIList["api_req_battle_midnight/battle"].ResponseReceived += Updated; - o.APIList["api_req_battle_midnight/sp_midnight"].ResponseReceived += Updated; - o.APIList["api_req_sortie/airbattle"].ResponseReceived += Updated; - o.APIList["api_req_sortie/ld_airbattle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/battle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/midnight_battle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/sp_midnight"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/airbattle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/battle_water"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/ld_airbattle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/ec_battle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/ec_midnight_battle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/each_battle"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/each_battle_water"].ResponseReceived += Updated; - o.APIList["api_req_combined_battle/battleresult"].ResponseReceived += Updated; - o.APIList["api_req_practice/battle"].ResponseReceived += Updated; - o.APIList["api_req_practice/midnight_battle"].ResponseReceived += Updated; - o.APIList["api_req_practice/battle_result"].ResponseReceived += Updated; + o["api_port/port"].ResponseReceived += Updated; + o["api_req_map/start"].ResponseReceived += Updated; + o["api_req_map/next"].ResponseReceived += Updated; + o["api_req_sortie/battle"].ResponseReceived += Updated; + o["api_req_sortie/battleresult"].ResponseReceived += Updated; + o["api_req_battle_midnight/battle"].ResponseReceived += Updated; + o["api_req_battle_midnight/sp_midnight"].ResponseReceived += Updated; + o["api_req_sortie/airbattle"].ResponseReceived += Updated; + o["api_req_sortie/ld_airbattle"].ResponseReceived += Updated; + o["api_req_sortie/night_to_day"].ResponseReceived += Updated; + o["api_req_combined_battle/battle"].ResponseReceived += Updated; + o["api_req_combined_battle/midnight_battle"].ResponseReceived += Updated; + o["api_req_combined_battle/sp_midnight"].ResponseReceived += Updated; + o["api_req_combined_battle/airbattle"].ResponseReceived += Updated; + o["api_req_combined_battle/battle_water"].ResponseReceived += Updated; + o["api_req_combined_battle/ld_airbattle"].ResponseReceived += Updated; + o["api_req_combined_battle/ec_battle"].ResponseReceived += Updated; + o["api_req_combined_battle/ec_midnight_battle"].ResponseReceived += Updated; + o["api_req_combined_battle/ec_night_to_day"].ResponseReceived += Updated; + o["api_req_combined_battle/each_battle"].ResponseReceived += Updated; + o["api_req_combined_battle/each_battle_water"].ResponseReceived += Updated; + o["api_req_combined_battle/battleresult"].ResponseReceived += Updated; + o["api_req_practice/battle"].ResponseReceived += Updated; + o["api_req_practice/midnight_battle"].ResponseReceived += Updated; + o["api_req_practice/battle_result"].ResponseReceived += Updated; Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged; @@ -230,6 +232,28 @@ private void Updated(string apiname, dynamic data) } break; + case "api_req_sortie/night_to_day": + { + // 暫定 + var battle = bm.BattleDay as BattleDayFromNight; + + SetFormation(bm); + SetNightBattleEvent(battle.NightBattle1); + + if (battle.NextToDay) + { + SetSearchingResult(bm.BattleDay); + SetBaseAirAttack(bm.BattleDay.BaseAirAttack); + SetAerialWarfare(bm.BattleDay.JetAirBattle, bm.BattleDay.AirBattle); + } + + SetHPBar(bm.BattleDay); + SetDamageRate(bm); + + BaseLayoutPanel.Visible = !hideDuringBattle; + } + break; + case "api_req_combined_battle/battle": case "api_req_combined_battle/battle_water": case "api_req_combined_battle/ld_airbattle": @@ -290,6 +314,27 @@ private void Updated(string apiname, dynamic data) } break; + case "api_req_combined_battle/ec_night_to_day": + { + // 暫定 + var battle = bm.BattleDay as BattleEnemyCombinedDayFromNight; + + SetFormation(bm); + SetNightBattleEvent(battle.NightBattle1); + + if (battle.NextToDay) + { + SetSearchingResult(bm.BattleDay); + SetBaseAirAttack(bm.BattleDay.BaseAirAttack); + SetAerialWarfare(bm.BattleDay.JetAirBattle, bm.BattleDay.AirBattle); + } + + SetHPBar(bm.BattleDay); + SetDamageRate(bm); + + BaseLayoutPanel.Visible = !hideDuringBattle; + } + break; case "api_req_sortie/battleresult": case "api_req_combined_battle/battleresult": diff --git a/ElectronicObserver/Window/FormCompass.cs b/ElectronicObserver/Window/FormCompass.cs index 7f1a13acd..33f54c20d 100644 --- a/ElectronicObserver/Window/FormCompass.cs +++ b/ElectronicObserver/Window/FormCompass.cs @@ -612,24 +612,26 @@ private void FormCompass_Load(object sender, EventArgs e) APIObserver o = APIObserver.Instance; - o.APIList["api_port/port"].ResponseReceived += Updated; - o.APIList["api_req_map/start"].ResponseReceived += Updated; - o.APIList["api_req_map/next"].ResponseReceived += Updated; - o.APIList["api_req_member/get_practice_enemyinfo"].ResponseReceived += Updated; - - o.APIList["api_req_sortie/battle"].ResponseReceived += BattleStarted; - o.APIList["api_req_battle_midnight/sp_midnight"].ResponseReceived += BattleStarted; - o.APIList["api_req_sortie/airbattle"].ResponseReceived += BattleStarted; - o.APIList["api_req_sortie/ld_airbattle"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/battle"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/sp_midnight"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/airbattle"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/battle_water"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/ld_airbattle"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/ec_battle"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/each_battle"].ResponseReceived += BattleStarted; - o.APIList["api_req_combined_battle/each_battle_water"].ResponseReceived += BattleStarted; - o.APIList["api_req_practice/battle"].ResponseReceived += BattleStarted; + o["api_port/port"].ResponseReceived += Updated; + o["api_req_map/start"].ResponseReceived += Updated; + o["api_req_map/next"].ResponseReceived += Updated; + o["api_req_member/get_practice_enemyinfo"].ResponseReceived += Updated; + + o["api_req_sortie/battle"].ResponseReceived += BattleStarted; + o["api_req_battle_midnight/sp_midnight"].ResponseReceived += BattleStarted; + o["api_req_sortie/night_to_day"].ResponseReceived += BattleStarted; + o["api_req_sortie/airbattle"].ResponseReceived += BattleStarted; + o["api_req_sortie/ld_airbattle"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/battle"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/sp_midnight"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/airbattle"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/battle_water"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/ld_airbattle"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/ec_battle"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/each_battle"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/each_battle_water"].ResponseReceived += BattleStarted; + o["api_req_combined_battle/ec_night_to_day"].ResponseReceived += BattleStarted; + o["api_req_practice/battle"].ResponseReceived += BattleStarted; Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged; From eedf67b20fb15136b2163c80fa2d79ab651f8e87 Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 21 Nov 2017 01:52:46 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E9=99=B8=E4=B8=8A=E5=AF=BE=E6=BD=9C?= =?UTF-8?q?=E5=93=A8=E6=88=92=E6=A9=9F=E3=81=AE=E3=82=A2=E3=82=A4=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 戦闘ログ:敵艦船IDを記録するように * 戦闘結果において、7隻編成時に経験値取得に失敗する不具合を修正 --- ElectronicObserver/Assets.zip | Bin 199088 -> 199509 bytes .../Assets/Equipment/LandASPatrol.png | Bin 0 -> 247 bytes .../Data/Battle/BattleResultData.cs | 24 +++++++++--------- .../Battle/Detail/BattleDetailDescriptor.cs | 3 ++- .../Other/Information/apilist.txt | 2 +- .../Resource/ResourceManager.cs | 2 ++ 6 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 ElectronicObserver/Assets/Equipment/LandASPatrol.png diff --git a/ElectronicObserver/Assets.zip b/ElectronicObserver/Assets.zip index 8f87f9dce5e3f42850ac7a0e94ec21dea7bf58e7..e9ad871e0b07c3cc8ef432c096038582580f7036 100644 GIT binary patch delta 483 zcmdlmndj;>o(*{s%q;Asn+qchFEaCKmQ0tGV3eG`Pm@sq#B0B($+-QZCeydp$uYM% zct5k1dQVWP{`r}Kf#Lh)!fc7@3CEdOnS%ooCpTp3O#a}YSg*L9WB<-u?1%eTH#q6e z)9X_dTi)+iB$5^IpkV9!wPr+x_yrJ zgzX=D3k|C0uMAl8ZEmXH^Ie{&%dO5=rfZiz+_C-Stj^u5mrLv3D0%zhP};Qxr7t&2 zh`r&C`QdcxmhooOSxykntt#&li2iq`^sRNe&_^bz z?ZO+G7I077#w0LZ=OYu}^ox6#6!}>7SDstyeVGwLZ`;ds&VIVgN1&2>f0%UC53Th) z50Zt^|FbQ?`~Yu8CV2)C1_lNW2B1aL4gWIv@_qCxO1>9!nNj?h4N%ecp1({^ydtb@ TKt&7}f$(Z11H;kvOh6t007FKv diff --git a/ElectronicObserver/Assets/Equipment/LandASPatrol.png b/ElectronicObserver/Assets/Equipment/LandASPatrol.png new file mode 100644 index 0000000000000000000000000000000000000000..793ea3920ec1df7459ad3f1e9cbf7a5400df8aa3 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPtw+O$v+6TjrtAIi+o-U3d7N?I+aujM%;Bd9?V}Go1 zPh}UU`^U6x0kcnOta7bi%>3zrG1GpH;+NMyY%7qr@r`jXd!MOLtoEH{PUpHw%Xd1@ zd1oti;kdWSnu)usryDKUbnWQEX4ar}>9ZIX>Np8x;= literal 0 HcmV?d00001 diff --git a/ElectronicObserver/Data/Battle/BattleResultData.cs b/ElectronicObserver/Data/Battle/BattleResultData.cs index f1d17648d..8982652ff 100644 --- a/ElectronicObserver/Data/Battle/BattleResultData.cs +++ b/ElectronicObserver/Data/Battle/BattleResultData.cs @@ -64,12 +64,12 @@ public int[] ExpList { get { - int[] ret = new int[6]; - if (RawData.api_get_ship_exp()) - { - var src = (int[])RawData.api_get_ship_exp; - Array.Copy(src, 1, ret, 0, src.Length - 1); - } + if (!RawData.api_get_ship_exp()) + return new int[6]; + + var src = (int[])RawData.api_get_ship_exp; + var ret = new int[Math.Max(src.Length - 1, 6)]; + Array.Copy(src, 1, ret, 0, src.Length - 1); return ret; } } @@ -82,12 +82,12 @@ public int[] ExpListCombined { get { - int[] ret = new int[6]; - if (RawData.api_get_ship_exp_combined()) - { - var src = (int[])RawData.api_get_ship_exp_combined; - Array.Copy(src, 1, ret, 0, src.Length - 1); - } + if (!RawData.api_get_ship_exp_combined()) + return new int[6]; + + var src = (int[])RawData.api_get_ship_exp_combined; + var ret = new int[Math.Max(src.Length - 1, 6)]; + Array.Copy(src, 1, ret, 0, src.Length - 1); return ret; } } diff --git a/ElectronicObserver/Data/Battle/Detail/BattleDetailDescriptor.cs b/ElectronicObserver/Data/Battle/Detail/BattleDetailDescriptor.cs index d6e578b33..a4d4067c3 100644 --- a/ElectronicObserver/Data/Battle/Detail/BattleDetailDescriptor.cs +++ b/ElectronicObserver/Data/Battle/Detail/BattleDetailDescriptor.cs @@ -522,8 +522,9 @@ private static void OutputEnemyData(StringBuilder sb, ShipDataMaster[] members, if (members[i] == null) continue; - sb.AppendFormat("#{0}: {1} {2} Lv. {3} HP: {4} / {5}", + sb.AppendFormat("#{0}: ID:{1} {2} {3} Lv. {4} HP: {5} / {6}", i + 1, + members[i].ShipID, members[i].ShipTypeName, members[i].NameWithClass, levels[i], initialHPs[i], maxHPs[i]); diff --git a/ElectronicObserver/Other/Information/apilist.txt b/ElectronicObserver/Other/Information/apilist.txt index 7e79b1ad4..d95cd8301 100644 --- a/ElectronicObserver/Other/Information/apilist.txt +++ b/ElectronicObserver/Other/Information/apilist.txt @@ -1108,7 +1108,7 @@ api_get_member/deck :艦隊情報 個数はそのまま保有艦隊数と同 api_name_id : api_mission :遠征状況 [0]={0=未出撃, 1=遠征中, 2=遠征帰投, 3=強制帰投中}, [1]=遠征先ID, [2]=帰投時間, [3]=0 api_flagship : - api_ship :所属艦船ID 空きは-1 + api_ship :所属艦船ID 基本的には[6] ('17 秋イベントでは第三艦隊のみ[7]) 空きは-1 Request.api_req_hensei/change :艦隊編成変更 diff --git a/ElectronicObserver/Resource/ResourceManager.cs b/ElectronicObserver/Resource/ResourceManager.cs index 9df05708f..4f7926f2d 100644 --- a/ElectronicObserver/Resource/ResourceManager.cs +++ b/ElectronicObserver/Resource/ResourceManager.cs @@ -208,6 +208,7 @@ public enum EquipmentContent ArmyInterceptor, NightFighter, NightAttacker, + LandASPatrol, Locked, Unknown, } @@ -444,6 +445,7 @@ private void LoadFromArchive(string path) LoadImageFromArchive(Equipments, archive, mstpath + @"Equipment/ArmyInterceptor.png", "Equipment_ArmyInterceptor"); LoadImageFromArchive(Equipments, archive, mstpath + @"Equipment/NightFighter.png", "Equipment_NightFighter"); LoadImageFromArchive(Equipments, archive, mstpath + @"Equipment/NightAttacker.png", "Equipment_NightAttacker"); + LoadImageFromArchive(Equipments, archive, mstpath + @"Equipment/LandASPatrol.png", "Equipment_LandASPatrol"); LoadImageFromArchive(Equipments, archive, mstpath + @"Equipment/Locked.png", "Equipment_Locked"); LoadImageFromArchive(Equipments, archive, mstpath + @"Equipment/Unknown.png", "Equipment_Unknown"); From 79561859f0d58be0f11fdc2f49db3f35070d63e6 Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 21 Nov 2017 02:23:15 +0900 Subject: [PATCH 5/5] Version 3.0.1 --- 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 ed58e793e..ccc32ed75 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.0"; + public static string VersionEnglish => "3.0.1"; /// /// 更新日時 /// - public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2017/11/20 04:30:00"); + public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2017/11/21 02:00:00"); diff --git a/README.md b/README.md index 56b785586..a6857093e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ *このリンクの更新は遅れる可能性があります。最新版は[こちら](http://electronicobserver.blog.fc2.com/)で確認してください。* -[ver. 3.0.0 (2017/11/20)](http://bit.ly/2zgW0Wr) +[ver. 3.0.1 (2017/11/21)](http://bit.ly/2izsoZR) [更新内容・履歴はこちらで確認できます。](https://github.com/andanteyk/ElectronicObserver/wiki/ChangeLog)