diff --git a/ElectronicObserver/Data/ShipData.cs b/ElectronicObserver/Data/ShipData.cs index c602adc9d..666db685f 100644 --- a/ElectronicObserver/Data/ShipData.cs +++ b/ElectronicObserver/Data/ShipData.cs @@ -1132,6 +1132,7 @@ private int CalculateAntiSubmarinePower(int engagementForm = 1) int depthChargeCount = 0; int depthChargeProjectorCount = 0; + int otherDepthChargeCount = 0; int sonarCount = 0; // ソナーと大型ソナーの合算 int largeSonarCount = 0; @@ -1146,11 +1147,13 @@ private int CalculateAntiSubmarinePower(int engagementForm = 1) sonarCount++; break; case EquipmentTypes.DepthCharge: - if (slot.IsDepthCharge) - depthChargeCount++; - else if (slot.IsDepthChargeProjector) - depthChargeProjectorCount++; - break; + if (slot.IsDepthCharge) + depthChargeCount++; + else if (slot.IsDepthChargeProjector) + depthChargeProjectorCount++; + else + otherDepthChargeCount++; + break; case EquipmentTypes.SonarLarge: largeSonarCount++; sonarCount++; @@ -1158,15 +1161,19 @@ private int CalculateAntiSubmarinePower(int engagementForm = 1) } } - double projector_sonar = depthChargeProjectorCount > 0 && sonarCount > 0 ? 1.15 : 1; - double charge_projector = depthChargeCount > 0 && depthChargeProjectorCount > 0 ? 1.1 : 1; - double charge_sonar = (!(projector_sonar > 1 && charge_projector > 1 && largeSonarCount > 0) && depthChargeCount > 0 && sonarCount > 0) ? 0.15 : 0; + double synergy = 1.0; + if (sonarCount > 0 && depthChargeProjectorCount > 0 && depthChargeCount > 0) + synergy = 1.4375; + else if (sonarCount > 0 && (depthChargeCount + depthChargeProjectorCount + otherDepthChargeCount) > 0) + synergy = 1.15; + else if (depthChargeProjectorCount > 0 && depthChargeCount > 0) + synergy = 1.1; - basepower *= projector_sonar * (charge_projector + charge_sonar); + basepower *= synergy; - //キャップ - basepower = Math.Floor(CapDamage(basepower, 170)); + //キャップ + basepower = Math.Floor(CapDamage(basepower, 170)); return (int)(basepower * GetAmmoDamageRate()); } @@ -1365,6 +1372,10 @@ public bool CanAttackSubmarine case ShipTypes.AmphibiousAssaultShip: return AllSlotInstanceMaster.Any(eq => eq != null && eq.IsAntiSubmarineAircraft); + case ShipTypes.AircraftCarrier: + return ShipID == 646 && // 加賀改二護 + AllSlotInstanceMaster.Any(eq => eq != null && eq.IsAntiSubmarineAircraft); + default: return false; } @@ -1406,6 +1417,7 @@ public bool CanOpeningASW case 529: // 大鷹改二 case 381: // 神鷹改 case 536: // 神鷹改二 + case 646: // 加賀改二護 return true; case 554: // 日向改二 diff --git a/ElectronicObserver/Resource/Record/RecordBase.cs b/ElectronicObserver/Resource/Record/RecordBase.cs index f4222224c..6f1a826e1 100644 --- a/ElectronicObserver/Resource/Record/RecordBase.cs +++ b/ElectronicObserver/Resource/Record/RecordBase.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Forms; namespace ElectronicObserver.Resource.Record { @@ -47,12 +48,40 @@ public virtual bool Load(string path) ClearRecord(); + bool ignoreError = false; + string line; sr.ReadLine(); //ヘッダを読み飛ばす while ((line = sr.ReadLine()) != null) { - LoadLine(line); + try + { + LoadLine(line); + + } + catch (Exception ex) + { + if (ignoreError) + continue; + + Utility.ErrorReporter.SendErrorReport(ex, $"レコード {Path.GetFileName(path)} の破損を検出しました。"); + + switch (MessageBox.Show($"レコード {Path.GetFileName(path)} で破損データを検出しました。\r\n\r\n[中止]: 読み込みを中止します。\r\n[再試行]: 読み込みを続行します。(再び破損がみられた場合は再確認します)\r\n[無視]: 読み込みを続行します。(再確認しません。重くなる場合があります)", + "レコード破損検出", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)) + { + case DialogResult.Abort: + throw; + + case DialogResult.Retry: + // do nothing + break; + + case DialogResult.Ignore: + ignoreError = true; + break; + } + } } } diff --git a/ElectronicObserver/Utility/Data/Calculator.cs b/ElectronicObserver/Utility/Data/Calculator.cs index 72916ec46..e5de79f18 100644 --- a/ElectronicObserver/Utility/Data/Calculator.cs +++ b/ElectronicObserver/Utility/Data/Calculator.cs @@ -647,6 +647,10 @@ public static int GetTPDamage(FleetData fleet) case ShipTypes.FleetOiler: tp += 15; break; + + case ShipTypes.SubmarineAircraftCarrier: + tp += 1; + break; } } diff --git a/ElectronicObserver/Utility/SoftwareInformation.cs b/ElectronicObserver/Utility/SoftwareInformation.cs index aa8549fa1..47cde5ac3 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 => "4.6.7"; + public static string VersionEnglish => "4.6.8"; /// /// 更新日時 /// - public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2021/05/04 22:30:00"); + public static DateTime UpdateTime => DateTimeHelper.CSVStringToTime("2021/06/05 19:30:00"); diff --git a/ElectronicObserver/Window/FormInformation.cs b/ElectronicObserver/Window/FormInformation.cs index d262a7479..78b8ddbfe 100644 --- a/ElectronicObserver/Window/FormInformation.cs +++ b/ElectronicObserver/Window/FormInformation.cs @@ -512,14 +512,20 @@ private void CheckExpedition(int missionID, int fleetID) { var fleet = KCDatabase.Instance.Fleet[fleetID]; var result = MissionClearCondition.Check(missionID, fleet); + var mission = KCDatabase.Instance.Mission[missionID]; if (!result.IsSuceeded) { - var mission = KCDatabase.Instance.Mission[missionID]; MessageBox.Show( $"#{fleet.FleetID} {fleet.Name} の遠征 {mission.DisplayID}:{mission.Name} は、失敗する可能性があります。\r\n\r\n{string.Join("\r\n", result.FailureReason)}\r\n\r\n(この警告は 設定→動作 から無効化できます。)", "遠征失敗警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); } + if (fleet.MembersInstance.Any(s => s?.FuelRate < 1 || s?.AmmoRate < 1)) + { + MessageBox.Show( + $"#{fleet.FleetID} {fleet.Name} の遠征 {mission.DisplayID}:{mission.Name} は、失敗する可能性があります。\r\n\r\n未補給\r\n\r\n(この警告は 設定→動作 から無効化できます。)", + "遠征失敗警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } } diff --git a/ElectronicObserver/Window/FormShipGroup.cs b/ElectronicObserver/Window/FormShipGroup.cs index 15d1a46ac..4fce88950 100644 --- a/ElectronicObserver/Window/FormShipGroup.cs +++ b/ElectronicObserver/Window/FormShipGroup.cs @@ -1404,9 +1404,9 @@ private void MenuMember_Exclude_Click(object sender, EventArgs e) - private static readonly string ShipCSVHeaderUser = "固有ID,艦種,艦名,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,入渠,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力"; + private static readonly string ShipCSVHeaderUser = "固有ID,艦種,艦名,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,入渠,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,母港ソートID,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力"; - private static readonly string ShipCSVHeaderData = "固有ID,艦種,艦名,艦船ID,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,装備ID1,装備ID2,装備ID3,装備ID4,装備ID5,補強装備ID,艦載機1,艦載機2,艦載機3,艦載機4,艦載機5,入渠,入渠燃料,入渠鋼材,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力"; + private static readonly string ShipCSVHeaderData = "固有ID,艦種,艦名,艦船ID,Lv,Exp,next,改装まで,耐久現在,耐久最大,Cond,燃料,弾薬,装備1,装備2,装備3,装備4,装備5,補強装備,装備ID1,装備ID2,装備ID3,装備ID4,装備ID5,補強装備ID,艦載機1,艦載機2,艦載機3,艦載機4,艦載機5,入渠,入渠燃料,入渠鋼材,火力,火力改修,火力合計,雷装,雷装改修,雷装合計,対空,対空改修,対空合計,装甲,装甲改修,装甲合計,対潜,対潜合計,回避,回避合計,索敵,索敵合計,運,運改修,運合計,射程,速力,ロック,出撃先,母港ソートID,航空威力,砲撃威力,空撃威力,対潜威力,雷撃威力,夜戦威力"; private void MenuMember_CSVOutput_Click(object sender, EventArgs e) @@ -1499,6 +1499,7 @@ private void MenuMember_CSVOutput_Click(object sender, EventArgs e) Constants.GetSpeed(ship.Speed), ship.IsLocked ? "●" : ship.IsLockedByEquipment ? "■" : "-", ship.SallyArea, + ship.MasterShip.SortID, ship.AirBattlePower, ship.ShellingPower, ship.AircraftPower, @@ -1570,7 +1571,8 @@ private void MenuMember_CSVOutput_Click(object sender, EventArgs e) ship.Speed, ship.IsLocked ? 1 : ship.IsLockedByEquipment ? 2 : 0, ship.SallyArea, - ship.AirBattlePower, + ship.MasterShip.SortID, + ship.AirBattlePower, ship.ShellingPower, ship.AircraftPower, ship.AntiSubmarinePower,