diff --git a/ElectronicObserver/Data/Constants.cs b/ElectronicObserver/Data/Constants.cs index d37ab114e..4fbf1e4d8 100644 --- a/ElectronicObserver/Data/Constants.cs +++ b/ElectronicObserver/Data/Constants.cs @@ -1019,13 +1019,13 @@ public static string GetAACutinKind(int id) case 33: return "高角砲/機銃(非集中)"; case 34: - return "Fletcher砲改+GFCSx2"; + return "Fletcher砲改+GFCSx2"; case 35: - return "Fletcher砲改+GFCS/Fletcher砲改"; + return "Fletcher砲改+GFCS/Fletcher砲改"; case 36: - return "Fletcher砲改x2/GFCS"; + return "Fletcher砲改x2/GFCS"; case 37: - return "Fletcher砲改x2"; + return "Fletcher砲改x2"; case 38: return "Atlanta砲+GFCSx2"; case 39: diff --git a/ElectronicObserver/Data/EquipmentDataMaster.cs b/ElectronicObserver/Data/EquipmentDataMaster.cs index 678c8ede4..08c09198b 100644 --- a/ElectronicObserver/Data/EquipmentDataMaster.cs +++ b/ElectronicObserver/Data/EquipmentDataMaster.cs @@ -329,6 +329,9 @@ public bool IsAntiSubmarineAircraft /// 夜間攻撃機かどうか public bool IsNightAttacker => IconType == 46; + /// 夜間瑞雲かどうか + public bool IsNightZuiun => IconType == 51; + /// Swordfish 系艦上攻撃機かどうか public bool IsSwordfish => CategoryType == EquipmentTypes.CarrierBasedTorpedo && Name.Contains("Swordfish"); diff --git a/ElectronicObserver/Data/ShipData.cs b/ElectronicObserver/Data/ShipData.cs index cfd0aa783..5733b6675 100644 --- a/ElectronicObserver/Data/ShipData.cs +++ b/ElectronicObserver/Data/ShipData.cs @@ -1309,13 +1309,15 @@ private int CalculateNightBattlePower() case NightAttackKind.CutinTorpedoRadar: { double baseModifier = 1.3; - int typeDmod2 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 267); // 12.7cm連装砲D型改二 - int typeDmod3 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 366); // 12.7cm連装砲D型改三 - var modifierTable = new double[] { 1, 1.25, 1.4 }; - baseModifier *= modifierTable[Math.Min(typeDmod2 + typeDmod3, modifierTable.Length - 1)] * (1 + typeDmod3 * 0.05); - - basepower *= baseModifier; + basepower = CalcTorpedoRaderPicket(basepower, baseModifier); + //int typeDmod2 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 267); // 12.7cm連装砲D型改二 + //int typeDmod3 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 366); // 12.7cm連装砲D型改三 + //var modifierTable = new double[] { 1, 1.25, 1.4 }; + // + //baseModifier *= modifierTable[Math.Min(typeDmod2 + typeDmod3, modifierTable.Length - 1)] * (1 + typeDmod3 * 0.05); + // + //basepower *= baseModifier; } break; @@ -1323,14 +1325,16 @@ private int CalculateNightBattlePower() //魚見電 case NightAttackKind.CutinTorpedoPicket: { - double baseModifier = 1.25; // TODO: 処理の共通化 - int typeDmod2 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 267); // 12.7cm連装砲D型改二 - int typeDmod3 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 366); // 12.7cm連装砲D型改三 - var modifierTable = new double[] { 1, 1.25, 1.4 }; - - baseModifier *= modifierTable[Math.Min(typeDmod2 + typeDmod3, modifierTable.Length - 1)] * (1 + typeDmod3 * 0.05); - - basepower *= baseModifier; + double baseModifier = 1.25; + + basepower = CalcTorpedoRaderPicket(basepower, baseModifier); + //int typeDmod2 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 267); // 12.7cm連装砲D型改二 + //int typeDmod3 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 366); // 12.7cm連装砲D型改三 + //var modifierTable = new double[] { 1, 1.25, 1.4 }; + // + //baseModifier *= modifierTable[Math.Min(typeDmod2 + typeDmod3, modifierTable.Length - 1)] * (1 + typeDmod3 * 0.05); + // + //basepower *= baseModifier; } break; @@ -1347,6 +1351,38 @@ private int CalculateNightBattlePower() basepower *= 1.3; } break; + + //夜間瑞雲攻撃 + case NightAttackKind.SpecialNightZuiun: + { + double zuiunCountHosei = 0; + double raderHosei = 0; + + int nightZuiunCount = AllSlotInstanceMaster.Count(eq => eq?.IsNightZuiun ?? false); + int surfaceRaderCount = AllSlotInstanceMaster.Count(eq => eq?.IsSurfaceRadar ?? false); + + if (nightZuiunCount >= 2) + { + zuiunCountHosei += 0.12; + } + else if (nightZuiunCount >= 1) + { + zuiunCountHosei += 0.04; + } + else + { + //ここにきている時点で0はありえないのだが、一応… + zuiunCountHosei = 0; + } + + if(surfaceRaderCount >= 1) + { + raderHosei += 0.04; + } + + basepower *= (1.2 + zuiunCountHosei + raderHosei); + } + break; } basepower += GetLightCruiserDamageBonus() + GetItalianDamageBonus(); @@ -1357,10 +1393,36 @@ private int CalculateNightBattlePower() return (int)(basepower * GetAmmoDamageRate()); } - /// - /// 威力系の計算をまとめて行い、プロパティを更新します。 - /// - private void CalculatePowers() + /// + /// 主魚電/魚見電カットイン火力計算サブルーチン + /// + /// + /// + /// + private double CalcTorpedoRaderPicket(double basepower, double baseModifier) + { + int typeDmod2 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 267); // 12.7cm連装砲D型改二 + int typeDmod3 = AllSlotInstanceMaster.Count(eq => eq?.EquipmentID == 366); // 12.7cm連装砲D型改三 + var modifierTable = new double[] { 1, 1.25, 1.4 }; + + //[Note] + //D2もD3もないならmodifierTableの0番目(すなわち1)が選ばれるように計算している + Console.WriteLine("CalcTorpedoRaderPicket: {0}x{1}x{2}", + baseModifier, + modifierTable[Math.Min(typeDmod2 + typeDmod3, modifierTable.Length - 1)], + 1 + (typeDmod3 * 0.05) + ); + + //2023/02/28 D三2本積みでこれはどうかわるか? + // 単純に0.05+0.05ではなさそう + baseModifier *= modifierTable[Math.Min(typeDmod2 + typeDmod3, modifierTable.Length - 1)] * (1 + (typeDmod3 * 0.05)); + return basepower *= baseModifier; + } + + /// + /// 威力系の計算をまとめて行い、プロパティを更新します。 + /// + private void CalculatePowers() { int form = Utility.Configuration.Config.Control.PowerEngagementForm; diff --git a/ElectronicObserver/Data/ShipDataMaster.cs b/ElectronicObserver/Data/ShipDataMaster.cs index ee589f7b5..fab04f412 100644 --- a/ElectronicObserver/Data/ShipDataMaster.cs +++ b/ElectronicObserver/Data/ShipDataMaster.cs @@ -710,6 +710,18 @@ public int RemodelTier ShipID == 509 //熊野航改二 ); + /// + /// 夜間瑞雲攻撃が可能な艦種であるか + /// (航空戦艦/航空巡洋艦/軽巡洋艦/水上機母艦) + /// + public bool CanNightZuiunAttack => + ( + ShipType == ShipTypes.AviationBattleship || + ShipType == ShipTypes.AviationCruiser || + ShipType == ShipTypes.LightCruiser || + ShipType == ShipTypes.SeaplaneTender + ); + /// /// 自身のパラメータレコードを取得します。 /// diff --git a/ElectronicObserver/Utility/Data/Calculator.cs b/ElectronicObserver/Utility/Data/Calculator.cs index 247c56979..fdb85de67 100644 --- a/ElectronicObserver/Utility/Data/Calculator.cs +++ b/ElectronicObserver/Utility/Data/Calculator.cs @@ -990,6 +990,7 @@ public static NightAttackKind GetNightAttackKind(int[] slot, int attackerShipID, int picketCrewCount = 0; int masterPicketCrewCount = 0; int drumCount = 0; + int nightZuiunCount = 0; if (slot == null) return NightAttackKind.Unknown; @@ -1025,6 +1026,12 @@ public static NightAttackKind GetNightAttackKind(int[] slot, int attackerShipID, lateModelTorpedoCount++; break; + // 夜間瑞雲 + case EquipmentTypes.SeaplaneBomber: + if (eq.IsNightZuiun) + nightZuiunCount++; + break; + // 夜間戦闘機 case EquipmentTypes.CarrierBasedFighter: if (eq.IsNightFighter) @@ -1099,7 +1106,6 @@ public static NightAttackKind GetNightAttackKind(int[] slot, int attackerShipID, if (includeSpecialAttack) { - // 駆逐艦カットイン if (attacker?.ShipType == ShipTypes.Destroyer) { @@ -1124,6 +1130,12 @@ public static NightAttackKind GetNightAttackKind(int[] slot, int attackerShipID, if (torpedoCount >= 2 || (lateModelTorpedoCount >= 1 && submarineEquipmentCount >= 1)) return NightAttackKind.CutinTorpedoTorpedo; + //夜間瑞雲攻撃 + if (nightZuiunCount >= 1 && mainGunCount >= 2 && attacker.CanNightZuiunAttack) + { + return NightAttackKind.SpecialNightZuiun; + } + // 汎用カットイン else if (mainGunCount >= 3) return NightAttackKind.CutinMainMain; @@ -1219,6 +1231,8 @@ public static NightAttackKind GetNightAttackKind(int[] slot, int attackerShipID, return NightAttackKind.Torpedo; } } + + } return NightAttackKind.Shelling;