コミットメタ情報

リビジョン0aa89b1c8e58b985b4e1e5594ddca582ed399dd8 (tree)
日時2018-12-09 19:54:27
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

空母戦力の投入による兵站線戦闘哨戒のカウンタを実装する

変更サマリ

差分

--- a/KancolleSniffer.Test/QuestInfoTest.cs
+++ b/KancolleSniffer.Test/QuestInfoTest.cs
@@ -996,6 +996,75 @@ namespace KancolleSniffer.Test
996996 }
997997
998998 /// <summary>
999+ /// 894: 空母戦力の投入による兵站線戦闘哨戒
1000+ /// </summary>
1001+ [TestMethod]
1002+ public void BattleResult_894()
1003+ {
1004+ var battleInfo = new BattleInfo(null, null);
1005+ var questInfo = new QuestInfo(null, battleInfo, () => new DateTime(2015, 1, 1));
1006+ questInfo.InspectQuestList(CreateQuestList(new[] {894}));
1007+ var count = questInfo.Quests[0].Count;
1008+ battleInfo.InjectResultStatus(new[]
1009+ {
1010+ ShipStatus(2), ShipStatus(2), ShipStatus(2),
1011+ ShipStatus(2), ShipStatus(2), ShipStatus(2)
1012+ }, new ShipStatus[0], new ShipStatus[0], new ShipStatus[0]);
1013+
1014+ questInfo.InspectMapNext(Js(new
1015+ {
1016+ api_maparea_id = 1,
1017+ api_mapinfo_no = 3,
1018+ api_event_id = 5
1019+ }));
1020+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
1021+ PAssert.That(() => count.NowArray[0] == 0, "空母なしはカウントしない");
1022+
1023+ battleInfo.Result.Friend.Main[0].Spec.ShipType = 7;
1024+ questInfo.InspectBattleResult(Js(new {api_win_rank = "A"}));
1025+ PAssert.That(() => count.NowArray[0] == 0, "A勝利はカウントしない");
1026+
1027+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
1028+ PAssert.That(() => count.NowArray[0] == 1, "1-3");
1029+
1030+ questInfo.InspectMapNext(Js(new
1031+ {
1032+ api_maparea_id = 1,
1033+ api_mapinfo_no = 4,
1034+ api_event_id = 5
1035+ }));
1036+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
1037+ PAssert.That(() => count.NowArray[1] == 1, "1-4");
1038+
1039+ questInfo.InspectMapNext(Js(new
1040+ {
1041+ api_maparea_id = 2,
1042+ api_mapinfo_no = 1,
1043+ api_event_id = 5
1044+ }));
1045+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
1046+ PAssert.That(() => count.NowArray[2] == 1, "2-1");
1047+
1048+ questInfo.InspectMapNext(Js(new
1049+ {
1050+ api_maparea_id = 2,
1051+ api_mapinfo_no = 2,
1052+ api_event_id = 5
1053+ }));
1054+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
1055+ PAssert.That(() => count.NowArray[3] == 1, "2-2");
1056+
1057+ questInfo.InspectMapNext(Js(new
1058+ {
1059+ api_maparea_id = 2,
1060+ api_mapinfo_no = 3,
1061+ api_event_id = 5
1062+ }));
1063+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
1064+ PAssert.That(() => count.NowArray[4] == 1, "2-3");
1065+ }
1066+
1067+ /// <summary>
9991068 /// 302: 大規模演習
10001069 /// 303: 「演習」で練度向上!
10011070 /// 304: 「演習」で他提督を圧倒せよ!
@@ -1293,9 +1362,10 @@ namespace KancolleSniffer.Test
12931362 new QuestCount {Id = 426, NowArray = new[] {1, 1, 1, 1}},
12941363 new QuestCount {Id = 428, NowArray = new[] {1, 1, 1}},
12951364 new QuestCount {Id = 873, NowArray = new[] {1, 1, 1}},
1296- new QuestCount {Id= 888, NowArray = new []{1, 1, 1}},
1365+ new QuestCount {Id = 888, NowArray = new[] {1, 1, 1}},
12971366 new QuestCount {Id = 688, NowArray = new[] {2, 1, 2, 1}},
1298- new QuestCount {Id = 893, NowArray = new[] {1, 1, 1, 1}}
1367+ new QuestCount {Id = 893, NowArray = new[] {1, 1, 1, 1}},
1368+ new QuestCount {Id = 894, NowArray = new[] {1, 1, 1, 1, 1}}
12991369 }
13001370 };
13011371 questInfo.LoadState(status);
@@ -1323,6 +1393,9 @@ namespace KancolleSniffer.Test
13231393 PAssert.That(() => q688.ToToolTip() == "艦戦2 艦爆1 艦攻2 水偵1");
13241394 var q893 = status.QuestCountList[8];
13251395 PAssert.That(() => q893.ToToolTip() == "1-5:1 7-1:1 7-2G:1 7-2M:1");
1396+ var q894 = status.QuestCountList[9];
1397+ PAssert.That(() => q894.ToString() == "5/5");
1398+ PAssert.That(() => q894.ToToolTip() == "1-3 1-4 2-1 2-2 2-3");
13261399 }
13271400
13281401 /// <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 || Id == 888)
198+ if (Id == 426 || Id == 854 || Id == 873 || Id == 888 || Id == 894)
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}"))
@@ -235,6 +235,10 @@ namespace KancolleSniffer.Model
235235 return string.Join(" ",
236236 new[] {"1-5", "7-1", "7-2G", "7-2M"}.Zip(NowArray, (map, n) => n >= 1 ? $"{map}:{n}" : "")
237237 .Where(s => !string.IsNullOrEmpty(s)));
238+ case 894:
239+ return string.Join(" ",
240+ new[] {"1-3", "1-4", "2-1", "2-2", "2-3"}.Zip(NowArray, (map, n) => n >= 1 ? map : "")
241+ .Where(s => !string.IsNullOrEmpty(s)));
238242 }
239243 return "";
240244 }
@@ -291,6 +295,7 @@ namespace KancolleSniffer.Model
291295 {875, new QuestSpec {Interval = Quarterly, Max = 2, Material = new[] {0, 0, 0, 0}}}, // 875: 精鋭「三一駆」、鉄底海域に突入せよ!
292296 {888, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 888: 新編成「三川艦隊」、鉄底海峡に突入せよ!
293297 {893, new QuestSpec {Interval = Quarterly, MaxArray = new[] {3, 3, 3, 3}, Material = new[] {0, 0, 0, 0}}}, // 893: 泊地周辺海域の安全確保を徹底せよ!
298+ {894, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 894: 空母戦力の投入による兵站線戦闘哨戒
294299
295300 {303, new QuestPractice {Interval = Daily, Max = 3, Win = false, Material = new[] {1, 0, 0, 0}}}, // 303: 「演習」で練度向上!
296301 {304, new QuestPractice {Interval = Daily, Max = 5, Win = true, Material = new[] {0, 0, 1, 0}}}, // 304: 「演習」で他提督を圧倒せよ!
@@ -812,6 +817,32 @@ namespace KancolleSniffer.Model
812817 break;
813818 }
814819 }
820+ if (_quests.TryGetValue(894, out var q894))
821+ {
822+ if (!_boss ||
823+ QuestSortie.CompareRank(rank, "S") != 0 ||
824+ !_battleInfo.Result.Friend.Main.Any(s => s.Spec.IsAircraftCarrier && s.NowHp > 0))
825+ return;
826+ var count = q894.Count;
827+ switch (_map)
828+ {
829+ case 13:
830+ IncrementNowArray(count, 0);
831+ break;
832+ case 14:
833+ IncrementNowArray(count, 1);
834+ break;
835+ case 21:
836+ IncrementNowArray(count, 2);
837+ break;
838+ case 22:
839+ IncrementNowArray(count, 3);
840+ break;
841+ case 23:
842+ IncrementNowArray(count, 4);
843+ break;
844+ }
845+ }
815846 }
816847
817848 private int _questFleet;
@@ -928,6 +959,12 @@ namespace KancolleSniffer.Model
928959 }
929960 }
930961
962+ private void IncrementNowArray(QuestCount count, int n)
963+ {
964+ count.NowArray[n]++;
965+ NeedSave = true;
966+ }
967+
931968 public void CountNyukyo() => IncrementCount(503);
932969
933970 public void CountCharge() => IncrementCount(504);
旧リポジトリブラウザで表示