コミットメタ情報

リビジョン4c149af1d1435ec5dd97216c21e575bc6bdfd25c (tree)
日時2018-12-09 19:24:37
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

泊地周辺海域の安全確保を徹底せよ!のカウンタを実装する

変更サマリ

差分

--- a/KancolleSniffer.Test/QuestInfoTest.cs
+++ b/KancolleSniffer.Test/QuestInfoTest.cs
@@ -944,6 +944,56 @@ namespace KancolleSniffer.Test
944944 PAssert.That(() => count.NowArray.SequenceEqual(new[] {1, 1, 1}));
945945 }
946946
947+ /// <summary>
948+ /// 893: 泊地周辺海域の安全確保を徹底せよ!
949+ /// </summary>
950+ [TestMethod]
951+ public void BattleResult_893()
952+ {
953+ var questInfo = new QuestInfo(null, null, () => new DateTime(2015, 1, 1));
954+ questInfo.InspectQuestList(CreateQuestList(new[] {893}));
955+ var count = questInfo.Quests[0].Count;
956+
957+ questInfo.InspectMapNext(Js(new
958+ {
959+ api_maparea_id = 1,
960+ api_mapinfo_no = 5,
961+ api_event_id = 5
962+ }));
963+ questInfo.InspectBattleResult(Js(new {api_win_rank = "A"}));
964+ PAssert.That(() => count.NowArray[0] == 0, "A勝利はカウントしない");
965+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
966+ PAssert.That(() => count.NowArray[0] == 1, "1-5");
967+
968+ questInfo.InspectMapNext(Js(new
969+ {
970+ api_maparea_id = 7,
971+ api_mapinfo_no = 1,
972+ api_event_id = 5
973+ }));
974+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
975+ PAssert.That(() => count.NowArray[1] == 1, "7-1");
976+
977+ questInfo.InspectMapNext(Js(new
978+ {
979+ api_maparea_id = 7,
980+ api_mapinfo_no = 2,
981+ api_no = 9,
982+ api_event_id = 4
983+ }));
984+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
985+ PAssert.That(() => count.NowArray[2] == 1, "7-2G");
986+
987+ questInfo.InspectMapNext(Js(new
988+ {
989+ api_maparea_id = 7,
990+ api_mapinfo_no = 2,
991+ api_no = 15,
992+ api_event_id = 5
993+ }));
994+ questInfo.InspectBattleResult(Js(new {api_win_rank = "S"}));
995+ PAssert.That(() => count.NowArray[3] == 1, "7-2M");
996+ }
947997
948998 /// <summary>
949999 /// 302: 大規模演習
@@ -1245,7 +1295,8 @@ namespace KancolleSniffer.Test
12451295 new QuestCount {Id = 428, NowArray = new[] {1, 1, 1}},
12461296 new QuestCount {Id = 873, NowArray = new[] {1, 1, 1}},
12471297 new QuestCount {Id= 888, NowArray = new []{1, 1, 1}},
1248- new QuestCount {Id = 688, NowArray = new[] {2, 1, 2, 1}}
1298+ new QuestCount {Id = 688, NowArray = new[] {2, 1, 2, 1}},
1299+ new QuestCount {Id = 893, NowArray = new[] {1, 1, 1, 1}}
12491300 }
12501301 };
12511302 questInfo.LoadState(status);
@@ -1271,6 +1322,8 @@ namespace KancolleSniffer.Test
12711322 PAssert.That(() => q888.ToToolTip() == "5-1 5-3 5-4");
12721323 var q688 = status.QuestCountList[7];
12731324 PAssert.That(() => q688.ToToolTip() == "艦戦2 艦爆1 艦攻2 水偵1");
1325+ var q893 = status.QuestCountList[8];
1326+ PAssert.That(() => q893.ToToolTip() == "1-5:1 7-1:1 7-2G:1 7-2M:1");
12741327 }
12751328
12761329 /// <summary>
--- a/KancolleSniffer/Model/QuestInfo.cs
+++ b/KancolleSniffer/Model/QuestInfo.cs
@@ -231,6 +231,10 @@ namespace KancolleSniffer.Model
231231 return string.Join(" ",
232232 new[] {"艦戦", "艦爆", "艦攻", "水偵"}.Zip(NowArray, (type, n) => n >= 1 ? type + n : "")
233233 .Where(s => !string.IsNullOrEmpty(s)));
234+ case 893:
235+ return string.Join(" ",
236+ new[] {"1-5", "7-1", "7-2G", "7-2M"}.Zip(NowArray, (map, n) => n >= 1 ? $"{map}:{n}" : "")
237+ .Where(s => !string.IsNullOrEmpty(s)));
234238 }
235239 return "";
236240 }
@@ -286,6 +290,7 @@ namespace KancolleSniffer.Model
286290 {873, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 873: 北方海域警備を実施せよ!
287291 {875, new QuestSpec {Interval = Quarterly, Max = 2, Material = new[] {0, 0, 0, 0}}}, // 875: 精鋭「三一駆」、鉄底海域に突入せよ!
288292 {888, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 888: 新編成「三川艦隊」、鉄底海峡に突入せよ!
293+ {893, new QuestSpec {Interval = Quarterly, MaxArray = new[] {3, 3, 3, 3}, Material = new[] {0, 0, 0, 0}}}, // 893: 泊地周辺海域の安全確保を徹底せよ!
289294
290295 {303, new QuestPractice {Interval = Daily, Max = 3, Win = false, Material = new[] {1, 0, 0, 0}}}, // 303: 「演習」で練度向上!
291296 {304, new QuestPractice {Interval = Daily, Max = 5, Win = true, Material = new[] {0, 0, 1, 0}}}, // 304: 「演習」で他提督を圧倒せよ!
@@ -553,6 +558,7 @@ namespace KancolleSniffer.Model
553558 }
554559
555560 private int _map;
561+ private int _cell;
556562 private bool _boss;
557563
558564 public void InspectMapStart(dynamic json)
@@ -565,6 +571,7 @@ namespace KancolleSniffer.Model
565571 public void InspectMapNext(dynamic json)
566572 {
567573 _map = (int)json.api_maparea_id * 10 + (int)json.api_mapinfo_no;
574+ _cell = json.api_no() ? (int)json.api_no : 0;
568575 _boss = (int)json.api_event_id == 5;
569576
570577 if (_quests.TryGetValue(861, out var q861))
@@ -775,6 +782,36 @@ namespace KancolleSniffer.Model
775782 break;
776783 }
777784 }
785+ if (_quests.TryGetValue(893, out var q893))
786+ {
787+ if (QuestSortie.CompareRank(rank, "S") != 0)
788+ return;
789+ var array = q893.Count.NowArray;
790+ if (!_boss)
791+ {
792+ if (_map == 72 && _cell == 9)
793+ {
794+ array[2]++;
795+ NeedSave = true;
796+ }
797+ return;
798+ }
799+ switch (_map)
800+ {
801+ case 15:
802+ array[0]++;
803+ NeedSave = true;
804+ break;
805+ case 71:
806+ array[1]++;
807+ NeedSave = true;
808+ break;
809+ case 72:
810+ array[3]++;
811+ NeedSave = true;
812+ break;
813+ }
814+ }
778815 }
779816
780817 private int _questFleet;
旧リポジトリブラウザで表示