\r
public override string ToString()\r
{\r
- if (Id == 426 || Id == 854 || Id == 873 || Id == 888)\r
+ if (Id == 426 || Id == 854 || Id == 873 || Id == 888 || Id == 894)\r
return $"{NowArray.Count(n => n >= 1)}/{Spec.MaxArray.Length}";\r
return NowArray != null\r
? string.Join(" ", NowArray.Zip(Spec.MaxArray, (n, m) => $"{n}/{m}"))\r
return string.Join(" ",\r
new[] {"艦戦", "艦爆", "艦攻", "水偵"}.Zip(NowArray, (type, n) => n >= 1 ? type + n : "")\r
.Where(s => !string.IsNullOrEmpty(s)));\r
+ case 893:\r
+ return string.Join(" ",\r
+ new[] {"1-5", "7-1", "7-2G", "7-2M"}.Zip(NowArray, (map, n) => n >= 1 ? $"{map}:{n}" : "")\r
+ .Where(s => !string.IsNullOrEmpty(s)));\r
+ case 894:\r
+ return string.Join(" ",\r
+ new[] {"1-3", "1-4", "2-1", "2-2", "2-3"}.Zip(NowArray, (map, n) => n >= 1 ? map : "")\r
+ .Where(s => !string.IsNullOrEmpty(s)));\r
}\r
return "";\r
}\r
public bool Cleared => NowArray?.Zip(Spec.MaxArray, (n, m) => n >= m).All(x => x) ?? Spec.Max != 0 && Now >= Spec.Max;\r
}\r
\r
- // @formatter:off\r
- public class QuestCountList\r
- {\r
- private const QuestInterval Daily = QuestInterval.Daily;\r
- private const QuestInterval Weekly = QuestInterval.Weekly;\r
- private const QuestInterval Monthly = QuestInterval.Monthly;\r
- private const QuestInterval Quarterly = QuestInterval.Quarterly;\r
-\r
- /// <summary>\r
- /// このテーブルは七四式電子観測儀を参考に作成した。\r
- /// https://github.com/andanteyk/ElectronicObserver/blob/develop/ElectronicObserver/Data/Quest/QuestProgressManager.cs\r
- /// </summary>\r
- private static readonly Dictionary<int, QuestSpec> QuestSpecs = new Dictionary<int, QuestSpec>\r
- {\r
- {201, new QuestSortie {Interval = Daily, Max = 1, Rank = "B", Material = new[] {0, 0, 1, 0}}}, // 201: 敵艦隊を撃滅せよ!\r
- {216, new QuestSortie {Interval = Daily, Max = 1, Rank = "B", Material = new[] {0, 1, 1, 0}}}, // 216: 敵艦隊主力を撃滅せよ!\r
- {210, new QuestSortie {Interval = Daily, Max = 10, Material = new[] {0, 0, 1, 0}}}, // 210: 敵艦隊を10回邀撃せよ!\r
- {211, new QuestEnemyType {Interval = Daily, Max = 3, EnemyType = new[] {7, 11}, Material = new[] {0, 2, 0, 0}}}, // 211: 敵空母を3隻撃沈せよ!\r
- {212, new QuestEnemyType {Interval = Daily, Max = 5, EnemyType = new[] {15}, Material = new[] {0, 0, 2, 0}}}, // 212: 敵輸送船団を叩け!\r
- {218, new QuestEnemyType {Interval = Daily, Max = 3, EnemyType = new[] {15}, Material = new[] {0, 1, 1, 0}}}, // 218: 敵補給艦を3隻撃沈せよ!\r
- {226, new QuestSortie {Interval = Daily, Max = 5, Rank = "B", Maps = new[] {21, 22, 23, 24, 25}, Material = new[] {1, 1, 0, 0}}}, // 226: 南西諸島海域の制海権を握れ!\r
- {230, new QuestEnemyType {Interval = Daily, Max = 6, EnemyType = new[] {13}, Material = new[] {0, 1, 0, 0}}}, // 230: 敵潜水艦を制圧せよ!\r
-\r
- {213, new QuestEnemyType {Interval = Weekly, Max = 20, EnemyType = new[] {15}, Material = new[] {0, 0, 3, 0}}}, // 213: 海上通商破壊作戦\r
- {214, new QuestSpec {Interval = Weekly, MaxArray = new[] {36, 6, 24, 12}, Material = new[] {2, 0, 2, 0}}}, // 214: あ号作戦\r
- {220, new QuestEnemyType {Interval = Weekly, Max = 20, EnemyType = new[] {7, 11}, Material = new[] {0, 0, 2, 0}}}, // 220: い号作戦\r
- {221, new QuestEnemyType {Interval = Weekly, Max = 50, EnemyType = new[] {15}, Material = new[] {0, 3, 0, 0}}}, // 221: ろ号作戦\r
- {228, new QuestEnemyType {Interval = Weekly, Max = 15, EnemyType = new[] {13}, Material = new[] {0, 2, 0, 1}}}, // 228: 海上護衛戦\r
- {229, new QuestSortie {Interval = Weekly, Max = 12, Rank = "B", Maps = new[] {41, 42, 43, 44, 45}, Material = new[] {0, 0, 2, 0}}}, // 229: 敵東方艦隊を撃滅せよ!\r
- {241, new QuestSortie {Interval = Weekly, Max = 5, Rank = "B", Maps = new[] {33, 34, 35}, Material = new[] {0, 0, 3, 3}}}, // 241: 敵北方艦隊主力を撃滅せよ!\r
- {242, new QuestSortie {Interval = Weekly, Max = 1, Rank = "B", Maps = new[] {44}, Material = new[] {0, 1, 1, 0}}}, // 242: 敵東方中枢艦隊を撃破せよ!\r
- {243, new QuestSortie {Interval = Weekly, Max = 2, Rank = "S", Maps = new[] {52}, Material = new[] {0, 0, 2, 2}}}, // 243: 南方海域珊瑚諸島沖の制空権を握れ!\r
- {249, new QuestSpec {Interval = Monthly, Max = 1, Material = new[] {0, 0, 5, 0}}}, // 249: 「第五戦隊」出撃せよ!\r
- {256, new QuestSortie {Interval = Monthly, Max = 3, Rank = "S", Maps = new[] {61}, Material = new[] {0, 0, 0, 0}}}, // 256: 「潜水艦隊」出撃せよ!\r
- {257, new QuestSpec {Interval = Monthly, Max = 1, Material = new[] {0, 0, 0, 3}}}, // 257: 「水雷戦隊」南西へ!\r
- {259, new QuestSpec {Interval = Monthly, Max = 1, Material = new[] {0, 3, 0, 4}}}, // 259: 「水上打撃部隊」南方へ!\r
- {261, new QuestSortie {Interval = Weekly, Max = 3, Rank = "A", Maps = new[] {15}, Material = new[] {0, 0, 0, 3}}}, // 261: 海上輸送路の安全確保に努めよ!\r
- {264, new QuestSpec {Interval = Monthly, Max = 1, Material = new[] {0, 0, 0, 2}}}, // 264: 「空母機動部隊」西へ!\r
- {265, new QuestSortie {Interval = Monthly, Max = 10, Rank = "A", Maps = new[] {15}, Material = new[] {0, 0, 5, 3}}}, // 265: 海上護衛強化月間\r
- {266, new QuestSpec {Interval = Monthly, Max = 1, Material = new[] {0, 0, 4, 2}}}, // 266: 「水上反撃部隊」突入せよ!\r
-\r
- {822, new QuestSortie {Interval = Quarterly, Max = 2, Rank = "S", Maps = new[] {24}, Material = new[] {0, 0, 0, 5}}}, // 822: 沖ノ島海域迎撃戦\r
- {854, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1, 1}, Material = new[] {0, 0, 0, 4}}}, // 854: 戦果拡張任務!「Z作戦」前段作戦\r
- {861, new QuestSpec {Interval = Quarterly, Max = 2, Material = new[] {0, 4, 0, 0}}}, // 861: 強行輸送艦隊、抜錨!\r
- {862, new QuestSpec {Interval = Quarterly, Max = 2, Material = new[] {0, 0, 8, 4}}}, // 862: 前線の航空偵察を実施せよ!\r
- {873, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 873: 北方海域警備を実施せよ!\r
- {875, new QuestSpec {Interval = Quarterly, Max = 2, Material = new[] {0, 0, 0, 0}}}, // 875: 精鋭「三一駆」、鉄底海域に突入せよ!\r
- {888, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1}, Material = new[] {0, 0, 0, 0}}}, // 888: 新編成「三川艦隊」、鉄底海峡に突入せよ!\r
-\r
- {303, new QuestPractice {Interval = Daily, Max = 3, Win = false, Material = new[] {1, 0, 0, 0}}}, // 303: 「演習」で練度向上!\r
- {304, new QuestPractice {Interval = Daily, Max = 5, Win = true, Material = new[] {0, 0, 1, 0}}}, // 304: 「演習」で他提督を圧倒せよ!\r
- {302, new QuestPractice {Interval = Weekly, Max = 20, Win = true, Material = new[] {0, 0, 2, 1}}}, // 302: 大規模演習\r
- {311, new QuestPractice {Interval = Daily, Max = 7, Win = true, Material = new[] {0, 2, 0, 0}}}, // 311: 精鋭艦隊演習\r
- {315, new QuestPractice {Interval = Daily, Max = 8, Win = true, Material = new[] {0, 0, 0, 0}}}, // 315: 春季大演習\r
- {318, new QuestSpec {Interval = Daily, Max = 3, Material = new[] {0, 2, 2, 0}, AdjustCount = false}}, // 318: 給糧艦「伊良湖」の支援\r
-\r
- {402, new QuestMission {Interval = Daily, Max = 3, Material = new[] {0, 0, 1, 0}}}, // 402: 「遠征」を3回成功させよう!\r
- {403, new QuestMission {Interval = Daily, Max = 10, Material = new[] {0, 0, 0, 0}}}, // 403: 「遠征」を10回成功させよう!\r
- {404, new QuestMission {Interval = Weekly, Max = 30, Material = new[] {0, 0, 3, 0}}}, // 404: 大規模遠征作戦、発令!\r
- {410, new QuestMission {Interval = Weekly, Max = 1, Ids = new[] {37, 38}, Material = new[] {0, 0, 0, 0}}}, // 410: 南方への輸送作戦を成功させよ!\r
- {411, new QuestMission {Interval = Weekly, Max = 6, Shift = 1, Ids = new[] {37, 38}, Material = new[] {0, 0, 2, 1}}}, // 411: 南方への鼠輸送を継続実施せよ!\r
- {424, new QuestMission {Interval = Monthly, Max = 4, Shift = 1, Ids = new[] {5}, Material = new[] {0, 0, 0, 0}}}, // 424: 輸送船団護衛を強化せよ!\r
- {426, new QuestSpec {Interval = Quarterly, MaxArray = new[] {1, 1, 1, 1}, Material = new[] {0, 0, 4, 0}}}, // 426: 海上通商航路の警戒を厳とせよ!\r
- {428, new QuestSpec {Interval = Quarterly, MaxArray = new[] {2, 2, 2}, Material = new[] {0, 0, 0, 3}}}, // 428: 近海に侵入する敵潜を制圧せよ!\r
-\r
- {503, new QuestSpec {Interval = Daily, Max = 5, Material = new[] {0, 2, 0, 0}}}, // 503: 艦隊大整備!\r
- {504, new QuestSpec {Interval = Daily, Max = 15, Material = new[] {1, 0, 1, 0}}}, // 504: 艦隊酒保祭り!\r
-\r
- {605, new QuestSpec {Interval = Daily, Max = 1, Material = new[] {1, 0, 1, 0}}}, // 605: 新装備「開発」指令\r
- {606, new QuestSpec {Interval = Daily, Max = 1, Material = new[] {0, 1, 1, 0}}}, // 606: 新造艦「建造」指令\r
- {607, new QuestSpec {Interval = Daily, Max = 3, Shift = 1, Material = new[] {0, 0, 2, 0}}}, // 607: 装備「開発」集中強化!\r
- {608, new QuestSpec {Interval = Daily, Max = 3, Shift = 1, Material = new[] {1, 0, 2, 0}}}, // 608: 艦娘「建造」艦隊強化!\r
- {609, new QuestSpec {Interval = Daily, Max = 2, Material = new[] {0, 1, 0, 0}}}, // 609: 軍縮条約対応!\r
- {619, new QuestSpec {Interval = Daily, Max = 1, Material = new[] {0, 0, 0, 1}}}, // 619: 装備の改修強化\r
-\r
- {613, new QuestSpec {Interval = Weekly, Max = 24, Material = new[] {0, 0, 0, 0}}}, // 613: 資源の再利用\r
- {638, new QuestDestroyItem {Interval = Weekly, Max = 6, Types = new[] {21}, Material = new[] {0, 0, 2, 1}}}, // 638: 対空機銃量産\r
- {643, new QuestDestroyItem {Interval = Quarterly, Max = 2, Ids = new[] {20}, Material = new[] {0, 0, 2, 0}, AdjustCount = false}}, // 643: 主力「陸攻」の調達\r
- {645, new QuestDestroyItem {Interval = Monthly, Max = 1, Ids = new[] {35}, Material = new[] {0, 0, 0, 0}, AdjustCount = false}}, // 645: 「洋上補給」物資の調達\r
- {663, new QuestDestroyItem {Interval = Quarterly, Max = 10, Types = new[] {3}, Material = new[] {0, 0, 3, 0}}}, // 663: 新型艤装の継続研究\r
- {673, new QuestDestroyItem {Interval = Daily, Max = 4, Types = new[] {1}, Shift = 1, Material = new[] {0, 0, 1, 0}}}, // 673: 装備開発力の整備\r
- {674, new QuestDestroyItem {Interval = Daily, Max = 3, Types = new[] {21}, Shift = 2, Material = new[] {0, 1, 1, 0}}}, // 674: 工廠環境の整備\r
- {675, new QuestDestroyItem {Interval = Quarterly, MaxArray = new[] {6, 4}, Types = new[] {6, 21}, Material = new[] {0, 0, 0, 0}}}, // 675: 運用装備の統合整備\r
- {676, new QuestDestroyItem {Interval = Weekly, MaxArray = new[] {3, 3, 1}, Types = new[] {2, 4, 30}, Material = new[] {0, 1, 7, 0}}}, // 676: 装備開発力の集中整備\r
- {677, new QuestDestroyItem {Interval = Weekly, MaxArray = new[] {4, 2, 3}, Types = new[] {3, 10, 5}, Material = new[] {0, 5, 0, 0}}}, // 677: 継戦支援能力の整備\r
- {678, new QuestDestroyItem {Interval = Quarterly, MaxArray = new[] {3, 5}, Ids = new[] {19, 20}, Material = new[] {0, 0, 8, 0}}}, // 678: 主力艦上戦闘機の更新\r
- {680, new QuestSpec {Interval = Quarterly, MaxArray = new[] {4, 4}, Material = new[] {0, 0, 6, 0}}}, // 680: 対空兵装の整備拡充\r
- {688, new QuestDestroyItem {Interval = Quarterly, MaxArray = new[] {3, 3, 3, 3}, Types = new[] {6, 7, 8, 10}, Material = new[] {0, 0, 0, 0}}}, // 688: 航空戦力の強化\r
-\r
- {702, new QuestPowerUp {Interval = Daily, Max = 2, Material = new[] {0, 1, 0, 0}}}, // 702: 艦の「近代化改修」を実施せよ!\r
- {703, new QuestPowerUp {Interval = Weekly, Max = 15, Material = new[] {1, 0, 2, 0}}} // 703: 「近代化改修」を進め、戦備を整えよ!\r
- };\r
- // @formatter:on\r
-\r
- private readonly Dictionary<int, QuestCount> _countDict = new Dictionary<int, QuestCount>();\r
-\r
- public QuestCount GetCount(int id)\r
- {\r
- if (_countDict.TryGetValue(id, out var value))\r
- return value;\r
- if (QuestSpecs.TryGetValue(id, out var spec))\r
- {\r
- var nowArray = spec.MaxArray?.Select(x => 0).ToArray();\r
- return _countDict[id] = new QuestCount\r
- {\r
- Id = id,\r
- Now = 0,\r
- NowArray = nowArray,\r
- Spec = spec\r
- };\r
- }\r
- return new QuestCount {Spec = new QuestSpec {Material = new int[0], AdjustCount = false}};\r
- }\r
-\r
- public void Remove(int id)\r
- {\r
- _countDict.Remove(id);\r
- }\r
-\r
- public void Remove(QuestInterval interval)\r
- {\r
- foreach (var id in\r
- _countDict.Where(pair => pair.Value.Spec.Interval == interval).Select(pair => pair.Key).ToArray())\r
- {\r
- _countDict.Remove(id);\r
- }\r
- }\r
-\r
- public IEnumerable<QuestCount> CountList\r
- {\r
- get => _countDict.Values.Where(c => c.Now > 0 || (c.NowArray?.Any(n => n > 0) ?? false));\r
- set\r
- {\r
- if (value == null)\r
- return;\r
- foreach (var count in value)\r
- {\r
- count.Spec = QuestSpecs[count.Id];\r
- _countDict[count.Id] = count;\r
- }\r
- }\r
- }\r
- }\r
-\r
public class QuestInfo : IHaveState\r
{\r
private readonly SortedDictionary<int, QuestStatus> _quests = new SortedDictionary<int, QuestStatus>();\r
}\r
\r
private int _map;\r
+ private int _cell;\r
private bool _boss;\r
\r
public void InspectMapStart(dynamic json)\r
public void InspectMapNext(dynamic json)\r
{\r
_map = (int)json.api_maparea_id * 10 + (int)json.api_mapinfo_no;\r
+ _cell = json.api_no() ? (int)json.api_no : 0;\r
_boss = (int)json.api_event_id == 5;\r
\r
if (_quests.TryGetValue(861, out var q861))\r
}\r
if (_quests.TryGetValue(214, out var ago))\r
{\r
- var array = ago.Count.NowArray;\r
+ var count = ago.Count;\r
if (_boss)\r
{\r
- array[2]++;\r
+ IncrementNowArray(count, 2);\r
if (QuestSortie.CompareRank(rank, "B") <= 0)\r
- array[3]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 3);\r
}\r
if (rank == "S")\r
- {\r
- array[1]++;\r
- NeedSave = true;\r
- }\r
+ IncrementNowArray(count, 1);\r
}\r
if (_quests.TryGetValue(249, out var q249))\r
{\r
}\r
if (_quests.TryGetValue(854, out var opz) && _boss)\r
{\r
- var array = opz.Count.NowArray;\r
+ var count = opz.Count;\r
switch (_map)\r
{\r
case 24 when QuestSortie.CompareRank(rank, "A") <= 0:\r
- array[0]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 0);\r
break;\r
case 61 when QuestSortie.CompareRank(rank, "A") <= 0:\r
- array[1]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 1);\r
break;\r
case 63 when QuestSortie.CompareRank(rank, "A") <= 0:\r
- array[2]++;\r
+ IncrementNowArray(count, 2);\r
NeedSave = true;\r
break;\r
case 64 when QuestSortie.CompareRank(rank, "S") <= 0:\r
- array[3]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 3);\r
break;\r
}\r
}\r
if (_battleInfo.Result.Friend.Main.Count(s => s.NowHp > 0 && s.Spec.ShipType == 3) >= 1 &&\r
_boss && QuestSortie.CompareRank(rank, "A") <= 0)\r
{\r
- var array = q873.Count.NowArray;\r
+ var count = q873.Count;\r
switch (_map)\r
{\r
case 31:\r
- array[0]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 0);\r
break;\r
case 32:\r
- array[1]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 1);\r
break;\r
case 33:\r
- array[2]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 2);\r
break;\r
}\r
}\r
};\r
if (fleet.Intersect(member).Count() < 4)\r
return;\r
- var array = q888.Count.NowArray;\r
+ var count = q888.Count;\r
switch (_map)\r
{\r
case 51:\r
- array[0]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 0);\r
break;\r
case 53:\r
- array[1]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 1);\r
break;\r
case 54:\r
- array[2]++;\r
- NeedSave = true;\r
+ IncrementNowArray(count, 2);\r
+ break;\r
+ }\r
+ }\r
+ if (_quests.TryGetValue(893, out var q893))\r
+ {\r
+ if (QuestSortie.CompareRank(rank, "S") != 0)\r
+ return;\r
+ var count = q893.Count;\r
+ if (!_boss)\r
+ {\r
+ if (_map == 72 && _cell == 9)\r
+ {\r
+ IncrementNowArray(count, 2);\r
+ }\r
+ return;\r
+ }\r
+ switch (_map)\r
+ {\r
+ case 15:\r
+ IncrementNowArray(count, 0);\r
+ break;\r
+ case 71:\r
+ IncrementNowArray(count, 1);\r
+ break;\r
+ case 72:\r
+ IncrementNowArray(count, 3);\r
+ break;\r
+ }\r
+ }\r
+ if (_quests.TryGetValue(894, out var q894))\r
+ {\r
+ if (!_boss ||\r
+ QuestSortie.CompareRank(rank, "S") != 0 ||\r
+ !_battleInfo.Result.Friend.Main.Any(s => s.Spec.IsAircraftCarrier && s.NowHp > 0))\r
+ return;\r
+ var count = q894.Count;\r
+ switch (_map)\r
+ {\r
+ case 13:\r
+ IncrementNowArray(count, 0);\r
+ break;\r
+ case 14:\r
+ IncrementNowArray(count, 1);\r
+ break;\r
+ case 21:\r
+ IncrementNowArray(count, 2);\r
+ break;\r
+ case 22:\r
+ IncrementNowArray(count, 3);\r
+ break;\r
+ case 23:\r
+ IncrementNowArray(count, 4);\r
break;\r
}\r
}\r
switch (mid)\r
{\r
case 3:\r
- count.NowArray[0]++;\r
+ IncrementNowArray(count, 0);\r
break;\r
case 4:\r
- count.NowArray[1]++;\r
+ IncrementNowArray(count, 1);\r
break;\r
case 5:\r
- count.NowArray[2]++;\r
+ IncrementNowArray(count, 2);\r
break;\r
case 10:\r
- count.NowArray[3]++;\r
+ IncrementNowArray(count, 3);\r
break;\r
}\r
}\r
switch (mid)\r
{\r
case 4:\r
- count.NowArray[0]++;\r
+ IncrementNowArray(count, 0);\r
break;\r
case 101:\r
- count.NowArray[1]++;\r
+ IncrementNowArray(count, 1);\r
break;\r
case 102:\r
- count.NowArray[2]++;\r
+ IncrementNowArray(count, 2);\r
break;\r
}\r
}\r
}\r
}\r
\r
+ private void IncrementNowArray(QuestCount count, int n)\r
+ {\r
+ count.NowArray[n]++;\r
+ NeedSave = true;\r
+ }\r
+\r
public void CountNyukyo() => IncrementCount(503);\r
\r
public void CountCharge() => IncrementCount(504);\r