OSDN Git Service

「海防艦」、海を護る!のカウンターを実装する
authorKazuhiro Fujieda <fujieda@users.osdn.me>
Wed, 4 Mar 2020 14:17:42 +0000 (23:17 +0900)
committerKazuhiro Fujieda <fujieda@users.osdn.me>
Wed, 4 Mar 2020 14:17:42 +0000 (23:17 +0900)
KancolleSniffer.Test/QuestCounterTest.cs
KancolleSniffer/Model/QuestCountList.cs
KancolleSniffer/Model/QuestCounter.cs

index 667c8c1..a4eed6a 100644 (file)
@@ -1085,6 +1085,53 @@ namespace KancolleSniffer.Test
         }\r
 \r
         /// <summary>\r
+        /// 905: 「海防艦」、海を護る!\r
+        /// </summary>\r
+        [TestMethod]\r
+        public void BattleResult_905()\r
+        {\r
+            var count = InjectQuest(905);\r
+            _battleInfo.InjectResultStatus(\r
+                ShipStatusList(1, 1, 1, 2, 2, 2),\r
+                new ShipStatus[0], new ShipStatus[0], new ShipStatus[0]);\r
+\r
+            InjectMapNext(11, 5);\r
+            InjectBattleResult("A");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {0, 0, 0, 0, 0}), "6隻はカウントしない");\r
+\r
+            _battleInfo.Result.Friend.Main[5] = new ShipStatus();\r
+            InjectBattleResult("B");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {0, 0, 0, 0, 0}), "B勝利はカウントしない");\r
+\r
+            InjectBattleResult("A");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 0, 0, 0, 0}), "1-1");\r
+\r
+            InjectMapNext(12, 4);\r
+            InjectBattleResult("A");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 0, 0, 0, 0}), "ボス以外はカウントしない");\r
+\r
+            InjectMapNext(12, 5);\r
+            InjectBattleResult("A");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 0, 0, 0}), "1-2");\r
+\r
+            _battleInfo.Result.Friend.Main[0] = ShipStatus(2);\r
+            InjectMapNext(13, 5);\r
+            InjectBattleResult("A");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 0, 0, 0}), "海防艦2隻はカウントしない");\r
+\r
+            _battleInfo.Result.Friend.Main[0] = ShipStatus(1);\r
+            InjectBattleResult("A");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 1, 0, 0}), "1-3");\r
+\r
+            InjectMapNext(15, 5);\r
+            InjectBattleResult("A");\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 1, 1, 0}), "1-5");\r
+\r
+            InjectMapNext(16, 8);\r
+            PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 1, 1, 1}), "1-6");\r
+        }\r
+\r
+        /// <summary>\r
         /// 280と854以降を同時に遂行していると854以降がカウントされないことがある\r
         /// </summary>\r
         [TestMethod]\r
index ea541e4..051f957 100644 (file)
@@ -73,6 +73,7 @@ namespace KancolleSniffer.Model
             {893, new QuestSortie {Interval = Quarterly, MaxArray = new[] {3, 3, 3, 3}, Rank = "S", Maps = new[] {15, 71, 721, 722}, Material = new[] {0, 0, 0, 0}}}, // 893: 泊地周辺海域の安全確保を徹底せよ!\r
             {894, new QuestSortie {Interval = Quarterly, MaxArray = new[] {1, 1, 1, 1, 1}, Rank = "S", Maps = new[] {13, 14, 21, 22, 23}, Material = new[] {0, 0, 0, 0}}}, // 894: 空母戦力の投入による兵站線戦闘哨戒\r
             {904, new QuestSortie {Interval = Yearly, MaxArray = new[] {1, 1, 1, 1}, Rank = "S", Maps = new[] {25, 34, 45, 53}, Material = new[] {0, 8, 10, 4}}}, // 904: 精鋭「十九駆」、躍り出る!\r
+            {905, new QuestSortie {Interval = Yearly, MaxArray = new[] {1, 1, 1, 1, 1}, Rank = "A", Maps = new[] {11, 12, 13, 15, 16}, Material = new[] {0, 6, 8, 0}}}, // 905: 「海防艦」、海を護る!\r
 \r
             {303, new QuestPractice {Interval = Daily, Max = 3, Rank = "E", Material = new[] {1, 0, 0, 0}}}, // 303: 「演習」で練度向上!\r
             {304, new QuestPractice {Interval = Daily, Max = 5, Rank = "B", Material = new[] {0, 0, 1, 0}}}, // 304: 「演習」で他提督を圧倒せよ!\r
index 2e59c8e..7067342 100644 (file)
@@ -323,6 +323,8 @@ namespace KancolleSniffer.Model
                     return specs.Names.Count("磯波", "浦波", "綾波", "敷波") == 4;\r
                 case 904:\r
                     return specs.Names.Count("綾波改二", "敷波改二") == 2;\r
+                case 905:\r
+                    return specs.Types.Count(type => type == 1) >= 3 && specs.Types.Length <= 5;\r
                 default:\r
                     return true;\r
             }\r