-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
448 lines (367 loc) · 14.4 KB
/
Copy pathscripts.js
File metadata and controls
448 lines (367 loc) · 14.4 KB
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
//Random Item Function - Ran when user clicks generate class button.
function random_item() {
// console.log("button pressed");
// Reset all Elements (Used for if user spamms generate button)
var element = document.getElementById("randomClass");
element.classList.add("randomClass");
//Remove Updates
document.getElementById("myTitle").innerHTML = "";
// document.getElementById("goAgain").innerHTML = '<button id="mybtn" class="btn btn-primary" onclick="random_item();">Generate Again</button><br><br>';
// Reset Primary
document.getElementById("primaryH3").innerHTML = ""
document.getElementById("primary").innerHTML = "";
// Reset Primary Attachment 1
document.getElementById("primaryAtt1H3").innerHTML = "";
document.getElementById("primaryAtt1").innerHTML = "";
// Reset Primary Attachment 2
document.getElementById("primaryAtt2H3").innerHTML = "";
document.getElementById("primaryAtt2").innerHTML = "";
// Reset Primary Attachment 3
document.getElementById("primaryAtt3H3").innerHTML = "";
document.getElementById("primaryAtt3").innerHTML = "";
// Reset Primary Attachment 4
document.getElementById("primaryAtt4H3").innerHTML = "";
document.getElementById("primaryAtt4").innerHTML = "";
// Reset Primary Attachment 5
document.getElementById("primaryAtt5H3").innerHTML = "";
document.getElementById("primaryAtt5").innerHTML = "";
// Reset Primary Attachment 6
document.getElementById("primaryAtt6H3").innerHTML = "";
document.getElementById("primaryAtt6").innerHTML = "";
// Reset Primary Attachment 7
document.getElementById("primaryAtt7H3").innerHTML = "";
document.getElementById("primaryAtt7").innerHTML = "";
// Reset Primary Attachment 8
document.getElementById("primaryAtt8H3").innerHTML = "";
document.getElementById("primaryAtt8").innerHTML = "";
// Reset Secondary
document.getElementById("secondaryH3").innerHTML = "";
document.getElementById("secondary").innerHTML = "";
// Reset secondary Attachment 1
document.getElementById("secondaryAtt1H3").innerHTML = "";
document.getElementById("secondaryAtt1").innerHTML = "";
// Reset secondary Attachment 2
document.getElementById("secondaryAtt2H3").innerHTML = "";
document.getElementById("secondaryAtt2").innerHTML = "";
// Reset secondary Attachment 3
document.getElementById("secondaryAtt3H3").innerHTML = "";
document.getElementById("secondaryAtt3").innerHTML = "";
// Reset secondary Attachment 4
document.getElementById("secondaryAtt4H3").innerHTML = "";
document.getElementById("secondaryAtt4").innerHTML = "";
// Reset secondary Attachment 5
document.getElementById("secondaryAtt5H3").innerHTML = "";
document.getElementById("secondaryAtt5").innerHTML = "";
// Reset secondary Attachment 6
document.getElementById("secondaryAtt6H3").innerHTML = "";
document.getElementById("secondaryAtt6").innerHTML = "";
// Reset ssecondaryAttachment 7
document.getElementById("secondaryAtt7H3").innerHTML = "";
document.getElementById("secondaryAtt7").innerHTML = "";
// Reset secondary Attachment 8
document.getElementById("secondaryAtt8H3").innerHTML = "";
document.getElementById("secondaryAtt8").innerHTML = "";
// Reset Tactical
document.getElementById("tacticalH3").innerHTML = "";
document.getElementById("tactical").innerHTML = "";
// Reset Lethal
document.getElementById("lethalH3").innerHTML = "";
document.getElementById("lethal").innerHTML = "";
// Reset Field Upgrade
document.getElementById("fieldUpgradeH3").innerHTML = "";
document.getElementById("fieldUpgrade").innerHTML = "";
// Reset Perk 1
document.getElementById("perk1H3").innerHTML = "";
document.getElementById("perk1").innerHTML = "";
// Reset Perk 2
document.getElementById("perk2H3").innerHTML = "";
document.getElementById("perk2").innerHTML = "";
// Reset Perk 3
document.getElementById("perk3H3").innerHTML = "";
document.getElementById("perk3").innerHTML = "";
// Reset Perk 1 PG
document.getElementById("perk1PGH3").innerHTML = "";
document.getElementById("perk1PG").innerHTML = "";
// Reset Perk 2 PG
document.getElementById("perkPG2H3").innerHTML = "";
document.getElementById("perk2PG").innerHTML = "";
// Reset Perk 3 PG
document.getElementById("perk3PGH3").innerHTML = "";
document.getElementById("perk3PG").innerHTML = "";
var element = document.getElementById("classContent");
element.classList.add("classContent");
// Reset Wildcard
document.getElementById("wildcardH3").innerHTML = "";
document.getElementById("wildcard").innerHTML = "";
var element = document.getElementById("classContent");
element.classList.add("classContent");
// Random Primary Logic
var randomPrimary = primarysArray[Math.floor(Math.random() * primarysArray.length)];
//Used for Testing
// console.log("The Primary name is -----------------------------------------" + randomPrimary.name);
// console.log("The Primary image is -----------------------------------------" + randomPrimary.image);
document.getElementById("primary").innerHTML = randomPrimary.name + '<br>' + '<img style="width:200px;" src="' + randomPrimary.image + ' " alt="' + randomPrimary.name + '">';
document.getElementById("primaryH3").innerHTML = "Primary";
//Random Secondary Logic
var randomSecondary = secondarysArray[Math.floor(Math.random() * secondarysArray.length)];
//Used for Testing
// console.log("The Secondary name is -----------------------------------------" + randomSecondary.name);
// console.log("The Secondary image is -----------------------------------------" + randomSecondary.image);
document.getElementById("secondary").innerHTML = randomSecondary.name + '<br>' + '<img style="width:200px;" src="' + randomSecondary.image + ' " alt="' + randomSecondary.name + '">';
document.getElementById("secondaryH3").innerHTML = "Secondary";
// Random Perk 1 Logic
var randomPerk1 = perk1Array[Math.floor(Math.random() * perk1Array.length)];
document.getElementById("perk1").innerHTML = randomPerk1.name + '<br>' + '<img style="width:200px;" src="' + randomPerk1.image + ' " alt="' + randomPerk1.name + '">';
document.getElementById("perk1H3").innerHTML = "Perk 1";
// Random Perk 2 Logic
var randomPerk2 = perk2Array[Math.floor(Math.random() * perk2Array.length)];
document.getElementById("perk2").innerHTML = randomPerk2.name + '<br>' + '<img style="width:200px;" src="' + randomPerk2.image + ' " alt="' + randomPerk2.name + '">';
document.getElementById("perk2H3").innerHTML = "Perk 2";
// Random Perk 3 Logic
var randomPerk3 = perk3Array[Math.floor(Math.random() * perk3Array.length)];
document.getElementById("perk3H3").innerHTML = "Perk 3";
document.getElementById("perk3").innerHTML = randomPerk3.name + '<br>' + '<img style="width:200px;" src="' + randomPerk3.image + ' " alt="' + randomPerk3.name + '">';
//Random Lethal Logic
var randomLethal = lethalsArray[Math.floor(Math.random() * lethalsArray.length)];
document.getElementById("lethal").innerHTML = randomLethal.name + '<br>' + '<img style="width:200px;" src="' + randomLethal.image + ' " alt="' + randomLethal.name + '">';
document.getElementById("lethalH3").innerHTML = "Lethal";
// Random Tactical Logic
var randomTactical = tacticalsArray[Math.floor(Math.random() * tacticalsArray.length)];
document.getElementById("tactical").innerHTML = randomTactical.name + '<br>' + '<img style="width:200px;" src="' + randomTactical.image + ' " alt="' + randomTactical.name + '">';
document.getElementById("tacticalH3").innerHTML = "Tactical";
//Random Field Upgrade Logic
var randomUpgrade = fieldUpgradesArray[Math.floor(Math.random() * fieldUpgradesArray.length)];
document.getElementById("fieldUpgrade").innerHTML = randomUpgrade.name + '<br>' + '<img style="width:200px;" src="' + randomUpgrade.image + ' " alt="' + randomUpgrade.name + '">';
document.getElementById("fieldUpgradeH3").innerHTML = "Field Upgrade";
//Random Wildcard Logic
var randomWildcard = wildcardsArray[Math.floor(Math.random() * wildcardsArray.length)];
document.getElementById("wildcard").innerHTML = randomWildcard.name + '<br>' + '<img style="width:200px;" src="' + randomWildcard.image + ' " alt="' + randomWildcard.name + '">';
document.getElementById("wildcardH3").innerHTML = "Wildcard";
//Perk Greed Functions
function perk1PG() {
var randomPerk1PG = perk1Array[Math.floor(Math.random() * perk1Array.length)];
document.getElementById("perk1PG").innerHTML = randomPerk1PG.name + '<br>' + '<img style="width:200px;" src="' + randomPerk1PG.image + ' " alt="' + randomPerk1PG.name + '">';
if (randomPerk1.name === randomPerk1PG.name) {
perk1PG();
}
}
function perk2PG() {
var randomPerk2PG = perk2Array[Math.floor(Math.random() * perk2Array.length)];
document.getElementById("perk2PG").innerHTML = randomPerk2PG.name + '<br>' + '<img style="width:200px;" src="' + randomPerk2PG.image + ' " alt="' + randomPerk2PG.name + '">';
if (randomPerk2.name === randomPerk2PG.name) {
perk2PG();
}
}
function perk3PG() {
var randomPerk3PG = perk3Array[Math.floor(Math.random() * perk3Array.length)];
document.getElementById("perk3PG").innerHTML = randomPerk3PG.name + '<br>' + '<img style="width:200px;" src="' + randomPerk3PG.image + ' " alt="' + randomPerk3PG.name + '">';
if (randomPerk3.name === randomPerk3PG.name) {
perk3PG();
}
}
if (randomWildcard.name === "Perk Greed") {
perk1PG();
perk2PG();
perk3PG();
}
// END Perk Greed Functions
//Law Breaker Function
if (randomWildcard.name =="Law Breaker")
{
lawbreaker();
}
//Call to Weapon Functions
//Primaries
switch (randomPrimary.name) {
// Assult Rifles
case "XM4":
xm4();
break;
case "AK-47":
ak47();
break;
case "Krig 6":
krig6();
break;
case "QBZ-83":
qbz83();
break;
case "FFAR 1":
ffar1();
break;
case "Groza":
groza();
break;
// Submachine Guns
case "MP5":
mp5();
break;
case "Milano 821":
milano821();
break;
case "AK-74u":
ak74u();
break;
case "KSP 45":
ksp45();
break;
case "Bullfrog":
bullfrog();
break;
case "MAC-10":
mac10();
break;
//Tacitcal Rifles
case "Type 63":
type63();
break;
case "M16":
m16();
break;
case "AUG":
aug();
break;
case "DMR 14":
dmr14();
break;
//Light Machine Guns
case "Stoner 63":
stoner63();
break;
case "RPD":
rpd();
break;
case "M60":
m60();
break;
//Sniper Rifles
case "Pelington 703":
pelington703();
break;
case "LW3 - Tundra":
lw3tundra();
break;
case "M82":
m82();
break;
}
//Secondaries
switch (randomSecondary.name) {
//Shotguns
case "Hauer 77":
hauer77();
break;
case "Gallo SA12":
gallosa12();
break;
case "Streetsweeper":
streetsweeper();
break;
//Pistols
case "1911":
p1911();
break;
case "Magnum":
magnum();
break;
case "Diamatti":
diamatti();
break;
//Launchers
// case "Cigma 2":
// cigma2();
// break;
// case "RPG-7":
// rpg7();
// break;
// //Mele
// case "Knife":
// knife();
// break;
// case "Sledgehammer":
// sledgehammer();
// break;
// case "Wakizashi":
// wakizashi();
// break;
// case "M79":
// m79();
// break;
}
//If Gunfighter is equipped
if (randomWildcard.name === "Gunfighter") {
switch (randomPrimary.name) {
// Assult Rifles
case "XM4":
xm4w();
break;
case "AK-47":
ak47w();
break;
case "Krig 6":
krig6w();
break;
case "QBZ-83":
qbz83w();
break;
case "FFAR 1":
ffar1w();
break;
case "Groza":
grozaw();
break;
// Submachine Guns
case "MP5":
mp5w();
break;
case "Milano 821":
milano821w();
break;
case "AK-74u":
ak74uw();
break;
case "KSP 45":
ksp45w();
break;
case "Bullfrog":
bullfrogw();
break;
case "MAC-10":
mac10w();
break;
//Tacitcal Rifles
case "Type 63":
type63w();
break;
case "M16":
m16w();
break;
case "AUG":
augw();
break;
case "DMR 14":
dmr14w();
break;
//Light Machine Guns
case "Stoner 63":
stoner63w();
break;
case "RPD":
rpdw();
break;
case "M60":
m60w();
break;
//Sniper Rifles
case "Pelington 703":
pelington703w();
break;
case "LW3 - Tundra":
lw3tundraw();
break;
case "M82":
m82w();
break;
}
}
};