-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathouterheaven_viruslist_v3.html
529 lines (491 loc) · 27.2 KB
/
outerheaven_viruslist_v3.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
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<head><title>Interactive Virus List V3.0 Beta</title><style>
.mini { color:grey; font-size:0.7em; }
.vlist_add, .vlist_addland, .vlist_remv, .vlist_remland, .vlist_info1, .vlist_info2 { cursor:pointer; }
.vlist_entm { font-weight: bold; color:firebrick !important; }
.vlist_addland { text-decoration:underline; }
td.vlist_info { width: 50%; }
</style></head>
<script type="text/javascript" src="http://z6.ifrm.com/static/jq171.js?z=4"></script>
// Outer Heaven - Interactive Virus List v3.0
<hr><center><b><font size="7">Interactive Virus List v3.0</font></b></center><hr><br />
How to use: <ul><li>Input all relevant information, and click <strong>[Search]</strong>. Post-5 viruses are filtered automatically.</li>
<li>Roll for MD with <strong>[MD Roll]</strong>. Summon a Mimic with <strong>[Add Mimic]</strong> or <strong>[Add Rare Mimic]</strong>. Add Meta-Viruses to the list with <strong>[Metavirus].</strong>.</li>
<li>Add viruses to the template with <strong>[+]</strong> next to their name. Click <strong>[1]</strong> or <strong>[2]</strong> to view virus info.</li>
<li>Add SPs with <strong>[Add SP]</strong>, or objects with <strong>[Add Object]</strong>.</li>
<li>You can edit the text parts in the template that have a dark grey color.</li>
<li>Remove viruses by clicking on them in the template. Remove terrain, SPs or objects by double clicking them.</li>
<li>Randomize battles by using <strong>[Randomize]</strong>. Note that you'll need to add metaviruses to the result table if you want them.</li>
<li>Use <strong>[Clear]</strong> to empty the virus result table, and <strong>[Reset]</strong> to clear the entire template.</li></ul>
<table border=1>
<tr>
<td id="virus_options" colspan="2">Net Area: <select id="vlist_area">
<option value="ACDC">ACDC</option>
<option value="SciLab">SciLab</option>
<option value="Electown">Electown</option>
<option value="Yoka">Yoka</option>
<option value="Netopia">Netopia</option>
<option value="Dentech">Dentech</option>
<option value="Beach">Beach</option>
<option value="Okuden Valley">Okuden</option>
<option value="Kotobuki Town">Kotobuki</option>
<option value="Sharo">Sharo</option>
<option value="Yumland">Yumland</option>
<option value="Netfrica">Netfrica</option>
<option value="Hades Isle">Hades</option>
<option value="NAXA">NAXA</option>
<option value="NetVegas">NetVegas</option>
<option value="Undernet">Undernet</option>
<option value="All">All Nets</option>
</select> Net Rank: <select id="vlist_rank">
<option value=0 selected>Normal</option>
<option value=2>Rogue</option>
<option value=4>Chaos</option>
<option value=6 disabled>Undernet</option>
</select> Battle No: <select id="vlist_battle">
<option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5 disabled>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10 disabled>10</option><option value=11>11</option><option value=12>12</option><option value=13>13</option><option value=14>14</option><option value=15 disabled>15</option><option value=16>16</option><option value=17>17</option><option value=18>18</option><option value=19>19</option><option value=20 disabled>20</option>
</select> Participants: <select id="vlist_navi">
<option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option>
</select> <input type="button" id="vlist_search" value="Search"> <input type="button" id="vlist_clear" value="Clear"> <input type="button" id="vlist_reset" value="Reset"><br> <input type="button" id="vlist_md" value="MD Roll"> <input type="button" id="vlist_meta" value="Metavirus"> <input type="button" id="vlist_addsp" value="Add SP"> <input type="button" id="vlist_addobj" value="Add Object"> <input type="button" id="vlist_mmc" value="Add Mimic"> <input type="button" id="vlist_rmmc" value="Add Rare Mimic"> <input type="button" id="vlist_random" value="Randomize"></td>
<td id="vlist_template" rowspan="3"></td>
</tr>
<tr>
<td id="vlist_terrain" colspan="2">Terrain for net area and suggested virus count listed here</td>
</tr>
<tr>
<td id="vlist_res">Virus search results here<br>(Contains clickable virus names that pop out<br>description and stats and can be added<br>to the template on the right)</td>
<td id="vlist_resex">EX Viruses go here if Battle 6 option is selected<br>(if option is deselected, table cell disappears<br>and is merged with left cell)</td>
</tr>
</table>
<br><br>
<table id="vlist_info" border=1><tr>
<td id="vlist_info1" class="vlist_info"></td>
<td id="vlist_info2" class="vlist_info"></td>
</tr></table>
<script>
var netarea = "";
var netrank = 0;
var netrankx = 1;
var netranktx = "";
var netbat = 1;
var netnavi = 1;
var netland = {
"ACDC": ["Normal", "Cracked", "Missing"],
"SciLab": ["Normal", "Metal", "Glass", "Solar"],
"Electown": ["Normal", "Metal", "Magnet", "Solar"],
"Yoka": ["Normal", "Sea", "Onsen", "Coal"],
"Netopia": ["Normal", "Holy", "Poison", "Cracked"],
"Dentech": ["Normal", "Glass", "Cursed", "Magnet"],
"Beach": ["Normal", "Sea", "Sand", "Mud", "Grass"],
"Okuden Valley": ["Normal", "Grass", "Soil", "Mud"],
"Kotobuki Town": ["Normal", "Lava", "Furnace", "Grass"],
"Sharo": ["Normal", "Ice", "Snow", "Cracked", "Missing"],
"Yumland": ["Normal", "Grass", "Soil", "Mud", "Poison", "Snare"],
"Netfrica": ["Normal", "Grass", "Soil", "Sand"],
"Hades Isle": ["Normal", "Lava", "Coal", "Furnace", "Metal", "Sand"],
"NAXA": ["Normal", "Metal", "Magnet", "Solar", "Missing"],
"NetVegas": ["Normal", "Lava", "Coal", "Furnace", "Sea", "Ice", "Snow", "Metal", "Magnet", "Solar", "Grass", "Soil", "Mud", "Sand", "Quicksand", "Glass", "Poison", "Holy", "Cursed", "Cracked", "Broken", "Missing"],
"Undernet": ["Normal", "Lava", "Coal", "Furnace", "Sea", "Ice", "Snow", "Metal", "Magnet", "Solar", "Grass", "Soil", "Mud", "Sand", "Quicksand", "Glass", "Poison", "Holy", "Cursed", "Cracked", "Broken", "Glitched", "Missing"],
"All": ["Normal", "Lava", "Coal", "Furnace", "Sea", "Ice", "Snow", "Metal", "Magnet", "Solar", "Grass", "Soil", "Mud", "Sand", "Quicksand", "Glass", "Poison", "Holy", "Cursed", "Cracked", "Broken", "Glitched", "Missing"]
};
var netmin = [3, 4, 4, 5, 0, 6, 6, 7, 7, 0, 9, 10, 9, 10, 0, 11, 12, 13, 14];
var netmax = [4, 5, 6, 7, 0, 7, 7, 8, 9, 0, 10, 11, 12, 13, 0, 14, 15, 16, 16];
var maxbat;
var virusData1 = {};
var virusData2 = {};
var virusData = {};
var remoteVirusTime1;
var remoteVirusTime2;
var virusGet1 = $.Deferred();
var virusGet2 = $.Deferred();
var virusGet = $.Deferred();
var virusTimeGet1 = $.get("https://api.myjson.com/bins/42wgx", function (data, textStatus, jqXHR) {
remoteVirusTime1 = data.timestamp;
if (!(localStorage.getItem("vCacheTime1"))) localStorage.setItem("vCacheTime1", data.timestamp.toString());
});
var virusTimeGet2 = $.get("https://api.myjson.com/bins/1683a", function (data, textStatus, jqXHR) {
remoteVirusTime2 = data.timestamp;
if (!(localStorage.getItem("vCacheTime2"))) localStorage.setItem("vCacheTime2", data.timestamp.toString());
});
virusTimeGet1.done(function() {
if((localStorage.getItem("vDataCache1")) && (parseInt(localStorage.getItem("vCacheTime1"), 10) === remoteVirusTime1)) {
virusData1 = JSON.parse(localStorage.getItem("vDataCache1"));
virusGet1.resolve();
} else {
$.get("https://api.myjson.com/bins/58zld", function (data, textStatus, jqXHR) {
virusData1 = data;
localStorage.setItem("vDataCache1", JSON.stringify(data));
localStorage.setItem("vCacheTime1", remoteVirusTime1.toString());
}) .done(function(){ virusGet1.resolve(); });
}
});
virusTimeGet2.done(function() {
if((localStorage.getItem("vDataCache2")) && (parseInt(localStorage.getItem("vCacheTime2"), 10) === remoteVirusTime2)) {
virusData2 = JSON.parse(localStorage.getItem("vDataCache2"));
virusGet2.resolve();
} else {
$.get("https://api.myjson.com/bins/4ioie", function (data, textStatus, jqXHR) {
virusData2 = data;
localStorage.setItem("vDataCache2", JSON.stringify(data));
localStorage.setItem("vCacheTime2", remoteVirusTime2.toString());
}) .done(function(){ virusGet2.resolve(); });
}
});
// Part 1 Viruslist: https://api.myjson.com/bins/58zld
// Part 1 Timestamp: https://api.myjson.com/bins/42wgx
// Part 2 Viruslist: https://api.myjson.com/bins/4ioie
// Part 2 Timestamp: https://api.myjson.com/bins/1683a
$.when( virusGet1, virusGet2 ).done(function() {
virusData = Object.assign(virusData1, virusData2);
virusGet.resolve();
});
$(window).unload(function() {
$('select option').remove();
});
localStorage.removeItem('vDataCache');
localStorage.removeItem('vCacheTime');
$('#vlist_rank').removeProp('disabled');
$('#vlist_battle').removeProp('disabled');
$('#vlist_info1, #vlist_info2, #vlist_md, #vlist_mmc, #vlist_rmmc, #vlist_reset, #vlist_meta, #vlist_random, #vlist_addsp, #vlist_addobj, #vlist_clear').hide();
$('#vlist_resex').show();
$('#vlist_area').change(function() {
netarea = $('#vlist_area').val();
if (netarea === "Undernet") {
$('#vlist_rank').val('6');
$('#vlist_rank').prop('disabled', true);
}
if (netarea != "Undernet" && $('#vlist_rank').prop('disabled')) {
$('#vlist_rank').removeProp('disabled');
$('#vlist_rank').val('1');
}
});
virusGet.done (function() {
$('#vlist_search').click(function() {
netarea = $('#vlist_area').val();
netrank = parseInt($('#vlist_rank').val(), 10);
netnavi = parseInt($('#vlist_navi').val(), 10);
netrankx = netrank+1;
switch (netrank) {
case 0: netranktx = ""; break;
case 2: netranktx = "Rogue "; break;
case 4: netranktx = "Chaos "; break;
case 6: netranktx = "Undernet "; break;
}
netbat = parseInt($('#vlist_battle').val(), 10);
$('#vlist_res, #vlist_resex').empty();
$('#vlist_res').attr('colspan','1');
$('#vlist_md, #vlist_mmc, #vlist_reset, #vlist_meta, #vlist_random, #vlist_addsp, #vlist_addobj, #vlist_clear').show();
if (netbat > 11) $('#vlist_rmmc').show();
$('#vlist_terrain').html("Terrain: ");
$('#vlist_template').html("<div id='vlist_tempvirus'></div><div id='vlist_tempnavi'></div><div id='vlist_tempterr'></div><div id='vlist_tempobj'></div><div id='vlist_tempstart'></div>");
$('#vlist_tempvirus').html("<strong>[b]-- <span contenteditable='true' style='color:darkgrey'>Viruses</span> --[/b]</strong><br>");
$('#vlist_tempnavi').html("<br><strong>[b]-- <span contenteditable='true' style='color:darkgrey'>Navis</span> --[/b]</strong><br>");
for (var i = 0; i < netnavi; i++) {
$('#vlist_tempnavi').append("<span contenteditable='true' style='color:darkgrey'>Battler</span>.EXE: <span contenteditable='true' style='color:darkgrey'>100</span> HP<br>");
}
$('#vlist_tempterr').html("<br><strong>[b]-- Terrain --[/b]</strong><br>");
$('#vlist_tempobj').html("<br><strong>[b]-- Objects --[/b]</strong><br>");
$('#vlist_tempstart').html("<br><strong>[b]-- " + netranktx + "Battle " + netbat + " Ready? Start!! --[/b]</strong><br>");
for (var i = 0; i < netland[netarea].length; i++) {
var landentry = "<span class='vlist_addland'>" + netland[netarea][i] + "</span>";
if (i === netland[netarea].length-1) $('#vlist_terrain').append(landentry, " | ");
else $('#vlist_terrain').append(landentry, ", ");
}
maxbat = netmax[$('#vlist_battle').val()-1];
$('#vlist_terrain').append("Virus Count: ", netmin[$('#vlist_battle').val()-1]*netnavi, "-", maxbat*netnavi);
for (var key in virusData) {
var virusentry = virusData[key].virus[netrank].name + " <span class='mini'>(" + key + ")</span><br>";
var virusopt = "<span class='mini' id='" + key + "-" + netrank + "'><span class='vlist_add'>[+]</span> <span class='vlist_info1'>[1]</span> <span class='vlist_info2'>[2]</span> </span>";
if (netarea === "Undernet") {
$('#vlist_resex').hide();
$('#vlist_res').attr('colspan','2');
if (!('family_meta' in virusData[key])) {
if (netbat < 5) { if (virusData[key].virus[netrank].pre6) $('#vlist_res').append(virusopt, virusentry); }
else $('#vlist_res').append(virusopt, virusentry);
}
}
else if (netarea === "All") {
var virusentryx = virusData[key].virus[netrankx].name + " <span class='mini'>(" + key + ")</span><br>";
var virusoptx = "<span class='mini' id='" + key + "-" + netrankx + "'><span class='vlist_add'>[+]</span> <span class='vlist_info1'>[1]</span> <span class='vlist_info2'>[2]</span> </span>";
$('#vlist_resex').show();
$('#vlist_resex').append(virusoptx, virusentryx);
$('#vlist_res').append(virusopt, virusentry);
}
else if ($.inArray(netarea, virusData[key].family_area) > -1) {
if (netbat > 5) {
var virusentryx = virusData[key].virus[netrankx].name + " <span class='mini'>(" + key + ")</span><br>";
var virusoptx = "<span class='mini' id='" + key + "-" + netrankx + "'><span class='vlist_add'>[+]</span> <span class='vlist_info1'>[1]</span> <span class='vlist_info2'>[2]</span> </span>";
$('#vlist_resex').show();
$('#vlist_resex').append(virusoptx, virusentryx);
$('#vlist_res').append(virusopt, virusentry);
}
else {
$('#vlist_resex').hide();
$('#vlist_res').attr('colspan','2');
if (virusData[key].virus[netrank].pre6) $('#vlist_res').append(virusopt, virusentry);
}
}
}
$('.vlist_add').click(function() {
var akey = $(this).parent().prop("id").slice(0, -2);
var arank = parseInt($(this).parent().prop("id").slice(-1), 10);
var tvirus = "<span class='vlist_remv'>[virus]<span class='vlist_entv'>" + virusData[akey].virus[arank].name + "</span>[/virus]<span class='vlist_entvi'></span>: "+ virusData[akey].virus[arank].hpts + " HP" + "<br></span>";
if ($('.vlist_entv').filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).length > 0) {
$('.vlist_entv').filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).parent().last().after(tvirus);
}
else $('#vlist_tempvirus').append(tvirus);
$('.vlist_entv').filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).next(".vlist_entvi").empty();
if ($(".vlist_entv").filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).length > 1) {
$(".vlist_entv").filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).each(function(index) {
$(this).next(".vlist_entvi").html(" " + String.fromCharCode(65 + index));
});
}
$('.vlist_mdhp').html($('.vlist_entv').length*5);
$(".vlist_remv").unbind( "click" );
$('.vlist_remv').click(function() {
tvirus = $(".vlist_entv", this).text();
$('.vlist_entv').filter(function() { return $(this).text() === tvirus; }).next(".vlist_entvi").empty();
$(this).remove();
if ($('.vlist_entv').filter(function() { return $(this).text() === tvirus; }).length > 1) {
$('.vlist_entv').filter(function() { return $(this).text() === tvirus; }).each(function(index) {
$(this).next(".vlist_entvi").html(" " + String.fromCharCode(65 + index));
});
}
$('.vlist_mdhp').html($('#vlist_tempvirus .vlist_entv').length*5);
});
});
$('.vlist_addland').click(function() {
var templand = "<span class='vlist_remd'><span class='vlist_landq' contenteditable='true' style='color:darkgray'>0</span>% " + $(this).text() + "<br></span>";
$('#vlist_tempterr').append(templand);
$('.vlist_remd').unbind('dblclick');
$('.vlist_remd').dblclick(function() { $(this).remove(); });
});
$('.vlist_info1').click(function() {
$('#vlist_info1').show();
var i1key = $(this).parent().prop("id").slice(0, -2);
var i1rank = parseInt($(this).parent().prop("id").slice(-1), 10);
$('#vlist_info1').html("<strong>" + virusData[i1key].virus[i1rank].name + "</strong> <a href='" + virusData[i1key].family_url + "'>("+ i1key +")</a><br><br>");
if (virusData[i1key].family_note !== "") $('#vlist_info1').append(virusData[i1key].family_note, "<br><br>");
$('#vlist_info1').append(virusData[i1key].virus[i1rank].desc);
});
$('.vlist_info2').click(function() {
$('#vlist_info2').show();
var i2key = $(this).parent().prop("id").slice(0, -2);
var i2rank = parseInt($(this).parent().prop("id").slice(-1), 10);
$('#vlist_info2').html("<strong>" + virusData[i2key].virus[i2rank].name + "</strong> <a href='" + virusData[i2key].family_url + "'>("+ i2key +")</a><br><br>");
if (virusData[i2key].family_note !== "") $('#vlist_info2').append(virusData[i2key].family_note, "<br><br>");
$('#vlist_info2').append(virusData[i2key].virus[i2rank].desc);
});
});
$('#vlist_reset').click(function() {
$('#vlist_tempvirus').html("<strong>[b]-- Viruses --[/b]</strong><br>");
$('#vlist_tempnavi').html("<br><strong>[b]-- Navis --[/b]</strong><br>");
for (var i = 0; i < netnavi; i++) {
$('#vlist_tempnavi').append("<span contenteditable='true' style='color:darkgrey'>Battler</span>.EXE: <span contenteditable='true' style='color:darkgrey'>100</span> HP<br>");
}
$('#vlist_tempterr').html("<br><strong>[b]-- Terrain --[/b]</strong><br>");
$('#vlist_tempobj').html("<br><strong>[b]-- Objects --[/b]</strong><br>");
$('#vlist_tempstart').html("<br><strong>[b]-- " + netranktx + "Battle " + netbat + " Ready? Start!! --[/b]</strong><br>");
});
$('#vlist_meta').click(function() {
if($('.vlist_entm').length > 0) alert("Metaviruses already added!")
else {
for (var key in virusData) {
if ('family_meta' in virusData[key])
{
var virusentry = virusData[key].virus[netrank].name + " <span class='mini vlist_entm'>(" + key + ")</span><br>";
var virusopt = "<span class='mini' id='" + key + "-" + netrank + "'><span class='vlist_add vlist_addm'>[+]</span> <span class='vlist_info1'>[1]</span> <span class='vlist_info2'>[2]</span> </span>";
if (netarea === "Undernet") {
$('#vlist_resex').hide();
$('#vlist_res').attr('colspan','2');
if (netbat < 5) { if (virusData[key].virus[netrank].pre6) $('#vlist_res').append(virusopt, virusentry); }
else { $('#vlist_res').append(virusopt, virusentry); }
}
else {
if (netbat > 5) {
var virusentryx = virusData[key].virus[netrankx].name + " <span class='mini vlist_entm'>(" + key + ")</span><br>";
var virusoptx = "<span class='mini' id='" + key + "-" + netrankx + "'><span class='vlist_add vlist_addm'>[+]</span> <span class='vlist_info1'>[1]</span> <span class='vlist_info2'>[2]</span> </span>";
$('#vlist_resex').append(virusoptx, virusentryx);
$('#vlist_res').append(virusopt, virusentry);
}
else {
if (virusData[key].virus[netrank].pre6) $('#vlist_res').append(virusopt, virusentry);
}
}
}
}
$('.vlist_add, .vlist_info1, .vlist_info2').unbind("click");
$('.vlist_add').click(function() {
var akey = $(this).parent().prop("id").slice(0, -2);
var arank = parseInt($(this).parent().prop("id").slice(-1), 10);
var tvirus = "<span class='vlist_remv'>[virus]<span class='vlist_entv'>" + virusData[akey].virus[arank].name + "</span>[/virus]<span class='vlist_entvi'></span>: "+ virusData[akey].virus[arank].hpts + " HP" + "<br></span>";
if ($('.vlist_entv').filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).length > 0) {
$('.vlist_entv').filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).parent().last().after(tvirus);
}
else $('#vlist_tempvirus').append(tvirus);
$('.vlist_entv').filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).next(".vlist_entvi").empty();
if ($(".vlist_entv").filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).length > 1) {
$(".vlist_entv").filter(function() { return $(this).text() === virusData[akey].virus[arank].name; }).each(function(index) {
$(this).next(".vlist_entvi").html(" " + String.fromCharCode(65 + index));
});
}
$('.vlist_mdhp').html($('.vlist_entv').length*5);
$(".vlist_remv").unbind( "click" );
$('.vlist_remv').click(function() {
tvirus = $(".vlist_entv", this).text();
$('.vlist_entv').filter(function() { return $(this).text() === tvirus; }).next(".vlist_entvi").empty();
$(this).remove();
if ($('.vlist_entv').filter(function() { return $(this).text() === tvirus; }).length > 1) {
$('.vlist_entv').filter(function() { return $(this).text() === tvirus; }).each(function(index) {
$(this).next(".vlist_entvi").html(" " + String.fromCharCode(65 + index));
});
}
$('.vlist_mdhp').html($('#vlist_tempvirus .vlist_entv').length*5);
});
});
$('.vlist_info1').click(function() {
$('#vlist_info1').show();
var i1key = $(this).parent().prop("id").slice(0, -2);
var i1rank = parseInt($(this).parent().prop("id").slice(-1), 10);
$('#vlist_info1').html("<strong>" + virusData[i1key].virus[i1rank].name + "</strong> <a href='" + virusData[i1key].family_url + "'>("+ i1key +")</a><br><br>");
if (virusData[i1key].family_note !== "") $('#vlist_info1').append(virusData[i1key].family_note, "<br><br>");
$('#vlist_info1').append(virusData[i1key].virus[i1rank].desc);
});
$('.vlist_info2').click(function() {
$('#vlist_info2').show();
var i2key = $(this).parent().prop("id").slice(0, -2);
var i2rank = parseInt($(this).parent().prop("id").slice(-1), 10);
$('#vlist_info2').html("<strong>" + virusData[i2key].virus[i2rank].name + "</strong> <a href='" + virusData[i2key].family_url + "'>("+ i2key +")</a><br><br>");
if (virusData[i2key].family_note !== "") $('#vlist_info2').append(virusData[i2key].family_note, "<br><br>");
$('#vlist_info2').append(virusData[i2key].virus[i2rank].desc);
});
}
});
$('#vlist_addsp').click(function() {
$('#vlist_tempnavi').append("<span class='vlist_remd'><span contenteditable='true' style='color:darkgrey'>BattleProg</span>.SP: <span contenteditable='true' style='color:darkgrey'>40</span> HP<br></span>");
$('.vlist_remd').unbind('dblclick');
$('.vlist_remd').dblclick(function() { $(this).remove(); });
});
$('#vlist_addobj').click(function() {
$('#vlist_tempobj').append("<span class='vlist_remd'><span contenteditable='true' style='color:darkgrey'>FieldObject</span>: <span contenteditable='true' style='color:darkgrey'>40</span> HP<br></span>");
$('.vlist_remd').unbind('dblclick');
$('.vlist_remd').dblclick(function() { $(this).remove(); });
});
$('#vlist_mmc').click(function() {
var mmctype = netrank;
if (netrank === 6) mmctype--;
if ($(".vlist_entv:contains('" + virusData['Mimic'].virus[mmctype].name + "')").length > 0) {
alert("No more than one Mimic per battle!");
}
else {
var tvirus = "<span class='vlist_remv'><span class='vlist_entv'>" + virusData['Mimic'].virus[mmctype].name + "</span>: "+ virusData['Mimic'].virus[mmctype].hpts + " HP" + "<br></span>";
$('#vlist_tempvirus').append(tvirus);
$('.vlist_mdhp').html($('.vlist_entv').length*5);
$(".vlist_remv").unbind( "click" );
$('.vlist_remv').click(function() {
$(this).remove();
$('.vlist_mdhp').html($('#vlist_tempvirus .vlist_entv').length*5);
});
$('#vlist_info1').show();
$('#vlist_info1').html("<strong>" + virusData['Mimic'].virus[mmctype].name + "</strong> <a href='" + virusData['Mimic'].family_url + "'>(Mimic)</a><br><br>");
$('#vlist_info1').append(virusData['Mimic'].family_note, "<br><br>");
$('#vlist_info1').append(virusData['Mimic'].virus[mmctype].desc);
}
});
$('#vlist_rmmc').click(function() {
var mmctype = netrank+1;
if (netrank === 6) mmctype--;
if ($(".vlist_entv:contains('" + virusData['Mimic'].virus[mmctype].name + "')").length > 0) {
alert("No more than one Mimic per battle!");
}
else {
var tvirus = "<span class='vlist_remv'><span class='vlist_entv'>" + virusData['Mimic'].virus[mmctype].name + "</span>: "+ virusData['Mimic'].virus[mmctype].hpts + " HP" + "<br></span>";
$('#vlist_tempvirus').append(tvirus);
$('.vlist_mdhp').html($('.vlist_entv').length*5);
$(".vlist_remv").unbind( "click" );
$('.vlist_remv').click(function() {
$(this).remove();
$('.vlist_mdhp').html($('#vlist_tempvirus .vlist_entv').length*5);
});
$('#vlist_info1').show();
$('#vlist_info1').html("<strong>" + virusData['Mimic'].virus[mmctype].name + "</strong> <a href='" + virusData['Mimic'].family_url + "'>(Mimic)</a><br><br>");
$('#vlist_info1').append(virusData['Mimic'].family_note, "<br><br>");
$('#vlist_info1').append(virusData['Mimic'].virus[mmctype].desc);
}
});
$('#vlist_random').click(function() {
$('#vlist_reset').click();
for (i = 0; i < maxbat*netnavi; i++) {
if (maxbat*netnavi - i < 3) $('.vlist_add').not('.vlist_addm').eq(Math.floor(Math.random()*$('.vlist_add').length)).click();
else {
randi = Math.floor(Math.random()*$('.vlist_add').length);
$('.vlist_add').eq(randi).click();
if ($('.vlist_add').eq(randi).hasClass('vlist_addm')) i += 2;
}
}
var totalterr = 100;
var rterr = 0;
shuffle($(".vlist_addland")).slice(0, 4).each(function(index, entry){
entry.click();
rterr = Math.round(Math.random()*totalterr/5)*5;
$('.vlist_landq').last().html(rterr);
totalterr -= rterr;
});
if (totalterr > 0) {
var remterr = parseInt($('.vlist_landq').last().html(), 10);
$('.vlist_landq').last().html(remterr + totalterr);
}
$('.vlist_landq').each(function() {
if (parseInt($(this).html()) === 0) $(this).parent().remove();
});
$('#vlist_md').click();
randi = Math.floor(Math.random()*4);
while (randi--) $('#vlist_addobj').click();
});
$('#vlist_clear').click(function() {
$('#vlist_res').empty();
$('#vlist_resex').empty();
});
$('#vlist_md').click(function() {
if ($('.vlist_mdhp').length > 0) alert ("No more than one Mystery Data per battle!");
else {
var rollmd = Math.floor(6*Math.random())+1;
var typemd = 0;
var textmd = "";
if (rollmd > 3) {
alert("Mystery Data roll failed. 2 optional MDs may still be awarded per thread.");
}
else {
if (rollmd === 1 && netbat > 10) typemd += 2;
typemd += netrank;
switch (typemd) {
case 0: textmd = "GMD: "; alert("Green Mystery Data found!"); break;
case 2: textmd = "BMD: "; alert("Blue Mystery Data found!"); break;
case 4: textmd = "PMD: "; alert("Purple Mystery Data found!"); break;
case 6: textmd = "RMD: "; alert("Red Mystery Data found!"); break;
case 8: textmd = "YMD: "; alert("Yellow Mystery Data found!"); break;
}
var mdhp;
if ($('#vlist_tempvirus').html === "") mdhp = 0;
else mdhp = $('.vlist_entv').length*5;
var tempmd = "<span class='vlist_remd'>" + textmd + "<span class='vlist_mdhp'>" + mdhp + "</span> HP<br></span>";
$('#vlist_tempobj').append(tempmd);
$('.vlist_remd').unbind('dblclick');
$('.vlist_remd').dblclick(function() { $(this).remove(); });
}
}
});
});
function shuffle(array) {
var m = array.length, t, i;
// While there remain elements to shuffle…
while (m) {
// Pick a remaining element…
i = Math.floor(Math.random() * m--);
// And swap it with the current element.
t = array[m];
array[m] = array[i];
array[i] = t;
}
return array;
}
</script>