リビジョン | c60e8b99e82467a4b297a236be56b4be4042131f (tree) |
---|---|
日時 | 2018-11-01 21:50:48 |
作者 | Kazuhiro Fujieda <fujieda@user...> |
コミッター | Kazuhiro Fujieda |
演習相手がレベル166以上だと獲得経験値の予測が小さくなるのを直す
@@ -63,6 +63,7 @@ | ||
63 | 63 | <Compile Include="Model\Inventry.cs" /> |
64 | 64 | <Compile Include="Model\ItemSpec.cs" /> |
65 | 65 | <Compile Include="Model\ItemStatus.cs" /> |
66 | + <Compile Include="Model\PracticeExp.cs" /> | |
66 | 67 | <Compile Include="Model\ShipSpec.cs" /> |
67 | 68 | <Compile Include="Log\BattleLogProcessor.cs" /> |
68 | 69 | <Compile Include="View\AntiAirPanel.cs"> |
@@ -87,94 +87,17 @@ namespace KancolleSniffer.Model | ||
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | - private readonly int[] _expTable = | |
91 | - { | |
92 | - 0, 100, 300, 600, 1000, 1500, 2100, 2800, 3600, 4500, | |
93 | - 5500, 6600, 7800, 9100, 10500, 12000, 13600, 15300, 17100, 19000, | |
94 | - 21000, 23100, 25300, 27600, 30000, 32500, 35100, 37800, 40600, 43500, | |
95 | - 46500, 49600, 52800, 56100, 59500, 63000, 66600, 70300, 74100, 78000, | |
96 | - 82000, 86100, 90300, 94600, 99000, 103500, 108100, 112800, 117600, 122500, | |
97 | - 127500, 132700, 138100, 143700, 149500, 155500, 161700, 168100, 174700, 181500, | |
98 | - 188500, 195800, 203400, 211300, 219500, 228000, 236800, 245900, 255300, 265000, | |
99 | - 275000, 285400, 296200, 307400, 319000, 331000, 343400, 356200, 369400, 383000, | |
100 | - 397000, 411500, 426500, 442000, 458000, 474500, 491500, 509000, 527000, 545500, | |
101 | - 564500, 584500, 606500, 631500, 661500, 701500, 761500, 851500, 1000000, 1000000, | |
102 | - 1010000, 1011000, 1013000, 1016000, 1020000, 1025000, 1031000, 1038000, 1046000, 1055000, | |
103 | - 1065000, 1077000, 1091000, 1107000, 1125000, 1145000, 1168000, 1194000, 1223000, 1255000, | |
104 | - 1290000, 1329000, 1372000, 1419000, 1470000, 1525000, 1584000, 1647000, 1714000, 1785000, | |
105 | - 1860000, 1940000, 2025000, 2115000, 2210000, 2310000, 2415000, 2525000, 2640000, 2760000, | |
106 | - 2887000, 3021000, 3162000, 3310000, 3465000, 3628000, 3799000, 3978000, 4165000, 4360000, | |
107 | - 4564000, 4777000, 4999000, 5230000, 5470000, 5720000, 5780000, 5860000, 5970000, 6120000, | |
108 | - 6320000, 6580000, 6910000, 7320000, 7820000 | |
109 | - }; | |
110 | - | |
111 | 90 | public void InspectPracticeEnemyInfo(dynamic json) |
112 | 91 | { |
113 | 92 | Text = $"[演習情報]\r\n敵艦隊名 : {json.api_deckname}\r\n"; |
114 | 93 | var ships = json.api_deck.api_ships; |
115 | 94 | var s1 = (int)ships[0].api_id != -1 ? (int)ships[0].api_level : 1; |
116 | 95 | var s2 = (int)ships[1].api_id != -1 ? (int)ships[1].api_level : 1; |
117 | - var raw = _expTable[Min(s1, _expTable.Length) - 1] / 100.0 + | |
118 | - _expTable[Min(s2, _expTable.Length) - 1] / 300.0; | |
119 | - var exp = raw >= 500 ? 500 + (int)Sqrt(raw - 500) : (int)raw; | |
120 | - var bonus = 1 + TrainingCruiserBonus(_shipInfo.Fleets[0].ActualShips); | |
96 | + var exp = PracticeExp.GetExp(s1, s2); | |
97 | + var bonus = PracticeExp.TrainingCruiserBonus(_shipInfo.Fleets[0].Ships); | |
121 | 98 | Text += $"獲得経験値 : {(int)(exp * bonus)}\r\nS勝利 : {(int)((int)(exp * 1.2) * bonus)}"; |
122 | 99 | } |
123 | 100 | |
124 | - private double TrainingCruiserBonus(IReadOnlyList<ShipStatus> fleet) | |
125 | - { | |
126 | - if (fleet[0].Spec.IsTrainingCruiser) | |
127 | - { | |
128 | - var fsLevel = fleet[0].Level; | |
129 | - if (fleet.Skip(1).Any(s => s.Spec.IsTrainingCruiser)) | |
130 | - { | |
131 | - if (fsLevel < 10) | |
132 | - return 0.10; | |
133 | - if (fsLevel < 30) | |
134 | - return 0.13; | |
135 | - if (fsLevel < 60) | |
136 | - return 0.16; | |
137 | - if (fsLevel < 100) | |
138 | - return 0.20; | |
139 | - return 0.25; | |
140 | - } | |
141 | - if (fsLevel < 10) | |
142 | - return 0.05; | |
143 | - if (fsLevel < 30) | |
144 | - return 0.08; | |
145 | - if (fsLevel < 60) | |
146 | - return 0.12; | |
147 | - if (fsLevel < 100) | |
148 | - return 0.15; | |
149 | - return 0.20; | |
150 | - } | |
151 | - var tc = fleet.Count(s => s.Spec.IsTrainingCruiser); | |
152 | - if (tc == 0) | |
153 | - return 0; | |
154 | - var level = fleet.Where(s => s.Spec.IsTrainingCruiser).Max(s => s.Level); | |
155 | - if (tc == 1) | |
156 | - { | |
157 | - if (level < 10) | |
158 | - return 0.03; | |
159 | - if (level < 30) | |
160 | - return 0.05; | |
161 | - if (level < 60) | |
162 | - return 0.07; | |
163 | - if (level < 100) | |
164 | - return 0.10; | |
165 | - return 0.15; | |
166 | - } | |
167 | - if (level < 10) | |
168 | - return 0.04; | |
169 | - if (level < 30) | |
170 | - return 0.06; | |
171 | - if (level < 60) | |
172 | - return 0.08; | |
173 | - if (level < 100) | |
174 | - return 0.12; | |
175 | - return 0.175; | |
176 | - } | |
177 | - | |
178 | 101 | public void InspectMapNext(dynamic json) |
179 | 102 | { |
180 | 103 | if (json.api_airsearch() && (int)json.api_airsearch.api_result != 0) |
@@ -0,0 +1,91 @@ | ||
1 | +using System.Collections.Generic; | |
2 | +using System.Linq; | |
3 | +using static System.Math; | |
4 | + | |
5 | +namespace KancolleSniffer.Model | |
6 | +{ | |
7 | + public static class PracticeExp | |
8 | + { | |
9 | + private static readonly int[] ExpTable = | |
10 | + { | |
11 | + 0, 100, 300, 600, 1000, 1500, 2100, 2800, 3600, 4500, | |
12 | + 5500, 6600, 7800, 9100, 10500, 12000, 13600, 15300, 17100, 19000, | |
13 | + 21000, 23100, 25300, 27600, 30000, 32500, 35100, 37800, 40600, 43500, | |
14 | + 46500, 49600, 52800, 56100, 59500, 63000, 66600, 70300, 74100, 78000, | |
15 | + 82000, 86100, 90300, 94600, 99000, 103500, 108100, 112800, 117600, 122500, | |
16 | + 127500, 132700, 138100, 143700, 149500, 155500, 161700, 168100, 174700, 181500, | |
17 | + 188500, 195800, 203400, 211300, 219500, 228000, 236800, 245900, 255300, 265000, | |
18 | + 275000, 285400, 296200, 307400, 319000, 331000, 343400, 356200, 369400, 383000, | |
19 | + 397000, 411500, 426500, 442000, 458000, 474500, 491500, 509000, 527000, 545500, | |
20 | + 564500, 584500, 606500, 631500, 661500, 701500, 761500, 851500, 1000000, 1000000, | |
21 | + 1010000, 1011000, 1013000, 1016000, 1020000, 1025000, 1031000, 1038000, 1046000, 1055000, | |
22 | + 1065000, 1077000, 1091000, 1107000, 1125000, 1145000, 1168000, 1194000, 1223000, 1255000, | |
23 | + 1290000, 1329000, 1372000, 1419000, 1470000, 1525000, 1584000, 1647000, 1714000, 1785000, | |
24 | + 1860000, 1940000, 2025000, 2115000, 2210000, 2310000, 2415000, 2525000, 2640000, 2760000, | |
25 | + 2887000, 3021000, 3162000, 3310000, 3465000, 3628000, 3799000, 3978000, 4165000, 4360000, | |
26 | + 4564000, 4777000, 4999000, 5230000, 5470000, 5720000, 5780000, 5860000, 5970000, 6120000, | |
27 | + 6320000, 6580000, 6910000, 7320000, 7820000, 7920000, 8033000, 8172000, 8350000, 8580000, | |
28 | + 8875000, 9248000, 9705000, 10266000, 10950000 | |
29 | + }; | |
30 | + | |
31 | + public static double GetExp(int ship1Lv, int ship2Lv) | |
32 | + { | |
33 | + return ExpTable[Min(ship1Lv, ExpTable.Length) - 1] / 100.0 + | |
34 | + ExpTable[Min(ship2Lv, ExpTable.Length) - 1] / 300.0; | |
35 | + } | |
36 | + | |
37 | + public static double TrainingCruiserBonus(IReadOnlyList<ShipStatus> fleet) | |
38 | + { | |
39 | + if (fleet[0].Spec.IsTrainingCruiser) | |
40 | + { | |
41 | + var fsLevel = fleet[0].Level; | |
42 | + if (fleet.Skip(1).Any(s => s.Spec.IsTrainingCruiser)) | |
43 | + { | |
44 | + if (fsLevel < 10) | |
45 | + return 0.10; | |
46 | + if (fsLevel < 30) | |
47 | + return 0.13; | |
48 | + if (fsLevel < 60) | |
49 | + return 0.16; | |
50 | + if (fsLevel < 100) | |
51 | + return 0.20; | |
52 | + return 0.25; | |
53 | + } | |
54 | + if (fsLevel < 10) | |
55 | + return 0.05; | |
56 | + if (fsLevel < 30) | |
57 | + return 0.08; | |
58 | + if (fsLevel < 60) | |
59 | + return 0.12; | |
60 | + if (fsLevel < 100) | |
61 | + return 0.15; | |
62 | + return 0.20; | |
63 | + } | |
64 | + var tc = fleet.Count(s => s.Spec.IsTrainingCruiser); | |
65 | + if (tc == 0) | |
66 | + return 0; | |
67 | + var level = fleet.Where(s => s.Spec.IsTrainingCruiser).Max(s => s.Level); | |
68 | + if (tc == 1) | |
69 | + { | |
70 | + if (level < 10) | |
71 | + return 0.03; | |
72 | + if (level < 30) | |
73 | + return 0.05; | |
74 | + if (level < 60) | |
75 | + return 0.07; | |
76 | + if (level < 100) | |
77 | + return 0.10; | |
78 | + return 0.15; | |
79 | + } | |
80 | + if (level < 10) | |
81 | + return 0.04; | |
82 | + if (level < 30) | |
83 | + return 0.06; | |
84 | + if (level < 60) | |
85 | + return 0.08; | |
86 | + if (level < 100) | |
87 | + return 0.12; | |
88 | + return 0.175; | |
89 | + } | |
90 | + } | |
91 | +} | |
\ No newline at end of file |