1 // Copyright (C) 2015 Kazuhiro Fujieda <fujieda@users.osdn.me>
\r
3 // This program is part of KancolleSniffer.
\r
5 // KancolleSniffer is free software: you can redistribute it and/or modify
\r
6 // it under the terms of the GNU General Public License as published by
\r
7 // the Free Software Foundation, either version 3 of the License, or
\r
8 // (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, see <http://www.gnu.org/licenses/>.
\r
18 using System.Collections.Generic;
\r
19 using static System.Math;
\r
21 namespace KancolleSniffer
\r
23 public class MiscTextInfo
\r
25 private const string GuideText = "[海域ゲージ情報]\r\n 海域選択画面に進むと表示します。\r\n[演習情報]\r\n 演習相手を選ぶと表示します。";
\r
26 public string Text { get; private set; } = GuideText;
\r
27 public bool ClearFlag { private get; set; }
\r
29 public void ClearIfNeeded()
\r
37 private readonly Dictionary<int, int> _required = new Dictionary<int, int>
\r
53 public void InspectMapInfo(dynamic json)
\r
55 Text = "[海域ゲージ]\r\n";
\r
56 foreach (var entry in json)
\r
58 var map = (int)entry.api_id;
\r
59 if (entry.api_eventmap())
\r
61 var evmap = entry.api_eventmap;
\r
62 Text += $"{map / 10}-{map % 10} : HP {(int)evmap.api_now_maphp}/{(int)evmap.api_max_maphp}\r\n";
\r
65 if (!entry.api_defeat_count())
\r
68 var reqStr = _required.TryGetValue(map, out req) ? req.ToString() : "?";
\r
69 Text += $"{map / 10}-{map % 10} : 撃破 {(int)entry.api_defeat_count}/{reqStr}\r\n";
\r
73 private readonly int[] _expTable =
\r
75 0, 100, 300, 600, 1000, 1500, 2100, 2800, 3600, 4500,
\r
76 5500, 6600, 7800, 9100, 10500, 12000, 13600, 15300, 17100, 19000,
\r
77 21000, 23100, 25300, 27600, 30000, 32500, 35100, 37800, 40600, 43500,
\r
78 46500, 49600, 52800, 56100, 59500, 63000, 66600, 70300, 74100, 78000,
\r
79 82000, 86100, 90300, 94600, 99000, 103500, 108100, 112800, 117600, 122500,
\r
80 127500, 132700, 138100, 143700, 149500, 155500, 161700, 168100, 174700, 181500,
\r
81 188500, 195800, 203400, 211300, 219500, 228000, 236800, 245900, 255300, 265000,
\r
82 275000, 285400, 296200, 307400, 319000, 331000, 343400, 356200, 369400, 383000,
\r
83 397000, 411500, 426500, 442000, 458000, 474500, 491500, 509000, 527000, 545500,
\r
84 564500, 584500, 606500, 631500, 661500, 701500, 761500, 851500, 1000000, 1000000,
\r
85 1010000, 1011000, 1013000, 1016000, 1020000, 1025000, 1031000, 1038000, 1046000, 1055000,
\r
86 1065000, 1077000, 1091000, 1107000, 1125000, 1145000, 1168000, 1194000, 1223000, 1255000,
\r
87 1290000, 1329000, 1372000, 1419000, 1470000, 1525000, 1584000, 1647000, 1714000, 1785000,
\r
88 1860000, 1940000, 2025000, 2115000, 2210000, 2310000, 2415000, 2525000, 2640000, 2760000,
\r
89 2887000, 3021000, 3162000, 3310000, 3465000, 3628000, 3799000, 3978000, 4165000, 4360000,
\r
90 4564000, 4777000, 4999000, 5230000, 5470000
\r
93 public void InspectPracticeEnemyInfo(dynamic json)
\r
95 Text = $"[演習情報]\r\n敵艦隊名 : {json.api_deckname}\r\n";
\r
96 var ships = json.api_deck.api_ships;
\r
97 var s1 = (int)ships[0].api_id != -1 ? (int)ships[0].api_level : 1;
\r
98 var s2 = (int)ships[1].api_id != -1 ? (int)ships[1].api_level : 1;
\r
99 var raw = _expTable[Min(s1, _expTable.Length) - 1] / 100.0 + _expTable[Min(s2, _expTable.Length) - 1] / 300.0;
\r
100 var exp = raw >= 500 ? 500 + (int)Sqrt(raw - 500) : (int)raw;
\r
101 Text += $"獲得経験値 : {exp}\r\nS勝利 : {(int)(exp * 1.2)}";
\r