Assert.AreEqual("83.8", ship.EffectiveAntiSubmarine.ToString("f1"), "三種コンビネーションにならない");\r
}\r
}\r
+\r
+ // ReSharper disable once InconsistentNaming\r
+ private static readonly ItemStatus A12cm30連装噴進砲改二 = new ItemStatus\r
+ {\r
+ Id = 1,\r
+ Spec = new ItemSpec\r
+ {\r
+ Id = 274,\r
+ Type = 21,\r
+ IconType = 15,\r
+ AntiAir = 8\r
+ }\r
+ };\r
+\r
+ // ReSharper disable once InconsistentNaming\r
+ private static readonly ItemStatus A25mm三連装機銃集中配備 = new ItemStatus\r
+ {\r
+ Id = 1,\r
+ Spec = new ItemSpec{\r
+ Id = 131,\r
+ Type = 21,\r
+ IconType = 15,\r
+ AntiAir = 9\r
+ }\r
+ };\r
+\r
+ [TestClass]\r
+ public class AntiAirPropellantBarrageChance\r
+ {\r
+ private ShipStatus _ship;\r
+\r
+ [TestInitialize]\r
+ public void Initialize()\r
+ {\r
+ _ship =new ShipStatus\r
+ {\r
+ AntiAir = 93,\r
+ Lucky = 46,\r
+ Spec = new ShipSpec\r
+ {\r
+ ShipType = 4,\r
+ },\r
+ Slot = new ItemStatus[0]\r
+ };\r
+ }\r
+\r
+ [TestMethod]\r
+ public void 噴進砲改二なし()\r
+ {\r
+ Assert.AreEqual(0, _ship.AntiAirPropellantBarrageChance);\r
+ }\r
+\r
+ [TestMethod]\r
+ public void 噴進砲改二1つ()\r
+ {\r
+ _ship.AntiAir = 85 + 8;\r
+ _ship.Slot = new[]\r
+ {\r
+ A12cm30連装噴進砲改二\r
+ };\r
+ Assert.AreEqual("63.1", _ship.AntiAirPropellantBarrageChance.ToString("f1"));\r
+ }\r
+\r
+ [TestMethod]\r
+ public void 噴進砲改二2つ()\r
+ {\r
+ _ship.AntiAir = 85 + 16;\r
+ _ship.Slot = new[]\r
+ {\r
+ A12cm30連装噴進砲改二,\r
+ A12cm30連装噴進砲改二\r
+ };\r
+ Assert.AreEqual("95.1", _ship.AntiAirPropellantBarrageChance.ToString("f1"));\r
+ }\r
+\r
+ [TestMethod]\r
+ public void 噴進砲改二2つと機銃()\r
+ {\r
+ _ship.AntiAir = 85 + 25;\r
+ _ship.Slot = new[]\r
+ {\r
+ A12cm30連装噴進砲改二,\r
+ A12cm30連装噴進砲改二,\r
+ A25mm三連装機銃集中配備\r
+ };\r
+ Assert.AreEqual("114.3", _ship.AntiAirPropellantBarrageChance.ToString("f1"), "噴進砲改二2+機銃");\r
+ }\r
+\r
+ [TestMethod]\r
+ public void 伊勢型()\r
+ {\r
+ _ship.AntiAir = 85 + 8;\r
+ _ship.Slot = new[]\r
+ {\r
+ A12cm30連装噴進砲改二\r
+ };\r
+ _ship.Spec.ShipClass = 2;\r
+ Assert.AreEqual("88.1", _ship.AntiAirPropellantBarrageChance.ToString("f1"));\r
+ }\r
+ }\r
}\r
}
\ No newline at end of file
\r
public int EffectiveAntiAirForFleet => (int)AllSlot.Sum(item => item.EffectiveAntiAirForFleet);\r
\r
+ public double AntiAirPropellantBarrageChance\r
+ {\r
+ get\r
+ {\r
+ var launcherCount = Slot.Count(item => item.Spec.Id == 274);\r
+ if (launcherCount == 0)\r
+ return 0;\r
+ var iseClass = Spec.ShipClass == 2;\r
+ var baseChance = (EffectiveAntiAirForShip + Lucky) / 282.0;\r
+ return (baseChance + 0.15 * (launcherCount - 1) + (iseClass ? 0.25 : 0)) * 100;\r
+ }\r
+ }\r
+\r
public int EffectiveFuelMax => Max((int)(Spec.FuelMax * (Level >= 100 ? 0.85 : 1.0)), 1);\r
\r
public int EffectiveBullMax => Max((int)(Spec.BullMax * (Level >= 100 ? 0.85 : 1.0)), 1);\r