-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.html
306 lines (289 loc) · 13.2 KB
/
debug.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-120870782-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-120870782-1');
</script>
<!-- Google Charts -->
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<!--
decimal.js -- An arbitrary-precision Decimal type for JavaScript.
https://github.com/MikeMcl/decimal.js
Copyright (c) 2019 Michael Mclaughlin
Licensed under the MIT License, available at lib/LICENCE.md.txt
-->
<script type="text/javascript" src="lib/decimal.min.js"></script>
<script type="text/javascript" src="polyfill.js"></script>
<script type="text/javascript" src="math.js"></script>
<script type="text/javascript" src="options.js"></script>
<script type="text/javascript" src="calculate.js"></script>
<script type="text/javascript" src="url.js"></script>
<script type="text/javascript" src="main.js"></script>
<!-- DEBUG PAGE -->
<script type="text/javascript" src="debug.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="title" id="title">PokeProb -- Encounter IV/Level/Shiny Probability Calculator + Grapher</div>
<div class="content">
<div class="contentcontainer">
<div class="options">
<div class="optioncategory">
<div class="optionentry" id="opt_minivpercent"><div class="optiondescription">Minimum IV Percentage:</div>
<select id="appraisal" onchange="processOptions()">
<option value="best">Wonder / Simply amazing / Battle with the best</option>
<option value="good">Certainly caught attention / Strong Pokemon / Really strong</option>
<option value="aboveaverage">Above Average / Decent Pokemon / Pretty decent</option>
<option value="any">Any</option>
<option value="other">Custom percentage</option>
</select>
<span class="inputbox"><input class="optiontextbox" id="min_iv_percent" type="number" min="0" max="100" step="0.1" disabled="true" value="82.2" onchange="processOptions()">%IV</span>
</div>
<div class="optionentry" id="opt_minattackiv"><div class="optiondescription">Minimum ATK IV:</div>
<select id="min_attack_iv" onchange="processOptions()">
<option value="any">Any</option>
<option value=15>15</option>
<option value=14>14</option>
<option value=13>13</option>
<option value=12>12</option>
<option value=11>11</option>
<option value=10>10</option>
<option value=9>9</option>
<option value=8>8</option>
<option value=7>7</option>
<option value=6>6</option>
<option value=5>5</option>
<option value=4>4</option>
<option value=3>3</option>
<option value=2>2</option>
<option value=1>1</option>
<option value=0>0</option>
</select>
</div>
<div class="optionentry" id="opt_mindefenseiv"><div class="optiondescription">Minimum DEF IV:</div>
<select id="min_defense_iv" onchange="processOptions()">
<option value="any">Any</option>
<option value=15>15</option>
<option value=14>14</option>
<option value=13>13</option>
<option value=12>12</option>
<option value=11>11</option>
<option value=10>10</option>
<option value=9>9</option>
<option value=8>8</option>
<option value=7>7</option>
<option value=6>6</option>
<option value=5>5</option>
<option value=4>4</option>
<option value=3>3</option>
<option value=2>2</option>
<option value=1>1</option>
<option value=0>0</option>
</select>
</div>
<div class="optionentry" id="opt_minstaminaiv"><div class="optiondescription">Minimum STA (HP) IV:</div>
<select id="min_stamina_iv" onchange="processOptions()">
<option value="any">Any</option>
<option value=15>15</option>
<option value=14>14</option>
<option value=13>13</option>
<option value=12>12</option>
<option value=11>11</option>
<option value=10>10</option>
<option value=9>9</option>
<option value=8>8</option>
<option value=7>7</option>
<option value=6>6</option>
<option value=5>5</option>
<option value=4>4</option>
<option value=3>3</option>
<option value=2>2</option>
<option value=1>1</option>
<option value=0>0</option>
</select>
</div>
</div>
<div class="optioncategory">
<div class="optionentry" id="opt_encountertype"><div class="optiondescription">Type of encounters:</div>
<select id="encounter_type" onchange="processOptions()">
<option value="normal">Normal wild Pokemon</option>
<option value="boosted">Weather boosted Pokemon</option>
<option value="raid">Raid Pokemon</option>
</select>
</div>
<div class="optionentry" id="opt_minlevel"><div class="optiondescription">Minimum Pokemon Level:</div>
<select id="min_level" onchange="processOptions()">
<option value="any">Any</option>
<option id="pokelvl35" value=35 disabled="true">35</option>
<option id="pokelvl34" value=34 disabled="true">34</option>
<option id="pokelvl33" value=33 disabled="true">33</option>
<option id="pokelvl32" value=32 disabled="true">32</option>
<option id="pokelvl31" value=31 disabled="true">31</option>
<option value=30>30</option>
<option value=29>29</option>
<option value=28>28</option>
<option value=27>27</option>
<option value=26>26</option>
<option value=25>25</option>
<option value=24>24</option>
<option value=23>23</option>
<option value=22>22</option>
<option value=21>21</option>
<option value=20>20</option>
<option value=19>19</option>
<option value=18>18</option>
<option value=17>17</option>
<option value=16>16</option>
<option value=15>15</option>
<option value=14>14</option>
<option value=13>13</option>
<option value=12>12</option>
<option value=11>11</option>
<option value=10>10</option>
<option value=9>9</option>
<option value=8>8</option>
<option value=7>7</option>
<option value=6>6</option>
<option id="pokelvl5" value=5>5</option>
<option id="pokelvl4" value=4>4</option>
<option id="pokelvl3" value=3>3</option>
<option id="pokelvl2" value=2>2</option>
<option id="pokelvl1" value=1>1</option>
</select>
</div>
<div class="optionentry" id="opt_trainerlevel">
<div class="optiondescription">Trainer Level:</div>
<select id="trainer_level" disabled="true" onchange="processOptions()">
<option value=30>≥30</option>
<option value=29>29</option>
<option value=28>28</option>
<option value=27>27</option>
<option value=26>26</option>
<option value=25>25</option>
<option value=24>24</option>
<option value=23>23</option>
<option value=22>22</option>
<option value=21>21</option>
<option value=20>20</option>
<option value=19>19</option>
<option value=18>18</option>
<option value=17>17</option>
<option value=16>16</option>
<option value=15>15</option>
<option value=14>14</option>
<option value=13>13</option>
<option value=12>12</option>
<option value=11>11</option>
<option value=10>10</option>
<option value=9>9</option>
<option value=8>8</option>
<option value=7>7</option>
<option value=6>6</option>
<option value=5>5</option>
<option value=4>4</option>
<option value=3>3</option>
<option value=2>2</option>
<option value=1>1</option>
</select>
</div>
</div>
<div class="optioncategory">
<div class="optionentry" id="opt_ratemodifier"><div class="optiondescription">Additional probability modifier:</div>
<select id="ratemodifierselect" onchange="processOptions()">
<option value="1">Base catch probability (default)</option>
<option value="450">Wild shiny rate (1/450)</option>
<option value="75">Absol boss shiny rate (1/75)</option>
<option value="60">Aerodactyl field research shiny rate (1/60)</option>
<option value="50">Baby hatch shiny rate (1/50)</option>
<option value="45">Aerodactyl boss shiny rate (1/45)</option>
<option value="35">Mawile boss shiny rate (1/35)</option>
<option value="24.5">Community Day shiny rate (1/24.5)</option>
<option value="19">Legendary boss shiny rate (1/19)</option>
<option value="custom">Custom rate</option>
</select>
<span class="inputbox"><input class="optiontextbox" id="rate_modifier" type="number" min="0" max="1" step="0.01" disabled="true" onchange="processOptions()">
= 1 / <input class="optiontextbox" id="rate_modifier_inv" type="number" min="1" step="1" disabled="true" onchange="processOptions()"></span>
<div class="optionsubdescription">Keep this at the default (1) in most cases, or set to a specific shiny rate if you're looking for shinies.</div>
</div>
</div>
<div class="optioncategory">
<div class="optionentry" id="opt_pokemontoget"><div class="optiondescription">Number of above Pokemon needed:</div>
<input class="optiontextbox" id="pokemon_to_get" type="number" min="1" step="1" onchange="processOptions()">
</div>
<div class="optionentry" id="opt_chartmode"><div class="optiondescription">Chart mode:</div>
<select id="chart_mode" onchange="processOptions()">
<option value="single">Simple chart (default)</option>
<option value="area">Stacked area</option>
<option value="pmf">PMF for x encounters</option>
<option value="cdf">1-CDF for x encounters</option>
</select>
<div class="optionsubdescription">
<ul>
<li>Use the simple chart to show how the chances of finding a matching Pokemon increase with the number of encounters.</li>
<li>Use the stacked area chart to show the probabilities of multiple numbers of matching Pokemon up to the number needed.</li>
<li>Use the PMF chart to show the expected number of matching Pokemon for a specific number of encounters.</li>
<li>Use the CDF chart to show the chance of finding at least x matching Pokemon for an exact number of encounters.</li>
</ul>
</div>
</div>
<div class="optionentry" id="opt_encounterstograph"><div class="optiondescription">Encounters to graph:</div>
<input class="optiontextbox" id="encounters_to_graph" type="number" min="1" step="1" onchange="processOptions()">
<span id="autoencounterstograph"><input id="auto_encounters_to_graph" type="checkbox" onchange="processOptions()">Set Automatically</span>
</div>
</div>
<div class="buttonsurround">
<button class="calcbutton" type="button" id="calcbutton" onclick="calculateClick()">Calculate</button>
<button class="resetbutton" type="button" id="resetbutton" onclick="resetClick()">Reset</button>
<div id="calculatingspinner"></div>
<div id="optionerror"></div>
</div>
</div>
<div class="chartcontainer">
<div class="urlerror" id="urlerror">
</div>
<div class="description" id="description">
Need to find six 90%+ IV Pokemon during Community Day? Or willing to settle for one,
as long as it has 15 Attack?
<br><br>
Use this tool to get an idea of your chances of getting a desirable Pokemon
after a certain number of encounters.
<br><br>
Enter your desired minimum attack IV, the minimum overall IV percentage,
and whether these are normal, weather-boosted, or raid encounters.
<br><br>
Looking for shiny Pokemon? Use one of the predefined shiny rates
(based on <a href="https://thesilphroad.com/science/pokemon-go-deducing-shiny-rate/">Silph Road Research</a>)
or set your own rate, formatted as a decimal.
<br><br>
Set your expectations too high, or just want to play around with the stats?
Change any parameter and click Calculate again!
</div>
<div class="results" id="results">
<div id="resultstext"></div>
<br>
<div class="chartandoverlaycontainer" style="position:relative;">
<div class="chart" id="visualization"></div>
<div class="overlaycontainer" id="overlaycontainer" style="height:0px;width:0px;"></div>
</div>
<div id="debug"></div>
</div>
</div>
</div>
<div id="share"></div>
<div class="footer">By <a href="https://sil.ph/VSquared56">VSquared56</a></div>
</div>
<div id="loadingoverlay">
<div id="loadingcontainer">
<div id="loadingtext">Processing preset options...</div>
<div id="loadingspinner"></div>
</div>
</div>
</body>
</html>