コミットメタ情報

リビジョンe916c10b688c50a5d3eb401635d0179dfc9b45f5 (tree)
日時2018-03-23 22:43:14
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

「伊良湖の支援」と「主力艦上戦闘機の更新」のカウンタを実装する

変更サマリ

差分

--- a/KancolleSniffer.Test/QuestInfoTest.cs
+++ b/KancolleSniffer.Test/QuestInfoTest.cs
@@ -804,13 +804,19 @@ namespace KancolleSniffer.Test
804804 /// 303: 「演習」で練度向上!
805805 /// 304: 「演習」で他提督を圧倒せよ!
806806 /// 311: 精鋭艦隊演習
807+ /// 318: 給糧艦「伊良湖」の支援
807808 /// </summary>
808809 [TestMethod]
809- public void PracticeResult_303_304_302_311()
810+ public void PracticeResult_303_304_302_311_318()
810811 {
811- var questInfo = new QuestInfo(null, null, () => new DateTime(2015, 1, 1));
812- questInfo.InspectQuestList(CreateQuestList(new[] {302, 303, 304, 311}));
812+ var battleInfo = new BattleInfo(null, null);
813+ var questInfo = new QuestInfo(null, battleInfo, () => new DateTime(2015, 1, 1));
814+ questInfo.InspectQuestList(CreateQuestList(new[] {302, 303, 304, 311, 318}));
813815
816+ battleInfo.InjectResultStatus(new[]
817+ {
818+ ShipStatus(2, 543), ShipStatus(3, 488)
819+ }, new ShipStatus[0], new ShipStatus[0], new ShipStatus[0]);
814820 questInfo.InspectPracticeResult(Js(new {api_win_rank = "C"}));
815821 questInfo.InspectPracticeResult(Js(new {api_win_rank = "A"}));
816822 PAssert.That(() =>
@@ -818,8 +824,15 @@ namespace KancolleSniffer.Test
818824 .SequenceEqual(new[]
819825 {
820826 new {Id = 302, Now = 1}, new {Id = 303, Now = 2}, new {Id = 304, Now = 1},
821- new {Id = 311, Now = 1}
827+ new {Id = 311, Now = 1}, new {Id = 318, Now = 0}
822828 }));
829+ // 318
830+ battleInfo.Result.Friend.Main[0] = ShipStatus(3, 200);
831+ questInfo.InspectPracticeResult(Js(new {api_win_rank = "A"}));
832+ PAssert.That(() => questInfo.Quests[4].Count.Now == 1);
833+ questInfo.Quests[4].Count.Now = 3;
834+ questInfo.InspectQuestList(CreateQuestList(new[] {318}));
835+ PAssert.That(() => questInfo.Quests[4].Count.Now == 3, "進捗調節しない");
823836 }
824837
825838 /// <summary>
@@ -961,12 +974,13 @@ namespace KancolleSniffer.Test
961974 /// 675: 運用装備の統合整備
962975 /// 676: 装備開発力の集中整備
963976 /// 677: 継戦支援能力の整備
977+ /// 678: 主力艦上戦闘機の更新
964978 /// </summary>
965979 [TestMethod]
966- public void DestroyItem_613_638_663_673_674_675_676_677()
980+ public void DestroyItem_613_638_663_673_674_675_676_677_678()
967981 {
968982 var itemInfo = new ItemInfo();
969- var questInfo = new QuestInfo(itemInfo, null, () => new DateTime(2015, 1, 1)) {AcceptMax = 8};
983+ var questInfo = new QuestInfo(itemInfo, null, () => new DateTime(2015, 1, 1)) {AcceptMax = 9};
970984
971985 itemInfo.InjectItemSpec(new[]
972986 {
@@ -978,11 +992,13 @@ namespace KancolleSniffer.Test
978992 new ItemSpec {Id = 75, Name = "ドラム缶(輸送用)", Type = 30},
979993 new ItemSpec {Id = 7, Name = "35.6cm連装砲", Type = 3},
980994 new ItemSpec {Id = 25, Name = "零式水上偵察機", Type = 10},
981- new ItemSpec {Id = 13, Name = "61cm三連装魚雷", Type = 5}
995+ new ItemSpec {Id = 13, Name = "61cm三連装魚雷", Type = 5},
996+ new ItemSpec {Id = 20, Name = "零式艦戦21型", Type = 6}
982997 });
983- itemInfo.InjectItems(new[] {1, 37, 19, 4, 11, 75, 7, 25, 13});
984- questInfo.InspectQuestList(CreateQuestList(new[] {613, 638, 663, 673, 674, 675, 676, 677}));
985- questInfo.InspectDestroyItem("api%5Fslotitem%5Fids=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9&api%5Fverno=1", null);
998+ itemInfo.InjectItems(new[] {1, 37, 19, 4, 11, 75, 7, 25, 13, 20});
999+ questInfo.InspectQuestList(CreateQuestList(new[] {613, 638, 663, 673, 674, 675, 676, 677, 678}));
1000+ questInfo.InspectDestroyItem(
1001+ "api%5Fslotitem%5Fids=1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10&api%5Fverno=1", null);
9861002 PAssert.That(() =>
9871003 questInfo.Quests.Select(q => new {q.Id, q.Count.Now}).Take(5).SequenceEqual(new[]
9881004 {
@@ -990,11 +1006,13 @@ namespace KancolleSniffer.Test
9901006 new {Id = 673, Now = 1}, new {Id = 674, Now = 1}
9911007 }));
9921008 var q675 = questInfo.Quests[5];
993- PAssert.That(() => q675.Id == 675 && q675.Count.NowArray.SequenceEqual(new[] {1, 1}));
1009+ PAssert.That(() => q675.Id == 675 && q675.Count.NowArray.SequenceEqual(new[] {2, 1}));
9941010 var q676 = questInfo.Quests[6];
9951011 PAssert.That(() => q676.Id == 676 && q676.Count.NowArray.SequenceEqual(new[] {1, 1, 1}));
9961012 var q677 = questInfo.Quests[7];
9971013 PAssert.That(() => q677.Id == 677 && q677.Count.NowArray.SequenceEqual(new[] {1, 1, 1}));
1014+ var q678 = questInfo.Quests[8];
1015+ PAssert.That(() => q678.Id == 678 && q678.Count.NowArray.SequenceEqual(new[] {1, 1}));
9981016 }
9991017
10001018 /// <summary>
@@ -1016,7 +1034,7 @@ namespace KancolleSniffer.Test
10161034 public void NotImplemented()
10171035 {
10181036 var questInfo = new QuestInfo(null, null, () => new DateTime(2015, 1, 1));
1019- questInfo.InspectQuestList(CreateQuestList(new[] {318}));
1037+ questInfo.InspectQuestList(CreateQuestList(new[] {679}));
10201038 PAssert.That(() => questInfo.Quests[0].Count.Spec.Material.Length == 0);
10211039 }
10221040
@@ -1081,7 +1099,7 @@ namespace KancolleSniffer.Test
10811099 },
10821100 QuestCountList = new[]
10831101 {
1084- new QuestCount{Id = 854,NowArray = new []{1,0,1,0}}
1102+ new QuestCount {Id = 854, NowArray = new[] {1, 0, 1, 0}}
10851103 }
10861104 };
10871105 questInfo.LoadState(status);
--- a/KancolleSniffer/QuestInfo.cs
+++ b/KancolleSniffer/QuestInfo.cs
@@ -259,6 +259,7 @@ namespace KancolleSniffer
259259 {304, new QuestPractice {Interval = Daily, Max = 5, Win = true, Material = new[] {0, 0, 1, 0}}}, // 304: 「演習」で他提督を圧倒せよ!
260260 {302, new QuestPractice {Interval = Weekly, Max = 20, Win = true, Material = new[] {0, 0, 2, 1}}}, // 302: 大規模演習
261261 {311, new QuestPractice {Interval = Daily, Max = 7, Win = true, Material = new[] {0, 2, 0, 0}}}, // 311: 精鋭艦隊演習
262+ {318, new QuestSpec {Interval = Daily, Max = 3, Material = new[] {0, 2, 2, 0}, AdjustCount = false}}, // 318: 給糧艦「伊良湖」の支援
262263
263264 {402, new QuestMission {Interval = Daily, Max = 3, Material = new[] {0, 0, 1, 0}}}, // 402: 「遠征」を3回成功させよう!
264265 {403, new QuestMission {Interval = Daily, Max = 10, Material = new[] {0, 0, 0, 0}}}, // 403: 「遠征」を10回成功させよう!
@@ -287,6 +288,7 @@ namespace KancolleSniffer
287288 {675, new QuestSpec {Interval = Quarterly, MaxArray = new[] {6, 4}, Material = new[] {0, 0, 0, 0}}}, // 675: 運用装備の統合整備
288289 {676, new QuestSpec {Interval = Weekly, MaxArray = new[] {3, 3, 1}, Material = new[] {0, 1, 7, 0}}}, // 676: 装備開発力の集中整備
289290 {677, new QuestSpec {Interval = Weekly, MaxArray = new[] {4, 2, 3}, Material = new[] {0, 5, 0, 0}}}, // 677: 継戦支援能力の整備
291+ {678, new QuestSpec {Interval = Quarterly, MaxArray = new[] {3, 5}, Material = new[] {0, 0, 8, 0}}}, // 678: 主力艦上戦闘機の更新
290292
291293 {702, new QuestPowerup {Interval = Daily, Max = 2, Material = new[] {0, 1, 0, 0}}}, // 702: 艦の「近代化改修」を実施せよ!
292294 {703, new QuestPowerup {Interval = Weekly, Max = 15, Material = new[] {1, 0, 2, 0}}} // 703: 「近代化改修」を進め、戦備を整えよ!
@@ -668,6 +670,14 @@ namespace KancolleSniffer
668670 if (practice.Check(json.api_win_rank))
669671 IncrementCount(count);
670672 }
673+ if (_quests.TryGetValue(318, out var q318))
674+ {
675+ if (QuestSortie.CompareRank(json.api_win_rank, "B") <= 0 &&
676+ _battleInfo.Result.Friend.Main.Count(s => s.Spec.ShipType == 3) >= 2)
677+ {
678+ IncrementCount(q318.Count);
679+ }
680+ }
671681 }
672682
673683 private readonly int[] _missionId = new int[ShipInfo.FleetCount];
@@ -783,33 +793,39 @@ namespace KancolleSniffer
783793 {
784794 var values = HttpUtility.ParseQueryString(request);
785795 var items = values["api_slotitem_ids"].Split(',')
786- .Select(id => _itemInfo.GetStatus(int.Parse(id)).Spec.Type).ToArray();
796+ .Select(id => _itemInfo.GetStatus(int.Parse(id)).Spec).ToArray();
787797 IncrementCount(613); // 613: 資源の再利用
788798 foreach (var quest in _quests.Values)
789799 {
790800 var count = quest.Count;
791801 if (!(count.Spec is QuestDestroyItem destroy))
792802 continue;
793- AddCount(count, items.Count(destroy.Check));
803+ AddCount(count, items.Count(spec => destroy.Check(spec.Type)));
794804 }
795805 if (_quests.TryGetValue(675, out var q675))
796806 {
797- q675.Count.NowArray[0] += items.Count(id => id == 6);
798- q675.Count.NowArray[1] += items.Count(id => id == 21);
807+ q675.Count.NowArray[0] += items.Count(spec => spec.Type == 6);
808+ q675.Count.NowArray[1] += items.Count(spec => spec.Type == 21);
799809 NeedSave = true;
800810 }
801811 if (_quests.TryGetValue(676, out var q676))
802812 {
803- q676.Count.NowArray[0] += items.Count(id => id == 2);
804- q676.Count.NowArray[1] += items.Count(id => id == 4);
805- q676.Count.NowArray[2] += items.Count(id => id == 30);
813+ q676.Count.NowArray[0] += items.Count(spec => spec.Type == 2);
814+ q676.Count.NowArray[1] += items.Count(spec => spec.Type == 4);
815+ q676.Count.NowArray[2] += items.Count(spec => spec.Type == 30);
806816 NeedSave = true;
807817 }
808818 if (_quests.TryGetValue(677, out var q677))
809819 {
810- q677.Count.NowArray[0] += items.Count(id => id == 3);
811- q677.Count.NowArray[1] += items.Count(id => id == 10);
812- q677.Count.NowArray[2] += items.Count(id => id == 5);
820+ q677.Count.NowArray[0] += items.Count(spec => spec.Type == 3);
821+ q677.Count.NowArray[1] += items.Count(spec => spec.Type == 10);
822+ q677.Count.NowArray[2] += items.Count(spec => spec.Type == 5);
823+ NeedSave = true;
824+ }
825+ if (_quests.TryGetValue(678, out var q678))
826+ {
827+ q678.Count.NowArray[0] += items.Count(spec => spec.Id == 19);
828+ q678.Count.NowArray[1] += items.Count(spec => spec.Id == 20);
813829 NeedSave = true;
814830 }
815831 }
旧リポジトリブラウザで表示