-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.html
1078 lines (969 loc) · 57.7 KB
/
index.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
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<title>Rng 76 - Hunt for the TSE</title>
<style>
* {
font-family: sans-serif;
font-size: 22px;
}
</style>
</head>
<body style="height: 90%">
<center>
<h1 style="font-size: 36px;">Rng 76 - Hunt for the TSE</h1>
</center>
<table style="width: 100%; height: 100%; border-top: 1px solid black;">
<tr valign="top">
<td>
<button id="btnRoll"><img id="imgRoll" src="Fo76.png"></button>
<br/><br/>
<a href="https://docs.google.com/spreadsheets/d/1L5c8ZKCCf4OaNglGc516dl9AFxYWnMUDuhQbHjrlQkQ/edit#gid=0" target="_blank">Effects</a>,
<a href="http://fallout.wikia.com/wiki/Fallout_76_armor_and_clothing" target="_blank">Armors</a>,
<a href="http://fallout.wikia.com/wiki/Fallout_76_weapons" target="_blank">Weapons</a>,
<a href="https://www.kisspng.com/png-fallout-76-the-elder-scrolls-v-skyrim-fallout-4-el-6255197/" target="_blank">Gear image</a>
<br/><br/><input type="checkbox" id="cbInstant">Instant reward
<br/><br/><button id="btnClear">Clear history</button>
<br/><br/><a href="https://github.com/akarnokd/rng-76" target="_blank">GitHub repo</a>
<br/><br/>Multi-roll count: <input type="text" id="txtCount" style="width: 100px; text-align: right;" value="5000"/> <button id="btnMultiRoll">Run</button>
<br/><br/><a href="changes.html" target="_blank">Version History</a>
</td>
<td width="75%">
<table style="width: 100%; height: 100%">
<tr><td id="txtDrop" style="height: 180px" valign="top"><----- Click</td></tr>
<tr><td>
<textarea style="width: 100%; height: 100%; resize: none;" id="txtHistory" value=""></textarea>
</td></tr>
</table>
</td>
<td width="25%">
<table style="width: 100%; border-collapse: collapse;">
<tr>
<td style="text-align: center; font-weight: bold; font-size: 25px;" colspan="3">Statistics</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td>Armor pool items:</td>
<td id="txtArmorPool" style="text-align: right;">0</td>
<td id="txtArmorPoolPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Ranged pool items:</td>
<td id="txtRangedPool" style="text-align: right;">0</td>
<td id="txtRangedPoolPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Melee pool items:</td>
<td id="txtMeleePool" style="text-align: right;">0</td>
<td id="txtMeleePoolPercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td><b>Rolls:</b></td>
<td id="txtTotalRolls" style="text-align: right; font-weight: bold;">0</td>
<td id="txtTotalRollsPercent" style="text-align: right;"> </td>
</tr>
<tr style='border-top: 1px solid black;'>
<td>Enemy ★:</td>
<td id="txtTotalEnemy1Star" style="text-align: right;">0</td>
<td id="txtTotalEnemy1StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Enemy ★★:</td>
<td id="txtTotalEnemy2Star" style="text-align: right;">0</td>
<td id="txtTotalEnemy2StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Enemy ★★★:</td>
<td id="txtTotalEnemy3Star" style="text-align: right;">0</td>
<td id="txtTotalEnemy3StarPercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td>Loot ★:</td>
<td id="txtTotal1Star" style="text-align: right;">0</td>
<td id="txtTotal1StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Loot ★★:</td>
<td id="txtTotal2Star" style="text-align: right;">0</td>
<td id="txtTotal2StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Loot ★★★:</td>
<td id="txtTotal3Star" style="text-align: right;">0</td>
<td id="txtTotal3StarPercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td><b>Armor drops:</b></td>
<td id="txtTotalArmor" style="text-align: right;">0</td>
<td id="txtTotalArmorPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Armor ★:</td>
<td id="txtTotalArmor1Star" style="text-align: right;">0</td>
<td id="txtTotalArmor1StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Armor ★★:</td>
<td id="txtTotalArmor2Star" style="text-align: right;">0</td>
<td id="txtTotalArmor2StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Armor ★★★:</td>
<td id="txtTotalArmor3Star" style="text-align: right;">0</td>
<td id="txtTotalArmor3StarPercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td><b>Ranged drops:</b></td>
<td id="txtTotalRanged" style="text-align: right;">0</td>
<td id="txtTotalRangedPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Ranged ★:</td>
<td id="txtTotalRanged1Star" style="text-align: right;">0</td>
<td id="txtTotalRanged1StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Ranged ★★:</td>
<td id="txtTotalRanged2Star" style="text-align: right;">0</td>
<td id="txtTotalRanged2StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Ranged ★★★:</td>
<td id="txtTotalRanged3Star" style="text-align: right;">0</td>
<td id="txtTotalRanged3StarPercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td><b>Melee drops:</b></td>
<td id="txtTotalMelee" style="text-align: right;">0</td>
<td id="txtTotalMeleePercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Melee ★:</td>
<td id="txtTotalMelee1Star" style="text-align: right;">0</td>
<td id="txtTotalMelee1StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Melee ★★:</td>
<td id="txtTotalMelee2Star" style="text-align: right;">0</td>
<td id="txtTotalMelee2StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Melee ★★★:</td>
<td id="txtTotalMelee3Star" style="text-align: right;">0</td>
<td id="txtTotalMelee3StarPercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td>Two-shot ★:</td>
<td id="txtTotalTS" style="text-align: right;">0</td>
<td id="txtTotalTSPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Two-shot Explosive ★★:</td>
<td id="txtTotalTSE" style="text-align: right;">0</td>
<td id="txtTotalTSEPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Two-shot Explosive ★★★:</td>
<td id="txtTotalTSE3Star" style="text-align: right;">0</td>
<td id="txtTotalTSE3StarPercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td>TS Handmade ★:</td>
<td id="txtTotalTSHandmade" style="text-align: right;">0</td>
<td id="txtTotalTSHandmadePercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>TSE Handmade ★★:</td>
<td id="txtTotalTSEHandmade" style="text-align: right;">0</td>
<td id="txtTotalTSEHandmadePercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>TSE Handmade ★★★:</td>
<td id="txtTotalTSE3StarHandmade" style="text-align: right;">0</td>
<td id="txtTotalTSE3StarHandmadePercent" style="text-align: right;">0%</td>
</tr>
<tr style='border-top: 1px solid black;'>
<td>Explosive ★★:</td>
<td id="txtTotalExplosive2Star" style="text-align: right;">0</td>
<td id="txtTotalExplosive2StarPercent" style="text-align: right;">0%</td>
</tr>
<tr>
<td>Explosive ★★★:</td>
<td id="txtTotalExplosive3Star" style="text-align: right;">0</td>
<td id="txtTotalExplosive3StarPercent" style="text-align: right;">0%</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO -->
<script>
// Global statistics
// -----------------
var totalRolls = 0;
var totalArmor = 0;
var totalArmor1Star = 0;
var totalArmor2Star = 0;
var totalArmor3Star = 0;
var totalMelee = 0;
var totalMelee1Star = 0;
var totalMelee2Star = 0;
var totalMelee3Star = 0;
var totalRanged = 0;
var totalRanged1Star = 0;
var totalRanged2Star = 0;
var totalRanged3Star = 0;
var totalTS = 0;
var totalTSE = 0;
var totalTSE3Star = 0;
var totalTSHandmade = 0;
var totalTSEHandmade = 0;
var totalTSE3StarHandmade = 0;
var totalEnemy1Star = 0;
var totalEnemy2Star = 0;
var totalEnemy3Star = 0;
var total1Star = 0;
var total2Star = 0;
var total3Star = 0;
var totalExplosive2Star = 0;
var totalExplosive3Star = 0;
var multiRollMode = false;
var multiRollCount = 0;
// oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
// Legendary enemy chances
// -------------------------
var enemySpawnRatio = [60, 30, 10];
var legendaryDropRatios = [
[100],
[80, 20],
[60, 30, 10]
];
var enemyNames = [
"Ghoul",
"Scorched",
"Wolf",
"Super Mutant",
"Mutant Hound",
"Protectron",
"Robobrain",
"Deathclaw",
"Molerat",
"Wendigo",
"Mirelurk Queen",
"Mirelurk King",
"Mirelurk",
"Gutsy",
"Nightclawler",
"Ant",
"Bloodbug",
"Bloatfly",
"Angler",
"Gulper",
"Sloth"
];
// oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
// Item database
// -------------
var items = [];
function addItem(category, name, ratio) {
items.push({
category: category,
name: name,
ratio: ratio
});
}
// Melee weapons
addItem("Melee", "Combat Knife", 1);
addItem("Melee", "Super Sledge", 1);
addItem("Melee", "Switchblade", 1);
addItem("Melee", "Pickaxe", 1);
addItem("Melee", "Power Fist", 1);
addItem("Melee", "Knuckles", 1);
addItem("Melee", "Boxing Glove", 1);
addItem("Melee", "Pitchfork", 1);
addItem("Melee", "Shishkebab", 1);
addItem("Melee", "Machete", 1);
addItem("Melee", "Spear", 1);
addItem("Melee", "Ripper", 1);
addItem("Melee", "Mr. Handy Buzz Blade", 1);
addItem("Melee", "Assaultron Blade", 1);
addItem("Melee", "Bovie knife", 1);
addItem("Melee", "Chinese Officer Sword", 1);
addItem("Melee", "Cultist Blade", 1);
addItem("Melee", "Cultist Dagger", 1);
addItem("Melee", "Guitar Sword", 1);
addItem("Melee", "Lead Pipe", 1);
addItem("Melee", "Pipe Wrench", 1);
addItem("Melee", "Revolutionary Sword", 1);
addItem("Melee", "Rolling Pin", 1);
addItem("Melee", "Baton", 1);
addItem("Melee", "Sickle", 1);
addItem("Melee", "Ski Sword", 1);
addItem("Melee", "Black Diamond", 1);
addItem("Melee", "Walking Cane", 1);
addItem("Melee", "Tire Iron", 1);
addItem("Melee", "Baseball Bat", 1);
addItem("Melee", "Board", 1);
addItem("Melee", "Fire Axe", 1);
addItem("Melee", "Golf Club", 1);
addItem("Melee", "Grognak's Axe", 1);
addItem("Melee", "Multi-purpose Axe", 1);
addItem("Melee", "Pole hook", 1);
addItem("Melee", "Pool cue", 1);
addItem("Melee", "War drum", 1);
addItem("Melee", "Death Tambo", 1);
addItem("Melee", "Deathclaw Gauntlet", 1);
addItem("Melee", "Mole Miner Gauntlet", 1);
addItem("Melee", "Meat hook", 1);
// Ranged weapons
addItem("Ranged", ".44 Pistol", 1);
addItem("Ranged", "10mm Pistol", 1);
addItem("Ranged", "Handmade Rifle", 1);
addItem("Ranged", "Hunting Rifle", 1);
addItem("Ranged", "10mm SMG", 1);
addItem("Ranged", "Submachine Gun", 1);
addItem("Ranged", "Gatling Plasma", 1);
addItem("Ranged", "Gatling Laser", 1);
addItem("Ranged", "Ultracite Gatling Laser", 1);
addItem("Ranged", "Gatling Gun", 1);
addItem("Ranged", "Minigun", 1);
addItem("Ranged", "50 cal Machine Gun", 1);
addItem("Ranged", "Western Revolver", 1);
addItem("Ranged", "Pump-action Shotgun", 1);
addItem("Ranged", "Combat Shotgun", 1);
addItem("Ranged", "Combat Rifle", 1);
addItem("Ranged", "Plasma Gun", 1);
addItem("Ranged", "Laser Pistol", 1);
addItem("Ranged", "Ultracite Laser Gun", 1);
addItem("Ranged", "Laser Rifle", 1);
addItem("Ranged", "Tesla Rifle", 1);
addItem("Ranged", "Broadsider", 1);
addItem("Ranged", "Single Action Revolver", 1);
addItem("Ranged", "Black Powder Pistol", 1);
addItem("Ranged", "Black Powder Rifle", 1);
addItem("Ranged", "Black Powder Blunderbuss", 1);
addItem("Ranged", "The Dragon", 1);
addItem("Ranged", "Harpoon Gun", 1);
addItem("Ranged", "Flamer", 1);
addItem("Ranged", "Assault Rifle", 1);
addItem("Ranged", "Crossbow", 1);
addItem("Ranged", "Gauss Rifle", 1);
addItem("Ranged", "Lever Action Rifle", 1);
addItem("Ranged", "Radium Rifle", 1);
addItem("Ranged", "Railway Rifle", 1);
addItem("Ranged", "Syringer", 1);
addItem("Ranged", "Double-barrel Shotgun", 1);
addItem("Ranged", "Pipe Gun", 1);
addItem("Ranged", "Pipe Bolt-action", 1);
addItem("Ranged", "Pipe Revolver", 1);
addItem("Ranged", "Light Machine Gun", 1);
addItem("Ranged", "Cryolator", 1);
addItem("Ranged", "Salvaged Assaultron Head", 1);
addItem("Ranged", "Gamma Gun", 1);
addItem("Ranged", "Auto Grenade Launcher", 1);
addItem("Ranged", "Fat Man", 1);
addItem("Ranged", "M79 Grenade Launcher", 1);
addItem("Ranged", "Missile Launcher", 1);
// oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
// Armors
// ------
// Leather
addItem("Armor", "Leather Chest Piece", 1);
addItem("Armor", "Leather Left Arm", 1);
addItem("Armor", "Leather Right Arm", 1);
addItem("Armor", "Leather Left Leg", 1);
addItem("Armor", "Leather Right Leg", 1);
addItem("Armor", "Sturdy Leather Chest Piece", 1);
addItem("Armor", "Sturdy Leather Left Arm", 1);
addItem("Armor", "Sturdy Leather Right Arm", 1);
addItem("Armor", "Sturdy Leather Left Leg", 1);
addItem("Armor", "Sturdy Leather Right Leg", 1);
addItem("Armor", "Heavy Leather Chest Piece", 1);
addItem("Armor", "Heavy Leather Left Arm", 1);
addItem("Armor", "Heavy Leather Right Arm", 1);
addItem("Armor", "Heavy Leather Left Leg", 1);
addItem("Armor", "Heavy Leather Right Leg", 1);
// Metal
addItem("Armor", "Metal Chest Piece", 1);
addItem("Armor", "Metal Left Arm", 1);
addItem("Armor", "Metal Right Arm", 1);
addItem("Armor", "Metal Left Leg", 1);
addItem("Armor", "Metal Right Leg", 1);
addItem("Armor", "Sturdy Metal Chest Piece", 1);
addItem("Armor", "Sturdy Metal Left Arm", 1);
addItem("Armor", "Sturdy Metal Right Arm", 1);
addItem("Armor", "Sturdy Metal Left Leg", 1);
addItem("Armor", "Sturdy Metal Right Leg", 1);
addItem("Armor", "Heavy Metal Chest Piece", 1);
addItem("Armor", "Heavy Metal Left Arm", 1);
addItem("Armor", "Heavy Metal Right Arm", 1);
addItem("Armor", "Heavy Metal Left Leg", 1);
addItem("Armor", "Heavy Metal Right Leg", 1);
// Combat
addItem("Armor", "Combat Armor Chest Piece", 1);
addItem("Armor", "Combat Armor Left Arm", 1);
addItem("Armor", "Combat Armor Right Arm", 1);
addItem("Armor", "Combat Armor Left Leg", 1);
addItem("Armor", "Combat Armor Right Leg", 1);
addItem("Armor", "Sturdy Combat Armor Chest Piece", 1);
addItem("Armor", "Sturdy Combat Armor Left Arm", 1);
addItem("Armor", "Sturdy Combat Armor Right Arm", 1);
addItem("Armor", "Sturdy Combat Armor Left Leg", 1);
addItem("Armor", "Sturdy Combat Armor Right Leg", 1);
addItem("Armor", "Heavy Combat Armor Chest Piece", 1);
addItem("Armor", "Heavy Combat Armor Left Arm", 1);
addItem("Armor", "Heavy Combat Armor Right Arm", 1);
addItem("Armor", "Heavy Combat Armor Left Leg", 1);
addItem("Armor", "Heavy Combat Armor Right Leg", 1);
// Robot
addItem("Armor", "Robot Armor Chest Piece", 1);
addItem("Armor", "Robot Armor Left Arm", 1);
addItem("Armor", "Robot Armor Right Arm", 1);
addItem("Armor", "Robot Armor Left Leg", 1);
addItem("Armor", "Robot Armor Right Leg", 1);
addItem("Armor", "Robot Sturdy Armor Chest Piece", 1);
addItem("Armor", "Robot Sturdy Armor Left Arm", 1);
addItem("Armor", "Robot Sturdy Armor Right Arm", 1);
addItem("Armor", "Robot Sturdy Armor Left Leg", 1);
addItem("Armor", "Robot Sturdy Armor Right Leg", 1);
addItem("Armor", "Robot Heavy Armor Chest Piece", 1);
addItem("Armor", "Robot Heavy Armor Left Arm", 1);
addItem("Armor", "Robot Heavy Armor Right Arm", 1);
addItem("Armor", "Robot Heavy Armor Left Leg", 1);
addItem("Armor", "Robot Heavy Armor Right Leg", 1);
// Marine
addItem("Armor", "Marine Armor Chest Piece", 1);
addItem("Armor", "Marine Armor Left Arm", 1);
addItem("Armor", "Marine Armor Right Arm", 1);
addItem("Armor", "Marine Armor Left Leg", 1);
addItem("Armor", "Marine Armor Right Leg", 1);
// Trapper
addItem("Armor", "Trapper Chest Piece", 1);
addItem("Armor", "Trapper Left Arm", 1);
addItem("Armor", "Trapper Right Arm", 1);
addItem("Armor", "Trapper Left Leg", 1);
addItem("Armor", "Trapper Right Leg", 1);
addItem("Armor", "Heavy Trapper Chest Piece", 1);
addItem("Armor", "Heavy Trapper Left Arm", 1);
addItem("Armor", "Heavy Trapper Right Arm", 1);
addItem("Armor", "Heavy Trapper Left Leg", 1);
addItem("Armor", "Heavy Trapper Right Leg", 1);
// Scout
addItem("Armor", "Forrest Scout Armor Chest Piece", 1);
addItem("Armor", "Forrest Scout Armor Left Arm", 1);
addItem("Armor", "Forrest Scout Armor Right Arm", 1);
addItem("Armor", "Forrest Scout Armor Left Leg", 1);
addItem("Armor", "Forrest Scout Armor Right Leg", 1);
// Urban Scout Armor doesn't seem to exist as legendary drop
// addItem("Armor", "Urban Scout Armor Chest Piece", 1);
// addItem("Armor", "Urban Scout Armor Left Arm", 1);
// addItem("Armor", "Urban Scout Armor Right Arm", 1);
// addItem("Armor", "Urban Scout Armor Left Leg", 1);
// addItem("Armor", "Urban Scout Armor Right Leg", 1);
// Wooden
addItem("Armor", "Wooden Chest Piece", 1);
addItem("Armor", "Wooden Left Arm", 1);
addItem("Armor", "Wooden Right Arm", 1);
addItem("Armor", "Wooden Left Leg", 1);
addItem("Armor", "Wooden Right Leg", 1);
// Raider
addItem("Armor", "Raider Chest Piece", 1);
addItem("Armor", "Raider Left Arm", 1);
addItem("Armor", "Raider Right Arm", 1);
addItem("Armor", "Raider Left Leg", 1);
addItem("Armor", "Raider Right Leg", 1);
addItem("Armor", "Sturdy Raider Chest Piece", 1);
addItem("Armor", "Sturdy Raider Left Arm", 1);
addItem("Armor", "Sturdy Raider Right Arm", 1);
addItem("Armor", "Sturdy Raider Left Leg", 1);
addItem("Armor", "Sturdy Raider Right Leg", 1);
addItem("Armor", "Heavy Raider Chest Piece", 1);
addItem("Armor", "Heavy Raider Left Arm", 1);
addItem("Armor", "Heavy Raider Right Arm", 1);
addItem("Armor", "Heavy Raider Left Leg", 1);
addItem("Armor", "Heavy Raider Right Leg", 1);
// oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
// Legendary effects database
// --------------------------
var effects = [];
function addEffect(category, level, name, description, ratio) {
effects.push({
category: category,
level: level,
name: name,
description: description,
ratio: ratio
});
}
// Melee effects, prefixes
addEffect("Melee", 0, "Bloodied", "Does more damage the lower your health is", 1);
addEffect("Melee", 0, "Furious", "Damage increased after each consecutive hit on the same target", 1);
addEffect("Melee", 0, "Instigating", "Double damage if target is full health", 1);
addEffect("Melee", 0, "Anti-armor", "Ignores 50% of your target's armor", 1);
addEffect("Melee", 0, "Vampire's", "Gain brief health regeneration when you hit an enemy", 1);
addEffect("Melee", 0, "Berserker's", "More damage the lower your damage resistance", 1);
addEffect("Melee", 0, "Junkie's", "More damage the more your withdrawal effects", 1);
addEffect("Melee", 0, "Suppressor's", "Reduce your target's damage output by 20% for 3s", 1);
addEffect("Melee", 0, "Assassin's", "+10% damage to players", 1);
addEffect("Melee", 0, "Nocturnal", "Damage increased by the night and reduced by the day", 1);
addEffect("Melee", 0, "Mutant's", "Damage increased by 10% if you are mutated", 1);
addEffect("Melee", 0, "Stalker's", "If not in combat, 100% VATS accuracy at 50% increased AP cost", 1);
addEffect("Melee", 0, "Executioner's", "50% increased damage if target is below 40% health", 1);
addEffect("Melee", 0, "Troubleshooter's", "+30% damage to robots", 1);
addEffect("Melee", 0, "Ghoul slayer's", "+30% damage to ghouls", 1);
addEffect("Melee", 0, "Mutant slayer's", "+30% damage to super mutants", 1);
addEffect("Melee", 0, "Hunter's", "+30% damage to animals", 1);
addEffect("Melee", 0, "Exterminator's", "+30% damage to Mirelurks and bugs", 1);
addEffect("Melee", 0, "Zealot's", "+30% damage to scorched", 1);
// Melee effects, major
addEffect("Melee", 1, "Limb", "+50% limb damage", 1);
addEffect("Melee", 1, "Speed", "40% increased swing speed", 1);
addEffect("Melee", 1, "Power", "40% more power attack damage", 1);
addEffect("Melee", 1, "Reflect", "Reflect 50% of damage while blocking", 1);
// Melee effects, minor
addEffect("Melee", 2, "Strength", "+1 Strength", 1);
addEffect("Melee", 2, "Endurance", "+1 Endurance", 1);
addEffect("Melee", 2, "Agility", "+1 Agility", 1);
addEffect("Melee", 2, "Powerdamage", "Take 40% less damage while power attacking", 1);
addEffect("Melee", 2, "Blocking", "Take 15% less damage while blocking", 1);
addEffect("Melee", 2, "Weight", "90% reduced weight", 1);
// Ranged effects, prefix
addEffect("Ranged", 0, "Bloodied", "Does more damage the lower your health is", 1);
addEffect("Ranged", 0, "Furious", "Damage increased after each consecutive hit on the same target", 1);
addEffect("Ranged", 0, "Instigating", "Double damage if target is full health", 1);
addEffect("Ranged", 0, "Anti-armor", "Ignores 50% of your target's armor", 1);
addEffect("Ranged", 0, "Vampire's", "Gain brief health regeneration when you hit an enemy", 1);
addEffect("Ranged", 0, "Berserker's", "More damage the lower your damage resistance", 1);
addEffect("Ranged", 0, "Junkie's", "More damage the more your withdrawal effects", 1);
addEffect("Ranged", 0, "Suppressor's", "Reduce your target's damage output by 20% for 3s", 1);
addEffect("Ranged", 0, "Assassin's", "+10% damage to players", 1);
addEffect("Ranged", 0, "Nocturnal", "Damage increased by the night and reduced by the day", 1);
addEffect("Ranged", 0, "Mutant's", "Damage increased by 10% if you are mutated", 1);
addEffect("Ranged", 0, "Stalker's", "If not in combat 100% VATS accuracy at 50% increased AP cost", 1);
addEffect("Ranged", 0, "Executioner's", "50% increased damage if target is below 40% health", 1);
addEffect("Ranged", 0, "Troubleshooter's", "+30% damage to robots", 1);
addEffect("Ranged", 0, "Ghoul slayer's", "+30% damage to ghouls", 1);
addEffect("Ranged", 0, "Mutant slayer's", "+30% damage to super mutants", 1);
addEffect("Ranged", 0, "Hunter's", "+30% damage to animals", 1);
addEffect("Ranged", 0, "Exterminator's", "+30% damage to Mirelurks and bugs", 1);
addEffect("Ranged", 0, "Zealot's", "+30% damage to scorched", 1);
addEffect("Ranged", 0, "Medic's", "VATS criticals will heal you and your group", 1);
addEffect("Ranged", 0, "Two shot", "Shoots an additional projectile", 1);
addEffect("Ranged", 0, "Quad", "Quadruple ammo capacity", 1);
addEffect("Ranged", 0, "Double", "Double ammo capacity", 1);
// Ranged effects, major
addEffect("Ranged", 1, "VATSCritical", "VATS critical shots do +50% damage", 1);
addEffect("Ranged", 1, "FireRate", "25% increased fire rate", 1);
addEffect("Ranged", 1, "Bashing", "Bashing damage increased by 40%", 1);
addEffect("Ranged", 1, "AimDamage", "10% increased damage while aiming", 1);
addEffect("Ranged", 1, "Explosive", "Bullets explode for area damage", 1);
addEffect("Ranged", 1, "VATSChance", "+33% VATS hits chance", 1);
addEffect("Ranged", 1, "Limb", "+50% limb damage", 1);
// Ranged effects, minor
addEffect("Ranged", 2, "Perception", "+1 Perception", 1);
addEffect("Ranged", 2, "Agility", "+1 Agility", 1);
addEffect("Ranged", 2, "VATSAction", "25% less VATS Action Point cost", 1);
addEffect("Ranged", 2, "VATSCriticalMeter", "Your VATS critical meter fills 15% faster", 1);
addEffect("Ranged", 2, "MoveAim", "Move faster while aiming", 1);
addEffect("Ranged", 2, "ResistAim", "+50 damage resistance while aiming", 1);
addEffect("Ranged", 2, "ResistReload", "+250 damage resistance while reloading", 1);
addEffect("Ranged", 2, "ReloadSpeed", "15% faster reload", 1);
addEffect("Ranged", 2, "Weight", "90% reduced wight", 1);
// Ranged effects, prefix
addEffect("Armor", 0, "Auto stim", "Automatically use a Stimpak when hit while health is 25% or less, once every 60 seconds", 1);
addEffect("Armor", 0, "Life saving", "While incapacitated, gain 50% chance to revive yourself with a Stimpak, once every minute", 1);
addEffect("Armor", 0, "Weightless", "Weighs 90% less and does not count as armor for the Chameleon mutation", 1);
addEffect("Armor", 0, "Chameleon", "Blend with the environment while sneaking and not moving", 1);
addEffect("Armor", 0, "Cloaking", "Being hit in melee generates a Stealth field once per 30 seconds", 1);
addEffect("Armor", 0, "Regenerating", "Slowly regenerate health while out of combat", 1);
addEffect("Armor", 0, "Vanguard's", "Grants up to 35 Damage and Energy Resistance, the higher your health", 1);
addEffect("Armor", 0, "Bolstering", "Grants up to 35 Damage and Energy Resistance, the lower your health", 1);
addEffect("Armor", 0, "Unyielding", "Gain +3 to all stats except END when low on health", 1);
addEffect("Armor", 0, "Nocturnal", "Damage and Energy Resist increase with the night and decrease with the day", 1);
addEffect("Armor", 0, "Assassin's", "-8% damage from players", 1);
addEffect("Armor", 0, "Exterminator's", "-15% damage from Mirelurks and bugs", 1);
addEffect("Armor", 0, "Hunter's", "-15% damage from animals", 1);
addEffect("Armor", 0, "Troubleshooter's", "-15% damage from robots", 1);
addEffect("Armor", 0, "Ghoul slayer's", "-15% damage from ghouls", 1);
addEffect("Armor", 0, "Mutant slayer's", "-15% damage from super mutants", 1);
addEffect("Armor", 0, "Zealot's", "-15% damage from scorched", 1);
addEffect("Armor", 0, "Mutant's", "+10 Damage and Energy Resist if you are mutated", 1);
// Ranged effects, major
addEffect("Armor", 1, "Strength", "+1 Strength", 1);
addEffect("Armor", 1, "Perception", "+1 Perception", 1);
addEffect("Armor", 1, "Endurance", "+1 Endurance", 1);
addEffect("Armor", 1, "Charisma", "+1 Charisma", 1);
addEffect("Armor", 1, "Intelligence", "+1 Intelligence", 1);
addEffect("Armor", 1, "Agility", "+1 Agility", 1);
addEffect("Armor", 1, "Luck", "+1 Luck", 1);
addEffect("Armor", 1, "Powered", "Increases action point refresh speed", 1); // can be an additiona prefix
addEffect("Armor", 1, "RadiationResist", "+25 radiation resist", 1);
addEffect("Armor", 1, "Poisoner's", "+25 poison resistance", 1); // can replace a 's prefix
// Ranged effects, minor
addEffect("Armor", 2, "AmmoWeight", "Ammo weight reduced by 20%", 1);
addEffect("Armor", 2, "WeaponWeight", "Weapon weights reduced by 20%", 1);
addEffect("Armor", 2, "FoodWeight", "Food, drink and chem weights reduced by 20%", 1);
addEffect("Armor", 2, "JunkWeight", "Junk weight reduced by 20%", 1);
addEffect("Armor", 2, "BreatheUnderwater", "Grants the ability to breathe underwater", 1);
addEffect("Armor", 2, "Sneak", "Become harder to detect while sneaking", 1);
addEffect("Armor", 2, "Durable", "50% more durability than normal", 1);
addEffect("Armor", 2, "Sentinel's", "Reduces damage while standing and not moving by 15%", 1); // can replace a 's prefix
addEffect("Armor", 2, "BlockingDamage", "Reduces damage while blocking by 15%", 1);
addEffect("Armor", 2, "SprintDamage", "Reduces damage while sprinting by 15%", 1);
addEffect("Armor", 2, "Acrobat's", "Falling damage reduced by 50%", 1); // can replace a 's prefix
addEffect("Armor", 2, "Lockpick", "Increases size of the sweet spot while picking locks", 1);
// oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
// Loot calculation
// ----------------
function lootDrop() {
totalRolls++;
// pick an enemy name, for
var enemyName = enemyNames[Math.floor(Math.random() * enemyNames.length)];
var dropHTML = "<center><u><font color='red' style='font-size: 30px; font-weight: bold;'>Legendary " + enemyName + " ";
// pick an legendary enemy level
var lvl = pickRatiodRandom(enemySpawnRatio,
function(v) { return true; },
function(v) { return v; }
);
if (lvl == 0) {
totalEnemy1Star++;
dropHTML += "★";
} else if (lvl == 1) {
totalEnemy2Star++;
dropHTML += "★★";
} else {
totalEnemy3Star++;
dropHTML += "★★★";
}
dropHTML += "</font></u><br/><font style='font-size: 10px'> </font><br/>";
// pick the star level of the drop
var dropStars = pickRatiodRandom(legendaryDropRatios[lvl],
function(v) { return true; },
function(v) { return v; }
);
// pick an item
var dropItemIndex = pickRatiodRandom(items,
function(v) { return true; },
function(v) { return v.ratio; }
);
var dropItem = items[dropItemIndex];
// Wooden Armor is limited to 1*
if (dropItem.name.includes("Wooden")) {
dropStars = 0;
}
// account star count for drops
if (dropStars == 0) {
total1Star++;
} else if (dropStars == 1) {
total2Star++;
} else {
total3Star++;
}
var itemCategory = dropItem.category;
// special case: black powder can't be double/quad
var isBlackpowder = dropItem.name.includes("Black Powder")
|| dropItem.name.includes("The Dragon");
// pick a legendary prefix, always
var itemPrefixIndex = pickRatiodRandom(effects,
function(v) {
return v.category == itemCategory && v.level == 0
&& !(isBlackpowder && (v.name == "Double" || v.name == "Quad"));
},
function(v) { return v.ratio; }
);
// if at least 2*, pick a Major
var itemMajorIndex = -1;
if (dropStars >= 1) {
// special case: default explosive weapons can't get the explosive effect again
// patch 5: flamers, cryolators, plasma and laser can't spawn as explosive anymore
var isAlreadyExplosive = dropItem.name.includes("Launcher")
|| dropItem.name.includes("Fat Man")
|| dropItem.name.includes("Broadsider")
|| dropItem.name.includes("Laser")
|| dropItem.name.includes("Plasma")
|| dropItem.name.includes("Cryolator")
|| dropItem.name.includes("Flamer")
;
itemMajorIndex = pickRatiodRandom(effects,
function(v) {
return v.category == itemCategory && v.level == 1
&& !(isAlreadyExplosive && v.name == "Explosive");
},
function(v) { return v.ratio; }
);
}
// if a 3*, pick
var itemMinorIndex = -1;
if (dropStars >= 2) {
itemMinorIndex = pickRatiodRandom(effects,
function(v) { return v.category == itemCategory && v.level == 2; },
function(v) { return v.ratio; }
);
}
// prepare the item name, use the prefix name by default
var itemNamePrefix = effects[itemPrefixIndex].name;
if (itemCategory == "Armor") {
// update armor statistics
totalArmor++;
if (dropStars == 0) {
totalArmor1Star++;
} else if (dropStars == 1) {
totalArmor2Star++;
} else {
totalArmor3Star++;
}
// some armor effects override the name prefix
if (itemMinorIndex >= 0) {
var minorName = effects[itemMinorIndex].name;
if (minorName == "Sentinel's" || minorName == "Acrobat's") {
// no two 's in the name, override the previous 's only
if (itemNamePrefix.includes("'s")) {
itemNamePrefix = minorName;
} else {
// prepend otherwise
itemNamePrefix = minorName + " " + itemNamePrefix;
}
}
} else if (itemMajorIndex >= 0) {
var majorName = effects[itemMajorIndex].name;
if (majorName == "Poisoner's") {
// no two 's in the name, override the previous 's only
if (itemNamePrefix.includes("'s")) {
itemNamePrefix = majorName;
} else {
// prepend otherwise
itemNamePrefix = majorName + " " + itemNamePrefix;
}
} else if (majorName == "Powered") {
// example Assassin's Powered Leather Left Leg
itemNamePrefix += " " + majorName
}
}
} else if (itemCategory == "Ranged") {
// update ranged statistics
totalRanged++;
if (dropStars == 0) {
totalRanged1Star++;
} else if (dropStars == 1) {
totalRanged2Star++;
} else {
totalRanged3Star++;
}
// update special statistics
var isHandmade = dropItem.name == "Handmade Rifle" ? 1 : 0;
if (effects[itemPrefixIndex].name == "Two shot") {
totalTS++;
totalTSHandmade += isHandmade;
if (dropStars >= 1 && effects[itemMajorIndex].name == "Explosive") {
totalTSE++;
totalTSEHandmade += isHandmade;
if (dropStars >= 2) {
totalTSE3Star++;
totalTSE3StarHandmade += isHandmade;
}
}
}
if (dropStars >= 1 && effects[itemMajorIndex].name == "Explosive") {
if (dropStars == 1) {
totalExplosive2Star++;
} else {
totalExplosive3Star++;
}
}
} else {
// update melee statistics
totalMelee++;
if (dropStars == 0) {
totalMelee1Star++;
} else if (dropStars == 1) {
totalMelee2Star++;
} else {
totalMelee3Star++;
}
}
var stars = "\u2605".repeat(1 + dropStars);
// add the item main name
dropHTML += "<b>" + itemNamePrefix + " " + dropItem.name + " " + stars + "</b><br/>";
var historyName = itemNamePrefix + " " + dropItem.name + " " + stars;
// show the 1* effect
dropHTML += effects[itemPrefixIndex].description + "<br/>";
historyName += "\r\n " + effects[itemPrefixIndex].description;
// show the 2* effect if present
if (itemMajorIndex >= 0) {
dropHTML += effects[itemMajorIndex].description + "<br/>";
historyName += "\r\n " + effects[itemMajorIndex].description;
}
// show the 3* effect if present
if (itemMinorIndex >= 0) {
dropHTML += effects[itemMinorIndex].description;
historyName += "\r\n " + effects[itemMinorIndex].description;
}
// update labels
// ~~~~~~~~~~~~~
dropHTML += "</center>"
document.getElementById("txtDrop").innerHTML = dropHTML;
if (!multiRollMode
|| dropStars == 2
|| (dropStars == 1 && effects[itemMajorIndex].name == "Explosive")
) {
document.getElementById("txtHistory").value = historyName + "\r\n\r\n" + document.getElementById("txtHistory").value;
}
document.getElementById("txtTotalRolls").innerText = "" + (totalRolls);
document.getElementById("txtTotalEnemy1Star").innerText = "" + (totalEnemy1Star);
document.getElementById("txtTotalEnemy1StarPercent").innerText = "" + (100.0 * totalEnemy1Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalEnemy2Star").innerText = "" + (totalEnemy2Star);
document.getElementById("txtTotalEnemy2StarPercent").innerText = "" + (100.0 * totalEnemy2Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalEnemy3Star").innerText = "" + (totalEnemy3Star);
document.getElementById("txtTotalEnemy3StarPercent").innerText = "" + (100.0 * totalEnemy3Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotal1Star").innerText = "" + (total1Star);
document.getElementById("txtTotal1StarPercent").innerText = "" + (100.0 * total1Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotal2Star").innerText = "" + (total2Star);
document.getElementById("txtTotal2StarPercent").innerText = "" + (100.0 * total2Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotal3Star").innerText = "" + (total3Star);
document.getElementById("txtTotal3StarPercent").innerText = "" + (100.0 * total3Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalArmor").innerText = "" + (totalArmor);
document.getElementById("txtTotalArmorPercent").innerText = "" + (100.0 * totalArmor / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalArmor1Star").innerText = "" + (totalArmor1Star);
document.getElementById("txtTotalArmor1StarPercent").innerText = "" + (100.0 * totalArmor1Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalArmor2Star").innerText = "" + (totalArmor2Star);
document.getElementById("txtTotalArmor2StarPercent").innerText = "" + (100.0 * totalArmor2Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalArmor3Star").innerText = "" + (totalArmor3Star);
document.getElementById("txtTotalArmor3StarPercent").innerText = "" + (100.0 * totalArmor3Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalRanged").innerText = "" + (totalRanged);
document.getElementById("txtTotalRangedPercent").innerText = "" + (100.0 * totalRanged / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalRanged1Star").innerText = "" + (totalRanged1Star);
document.getElementById("txtTotalRanged1StarPercent").innerText = "" + (100.0 * totalRanged1Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalRanged2Star").innerText = "" + (totalRanged2Star);
document.getElementById("txtTotalRanged2StarPercent").innerText = "" + (100.0 * totalRanged2Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalRanged3Star").innerText = "" + (totalRanged3Star);
document.getElementById("txtTotalRanged3StarPercent").innerText = "" + (100.0 * totalRanged3Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalMelee").innerText = "" + (totalMelee);
document.getElementById("txtTotalMeleePercent").innerText = "" + (100.0 * totalMelee / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalMelee1Star").innerText = "" + (totalMelee1Star);
document.getElementById("txtTotalMelee1StarPercent").innerText = "" + (100.0 * totalMelee1Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalMelee2Star").innerText = "" + (totalMelee2Star);
document.getElementById("txtTotalMelee2StarPercent").innerText = "" + (100.0 * totalMelee2Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalMelee3Star").innerText = "" + (totalMelee3Star);
document.getElementById("txtTotalMelee3StarPercent").innerText = "" + (100.0 * totalMelee3Star / totalRolls).toPrecision(3) + "%";
document.getElementById("txtTotalTS").innerText = "" + (totalTS);
document.getElementById("txtTotalTSPercent").innerText = "" + (100.0 * totalTS / totalRolls).toPrecision(6) + "%";
document.getElementById("txtTotalTSE").innerText = "" + (totalTSE);
document.getElementById("txtTotalTSEPercent").innerText = "" + (100.0 * totalTSE / totalRolls).toPrecision(6) + "%";
document.getElementById("txtTotalTSE3Star").innerText = "" + (totalTSE3Star);
document.getElementById("txtTotalTSE3StarPercent").innerText = "" + (100.0 * totalTSE3Star / totalRolls).toPrecision(6) + "%";
document.getElementById("txtTotalTSHandmade").innerText = "" + (totalTSHandmade);
document.getElementById("txtTotalTSHandmadePercent").innerText = "" + (100.0 * totalTSHandmade / totalRolls).toPrecision(6) + "%";
document.getElementById("txtTotalTSEHandmade").innerText = "" + (totalTSEHandmade);
document.getElementById("txtTotalTSEHandmadePercent").innerText = "" + (100.0 * totalTSEHandmade / totalRolls).toPrecision(6) + "%";
document.getElementById("txtTotalTSE3StarHandmade").innerText = "" + (totalTSE3StarHandmade);
document.getElementById("txtTotalTSE3StarHandmadePercent").innerText = "" + (100.0 * totalTSE3StarHandmade / totalRolls).toPrecision(6) + "%";
document.getElementById("txtTotalExplosive2Star").innerText = "" + (totalExplosive2Star);
document.getElementById("txtTotalExplosive2StarPercent").innerText = "" + (100.0 * totalExplosive2Star / totalRolls).toPrecision(4) + "%";
document.getElementById("txtTotalExplosive3Star").innerText = "" + (totalExplosive3Star);
document.getElementById("txtTotalExplosive3StarPercent").innerText = "" + (100.0 * totalExplosive3Star / totalRolls).toPrecision(4) + "%";
}
// pick a random item from the list based on its occurrence ratio and some filtering
function pickRatiodRandom(list, fnFilter, fnRatio) {
var totalRatio = 0;
for (var i = 0; i < list.length; i++) {
if (fnFilter(list[i])) {
totalRatio += fnRatio(list[i]);
}
}
var chance = Math.random();
var cumulativeRatio = 0;
for (var i = 0; i < list.length; i++) {
if (fnFilter(list[i])) {
cumulativeRatio += fnRatio(list[i]);
if (1.0 * cumulativeRatio / totalRatio > chance) {
return i;
}
}
}
return -1;
}
// Animation handler for the Fo76 button
// -------------------------------------
var ignoreBtn = false;
var stepBtn = 0;
function rotator() {
var b = document.getElementById("imgRoll");
b.style.transform = "rotate(" + (stepBtn * 10) + "deg)";
stepBtn ++;
if (stepBtn < 37) {
setTimeout(rotator, 16)
} else {
lootDrop();
b.style.transform = "";
ignoreBtn = false;
}
}
document.getElementById("btnRoll").onclick = function() {