コミットメタ情報

リビジョン3617b14a96677d5cd3df53e998b8df3535e6f3c1 (tree)
日時2018-08-04 15:18:23
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

新編成「三川艦隊」、鉄底海峡に突入せよ!のカウンタを実装する

変更サマリ

差分

--- a/KancolleSniffer.Test/QuestInfoTest.cs
+++ b/KancolleSniffer.Test/QuestInfoTest.cs
@@ -882,6 +882,70 @@ namespace KancolleSniffer.Test
882882 }
883883
884884 /// <summary>
885+ /// 888: 新編成「三川艦隊」、鉄底海峡に突入せよ!
886+ /// </summary>
887+ [TestMethod]
888+ public void BattleResult_888()
889+ {
890+ var battleInfo = new BattleInfo(null, null);
891+ var questInfo = new QuestInfo(null, battleInfo, () => new DateTime(2015, 1, 1));
892+ questInfo.InspectQuestList(CreateQuestList(new[] {888}));
893+ var count = questInfo.Quests[0].Count;
894+
895+ battleInfo.InjectResultStatus(new[]
896+ {
897+ ShipStatus(5, 427), ShipStatus(5, 264), ShipStatus(5, 142),
898+ ShipStatus(5, 417), ShipStatus(2, 144), ShipStatus(2, 195)
899+ }, new ShipStatus[0], new ShipStatus[0], new ShipStatus[0]);
900+ questInfo.InspectMapNext(Js(new
901+ {
902+ api_maparea_id = 5,
903+ api_mapinfo_no = 1,
904+ api_event_id = 4
905+ }));
906+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
907+ questInfo.InspectMapNext(Js(new
908+ {
909+ api_maparea_id = 5,
910+ api_mapinfo_no = 1,
911+ api_event_id = 5
912+ }));
913+ questInfo.InspectBattleResult(Js(new {api_win_rank = "A"}));
914+ PAssert.That(() => count.NowArray[0] == 0);
915+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
916+ PAssert.That(() => count.NowArray[0] == 1);
917+
918+ battleInfo.Result.Friend.Main[0].NowHp = 0;
919+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
920+ PAssert.That(() => count.NowArray[0] == 1, "轟沈あり");
921+ battleInfo.Result.Friend.Main[0].NowHp = 1;
922+
923+ battleInfo.Result.Friend.Main[0].Spec.Id = 319;
924+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
925+ PAssert.That(() => count.NowArray[0] == 1, "三川艦隊3隻");
926+ battleInfo.Result.Friend.Main[0].Spec.Id = 427;
927+
928+ questInfo.InspectMapNext(Js(new
929+ {
930+ api_maparea_id = 5,
931+ api_mapinfo_no = 3,
932+ api_event_id = 5,
933+ }));
934+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
935+ PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 0}));
936+
937+ questInfo.InspectMapNext(Js(new
938+ {
939+ api_maparea_id = 5,
940+ api_mapinfo_no = 4,
941+ api_event_id = 5,
942+ }));
943+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
944+ PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 1}));
945+ }
946+
947+
948+ /// <summary>
885949 /// 302: 大規模演習
886950 /// 303: 「演習」で練度向上!
887951 /// 304: 「演習」で他提督を圧倒せよ!
@@ -1175,7 +1239,8 @@ namespace KancolleSniffer.Test
11751239 new QuestCount {Id = 854, NowArray = new[] {2, 1, 1, 1}},
11761240 new QuestCount {Id = 426, NowArray = new[] {1, 1, 1, 1}},
11771241 new QuestCount {Id = 428, NowArray = new[] {1, 1, 1}},
1178- new QuestCount {Id = 873, NowArray = new[] {1, 1, 1}}
1242+ new QuestCount {Id = 873, NowArray = new[] {1, 1, 1}},
1243+ new QuestCount {Id= 888, NowArray = new []{1, 1, 1}}
11791244 }
11801245 };
11811246 questInfo.LoadState(status);
@@ -1196,6 +1261,9 @@ namespace KancolleSniffer.Test
11961261 var q873 = status.QuestCountList[5];
11971262 PAssert.That(() => q873.ToString() == "3/3");
11981263 PAssert.That(() => q873.ToToolTip() == "3-1 3-2 3-3");
1264+ var q888 = status.QuestCountList[6];
1265+ PAssert.That(() => q888.ToString() == "3/3");
1266+ PAssert.That(() => q888.ToToolTip() == "5-1 5-3 5-4");
11991267 }
12001268
12011269 /// <summary>
--- a/KancolleSniffer/Model/QuestInfo.cs
+++ b/KancolleSniffer/Model/QuestInfo.cs
@@ -195,7 +195,7 @@ namespace KancolleSniffer.Model
195195
196196 public override string ToString()
197197 {
198- if (Id == 426 || Id == 854 || Id == 873)
198+ if (Id == 426 || Id == 854 || Id == 873 || Id == 888)
199199 return $"{NowArray.Count(n => n >= 1)}/{Spec.MaxArray.Length}";
200200 return NowArray != null
201201 ? string.Join(" ", NowArray.Zip(Spec.MaxArray, (n, m) => $"{n}/{m}"))
@@ -223,6 +223,10 @@ namespace KancolleSniffer.Model
223223 return string.Join(" ",
224224 new[] {"3-1", "3-2", "3-3"}.Zip(NowArray, (map, n) => n >= 1 ? map : "")
225225 .Where(s => !string.IsNullOrEmpty(s)));
226+ case 888:
227+ return string.Join(" ",
228+ new[] {"5-1", "5-3", "5-4"}.Zip(NowArray, (map, n) => n >= 1 ? map : "")
229+ .Where(s => !string.IsNullOrEmpty(s)));
226230 }
227231 return "";
228232 }
@@ -277,6 +281,7 @@ namespace KancolleSniffer.Model
277281 {862, new QuestSpec {Interval = Quarterly, Max = 2, Material = new[] {0, 0, 8, 4}}}, // 862: 前線の航空偵察を実施せよ!
278282 {873, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 873: 北方海域警備を実施せよ!
279283 {875, new QuestSpec {Interval = Quarterly, Max = 2, Material = new[] {0, 0, 0, 0}}}, // 875: 精鋭「三一駆」、鉄底海域に突入せよ!
284+ {888, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 888: 新編成「三川艦隊」、鉄底海峡に突入せよ!
280285
281286 {303, new QuestPractice {Interval = Daily, Max = 3, Win = false, Material = new[] {1, 0, 0, 0}}}, // 303: 「演習」で練度向上!
282287 {304, new QuestPractice {Interval = Daily, Max = 5, Win = true, Material = new[] {0, 0, 1, 0}}}, // 304: 「演習」で他提督を圧倒せよ!
@@ -708,6 +713,40 @@ namespace KancolleSniffer.Model
708713 IncrementCount(q875.Count);
709714 }
710715 }
716+ if (_quests.TryGetValue(888, out var q888))
717+ {
718+ if (!_boss || QuestSortie.CompareRank(rank, "S") != 0)
719+ return;
720+ var fleet = from ship in _battleInfo.Result.Friend.Main where ship.NowHp > 0 select ship.Spec.Id;
721+ var member = new[]
722+ {
723+ 69, 272, 427, // 鳥海
724+ 61, 264, // 青葉
725+ 123, 295, 142, // 衣笠
726+ 59, 262, 416, // 古鷹
727+ 60, 263, 417, // 加古
728+ 51, 213, 477, // 天龍
729+ 115, 293 // 夕張
730+ };
731+ if (fleet.Intersect(member).Count() < 4)
732+ return;
733+ var array = q888.Count.NowArray;
734+ switch (_map)
735+ {
736+ case 51:
737+ array[0]++;
738+ NeedSave = true;
739+ break;
740+ case 53:
741+ array[1]++;
742+ NeedSave = true;
743+ break;
744+ case 54:
745+ array[2]++;
746+ NeedSave = true;
747+ break;
748+ }
749+ }
711750 }
712751
713752 private int _questFleet;
旧リポジトリブラウザで表示