}\r
}\r
\r
+ public int RealAntiSubmarine\r
+ {\r
+ get\r
+ {\r
+ switch (Type)\r
+ {\r
+ case 1: // 小口径(12.7cm連装高角砲(後期型))\r
+ case 10: // 水偵\r
+ case 12: // 小型電探(22号対水上電探改四)\r
+ case 45: // 水戦\r
+ return 0;\r
+ default:\r
+ return AntiSubmarine;\r
+ }\r
+ }\r
+ }\r
+\r
public bool IsSonar => Type == 14 || // ソナー\r
Type == 40; // 大型ソナー\r
\r
public bool IsDepthCharge => Type == 15;\r
\r
- public bool HaveAntiSubmarine => Type != 10 && Type != 45 && AntiSubmarine > 0;\r
-\r
public bool IsRepairFacility => Type == 31;\r
\r
public double ContactTriggerRate => Type == 10 || Type == 9 ? 0.04 : 0;\r
return 0;\r
if (Spec.IsAircraftCarrier && RealFirepower == 0) // 砲撃戦に参加しない\r
return 0;\r
- var sonar = 0;\r
- var dc = 0;\r
- var aircraft = 0;\r
+ var sonar = false;\r
+ var dc = false;\r
+ var aircraft = false;\r
var all = 0;\r
var vanilla = AntiSubmarine;\r
foreach (var spec in Slot.Select(item => item.Spec))\r
{\r
vanilla -= spec.AntiSubmarine;\r
- if (!spec.HaveAntiSubmarine)\r
- continue;\r
if (spec.IsSonar)\r
- sonar += spec.AntiSubmarine;\r
+ sonar = true;\r
else if (spec.IsDepthCharge)\r
- dc += spec.AntiSubmarine;\r
+ dc = true;\r
else if (spec.IsAircraft)\r
- aircraft += spec.AntiSubmarine;\r
- all += spec.AntiSubmarine;\r
+ aircraft = true;\r
+ all += spec.RealAntiSubmarine;\r
}\r
- if (vanilla == 0 && aircraft == 0) // 素対潜0で航空機なしは対潜攻撃なし\r
+ if (vanilla == 0 && !aircraft) // 素対潜0で航空機なしは対潜攻撃なし\r
return 0;\r
- var bonus = sonar > 0 && dc > 0 ? 1.15 : 1.0;\r
- return (int)(bonus * (vanilla / 5 + all * 2 + (aircraft > 0 ? 10 : 25)));\r
+ var bonus = sonar && dc ? 1.15 : 1.0;\r
+ return (int)(bonus * (vanilla / 5 + all * 2 + (aircraft ? 10 : 25)));\r
}\r
}\r
\r