hypixel-api-reborn 11.2.1 → 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/src/API/housing/getActiveHouses.js +7 -0
- package/src/API/housing/getHouse.js +9 -0
- package/src/API/housing/getPlayerHouses.js +11 -0
- package/src/API/index.js +6 -1
- package/src/API/skyblock/getGarden.js +7 -0
- package/src/API/skyblock/getMember.js +4 -2
- package/src/API/skyblock/getProfiles.js +4 -2
- package/src/Client.js +46 -2
- package/src/Private/requests.js +1 -1
- package/src/index.js +5 -0
- package/src/structures/House.js +54 -0
- package/src/structures/MiniGames/Arcade.js +754 -270
- package/src/structures/MiniGames/ArenaBrawl.js +97 -31
- package/src/structures/MiniGames/BlitzSurvivalGames.js +378 -127
- package/src/structures/MiniGames/BuildBattle.js +19 -8
- package/src/structures/MiniGames/CopsAndCrims.js +252 -25
- package/src/structures/MiniGames/Duels.js +899 -656
- package/src/structures/MiniGames/MegaWalls.js +390 -51
- package/src/structures/MiniGames/MurderMystery.js +151 -30
- package/src/structures/MiniGames/Paintball.js +31 -11
- package/src/structures/MiniGames/Quakecraft.js +113 -50
- package/src/structures/MiniGames/SkyWars.js +340 -195
- package/src/structures/MiniGames/SmashHeroes.js +195 -69
- package/src/structures/MiniGames/SpeedUHC.js +76 -36
- package/src/structures/MiniGames/TNTGames.js +242 -73
- package/src/structures/MiniGames/TurboKartRacers.js +55 -115
- package/src/structures/MiniGames/UHC.js +135 -124
- package/src/structures/MiniGames/VampireZ.js +70 -37
- package/src/structures/MiniGames/Warlords.js +126 -1
- package/src/structures/MiniGames/WoolWars.js +54 -4
- package/src/structures/Player.js +30 -24
- package/src/structures/SkyBlock/SkyblockGarden.js +146 -0
- package/src/structures/SkyBlock/SkyblockMember.js +12 -5
- package/src/utils/Constants.js +507 -5
- package/src/utils/SkyblockUtils.js +33 -0
- package/typings/index.d.ts +911 -802
|
@@ -2,18 +2,6 @@ const { removeSnakeCaseString } = require('../../utils/removeSnakeCase');
|
|
|
2
2
|
const { SkyWarsPrestigeIcons } = require('../../utils/Constants');
|
|
3
3
|
const divide = require('../../utils/divide');
|
|
4
4
|
|
|
5
|
-
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
6
|
-
function generateStatsForMode(data, mode) {
|
|
7
|
-
return {
|
|
8
|
-
kills: data[`kills_${mode}`] || 0,
|
|
9
|
-
deaths: data[`deaths_${mode}`] || 0,
|
|
10
|
-
wins: data[`wins_${mode}`] || 0,
|
|
11
|
-
losses: data[`losses_${mode}`] || 0,
|
|
12
|
-
KDRatio: divide(data[`kills_${mode}`], data[`deaths_${mode}`]),
|
|
13
|
-
WLRatio: divide(data[`wins_${mode}`], data[`losses_${mode}`])
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
5
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
18
6
|
function getSkyWarsPrestige(level) {
|
|
19
7
|
if (60 <= level) return 'Mythic';
|
|
@@ -73,6 +61,173 @@ function getSkyWarsLevelProgress(xp) {
|
|
|
73
61
|
};
|
|
74
62
|
}
|
|
75
63
|
|
|
64
|
+
class SkywarsMode {
|
|
65
|
+
/**
|
|
66
|
+
* @param {object} data Skywars data
|
|
67
|
+
* @param {string} gamemode Gamemode Name
|
|
68
|
+
*/
|
|
69
|
+
constructor(data, gamemode) {
|
|
70
|
+
/**
|
|
71
|
+
* Kills
|
|
72
|
+
* @type {number}
|
|
73
|
+
*/
|
|
74
|
+
this.kills = data[`kills_${gamemode}`] || 0;
|
|
75
|
+
/**
|
|
76
|
+
* Deaths
|
|
77
|
+
* @type {number}
|
|
78
|
+
*/
|
|
79
|
+
this.deaths = data[`deaths_${gamemode}`] || 0;
|
|
80
|
+
/**
|
|
81
|
+
* KDRatio
|
|
82
|
+
* @type {number}
|
|
83
|
+
*/
|
|
84
|
+
this.KDRatio = divide(data.kills, data.deaths);
|
|
85
|
+
/**
|
|
86
|
+
* Wins
|
|
87
|
+
* @type {number}
|
|
88
|
+
*/
|
|
89
|
+
this.wins = data[`wins_${gamemode}`] || 0;
|
|
90
|
+
/**
|
|
91
|
+
* Losses
|
|
92
|
+
* @type {number}
|
|
93
|
+
*/
|
|
94
|
+
this.losses = data[`losses_${gamemode}`] || 0;
|
|
95
|
+
/**
|
|
96
|
+
* WLRatio
|
|
97
|
+
* @type {number}
|
|
98
|
+
*/
|
|
99
|
+
this.WLRatio = divide(data.wins, data.losses);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
class SkywarsModeStats {
|
|
103
|
+
/**
|
|
104
|
+
* @param {object} data Skywars data
|
|
105
|
+
* @param {string} gamemode Gamemode Name
|
|
106
|
+
*/
|
|
107
|
+
constructor(data, gamemode) {
|
|
108
|
+
/**
|
|
109
|
+
* Active Kit
|
|
110
|
+
* @type {string}
|
|
111
|
+
*/
|
|
112
|
+
this.activeKit = data[`activeKit_${gamemode.toUpperCase()}`] || '';
|
|
113
|
+
/**
|
|
114
|
+
* Kill Streak
|
|
115
|
+
* @type {number}
|
|
116
|
+
*/
|
|
117
|
+
this.killstreak = data[`killstreak_${gamemode}`] || 0;
|
|
118
|
+
/**
|
|
119
|
+
* Kills
|
|
120
|
+
* @type {number}
|
|
121
|
+
*/
|
|
122
|
+
this.kills = data[`kills_${gamemode}`] || 0;
|
|
123
|
+
/**
|
|
124
|
+
* Void Kills
|
|
125
|
+
* @type {number}
|
|
126
|
+
*/
|
|
127
|
+
this.voidKills = data[`void_kills_${gamemode}`] || 0;
|
|
128
|
+
/**
|
|
129
|
+
* Melee Kills
|
|
130
|
+
* @type {number}
|
|
131
|
+
*/
|
|
132
|
+
this.meleeKills = data[`melee_kills_${gamemode}`] || 0;
|
|
133
|
+
/**
|
|
134
|
+
* Bow Kills
|
|
135
|
+
* @type {number}
|
|
136
|
+
*/
|
|
137
|
+
this.bowKills = data[`bow_kills_${gamemode}`] || 0;
|
|
138
|
+
/**
|
|
139
|
+
* Mob Kills
|
|
140
|
+
* @type {number}
|
|
141
|
+
*/
|
|
142
|
+
this.mobKills = data[`mob_kills_${gamemode}`] || 0;
|
|
143
|
+
/**
|
|
144
|
+
* Assists
|
|
145
|
+
* @type {number}
|
|
146
|
+
*/
|
|
147
|
+
this.assists = data[`assists_${gamemode}`] || 0;
|
|
148
|
+
/**
|
|
149
|
+
* Deaths
|
|
150
|
+
* @type {number}
|
|
151
|
+
*/
|
|
152
|
+
this.deaths = data[`deaths_${gamemode}`] || 0;
|
|
153
|
+
/**
|
|
154
|
+
* KDRatio
|
|
155
|
+
* @type {number}
|
|
156
|
+
*/
|
|
157
|
+
this.KDRatio = divide(data.kills, data.deaths);
|
|
158
|
+
/**
|
|
159
|
+
* Wins
|
|
160
|
+
* @type {number}
|
|
161
|
+
*/
|
|
162
|
+
this.wins = data[`wins_${gamemode}`] || 0;
|
|
163
|
+
/**
|
|
164
|
+
* Losses
|
|
165
|
+
* @type {number}
|
|
166
|
+
*/
|
|
167
|
+
this.losses = data[`losses_${gamemode}`] || 0;
|
|
168
|
+
/**
|
|
169
|
+
* WLRatio
|
|
170
|
+
* @type {number}
|
|
171
|
+
*/
|
|
172
|
+
this.WLRatio = divide(data.wins, data.losses);
|
|
173
|
+
/**
|
|
174
|
+
* Games Played
|
|
175
|
+
* @type {number}
|
|
176
|
+
*/
|
|
177
|
+
this.gamesPlayed = data[`games_${gamemode}`] || 0;
|
|
178
|
+
/**
|
|
179
|
+
* Survived Players
|
|
180
|
+
* @type {number}
|
|
181
|
+
*/
|
|
182
|
+
this.survivedPlayers = data[`survived_players_${gamemode}`] || 0;
|
|
183
|
+
/**
|
|
184
|
+
* Chests Opened
|
|
185
|
+
* @type {number}
|
|
186
|
+
*/
|
|
187
|
+
this.chestsOpened = data[`chests_opened_${gamemode}`] || 0;
|
|
188
|
+
/**
|
|
189
|
+
* Time Played (In Seconds)
|
|
190
|
+
* @type {number}
|
|
191
|
+
*/
|
|
192
|
+
this.timePlayed = data[`time_played_${gamemode}`] || 0;
|
|
193
|
+
/**
|
|
194
|
+
* Shard
|
|
195
|
+
* @type {number}
|
|
196
|
+
*/
|
|
197
|
+
this.shard = data[`shard_${gamemode}`] || 0;
|
|
198
|
+
/**
|
|
199
|
+
* Longest Bow Shot
|
|
200
|
+
* @type {number}
|
|
201
|
+
*/
|
|
202
|
+
this.longestBowShot = data[`longest_bow_shot_${gamemode}`] || 0;
|
|
203
|
+
/**
|
|
204
|
+
* Arrows Shot
|
|
205
|
+
* @type {number}
|
|
206
|
+
*/
|
|
207
|
+
this.arrowsShot = data[`arrows_shot_${gamemode}`] || 0;
|
|
208
|
+
/**
|
|
209
|
+
* Arrows Hit
|
|
210
|
+
* @type {number}
|
|
211
|
+
*/
|
|
212
|
+
this.arrowsHit = data[`arrows_hit_${gamemode}`] || 0;
|
|
213
|
+
/**
|
|
214
|
+
* Bow Accuracy
|
|
215
|
+
* @type {number}
|
|
216
|
+
*/
|
|
217
|
+
this.bowAccuracy = divide(this.arrowsHit, this.arrowsShot);
|
|
218
|
+
/**
|
|
219
|
+
* Fastest Win (In Seconds)
|
|
220
|
+
* @type {number}
|
|
221
|
+
*/
|
|
222
|
+
this.fastestWin = data[`fastest_win_${gamemode}`] || 0;
|
|
223
|
+
/**
|
|
224
|
+
* Heads
|
|
225
|
+
* @type {number}
|
|
226
|
+
*/
|
|
227
|
+
this.heads = data[`heads_${gamemode}`] || 0;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
76
231
|
/**
|
|
77
232
|
* Parses SkyWars Kit
|
|
78
233
|
*/
|
|
@@ -147,7 +302,7 @@ w */
|
|
|
147
302
|
* Raw Packages, as received from the API
|
|
148
303
|
* @type {string[]}
|
|
149
304
|
*/
|
|
150
|
-
this.rawPackages =
|
|
305
|
+
this.rawPackages = data;
|
|
151
306
|
/**
|
|
152
307
|
* Cages
|
|
153
308
|
* @type {string[]}
|
|
@@ -195,14 +350,6 @@ w */
|
|
|
195
350
|
* * team
|
|
196
351
|
*/
|
|
197
352
|
|
|
198
|
-
/**
|
|
199
|
-
* @typedef {Object} SkyWarsShardsInMode
|
|
200
|
-
* @property {number} solo Solo shards
|
|
201
|
-
* @property {number} team Team shards
|
|
202
|
-
* @property {number} mega Mega shards
|
|
203
|
-
* @property {number} lab Lab shards
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
353
|
/**
|
|
207
354
|
* SkyWars class
|
|
208
355
|
*/
|
|
@@ -227,215 +374,247 @@ w */
|
|
|
227
374
|
*/
|
|
228
375
|
this.tokens = data.cosmetic_tokens || 0;
|
|
229
376
|
/**
|
|
230
|
-
*
|
|
377
|
+
* Experience
|
|
231
378
|
* @type {number}
|
|
232
379
|
*/
|
|
233
|
-
this.
|
|
380
|
+
this.experience = data.skywars_experience || 0;
|
|
234
381
|
/**
|
|
235
|
-
*
|
|
382
|
+
* Level
|
|
383
|
+
* @type {number}
|
|
384
|
+
*/
|
|
385
|
+
this.level = getSkyWarsLevel(data.skywars_experience);
|
|
386
|
+
/**
|
|
387
|
+
* Level Progress
|
|
388
|
+
* @type {LevelProgress}
|
|
389
|
+
*/
|
|
390
|
+
this.levelProgress = getSkyWarsLevelProgress(data.skywars_experience);
|
|
391
|
+
/**
|
|
392
|
+
* Formatted Level
|
|
393
|
+
* @type {string}
|
|
394
|
+
*/
|
|
395
|
+
this.levelFormatted = data.levelFormatted
|
|
396
|
+
? data.levelFormatted
|
|
397
|
+
.replace(/§l/gm, '**')
|
|
398
|
+
.replace(/§([a-f]|[1-9])/gm, '')
|
|
399
|
+
.replace(/§r/gm, '')
|
|
400
|
+
: null;
|
|
401
|
+
/**
|
|
402
|
+
* Prestige
|
|
403
|
+
* @type {SkyWarsPrestige}
|
|
404
|
+
*/
|
|
405
|
+
this.prestige = getSkyWarsPrestige(this.level);
|
|
406
|
+
/**
|
|
407
|
+
* Prestige Icons
|
|
408
|
+
* @type {SkyWarsPrestigeIcons}
|
|
409
|
+
*/
|
|
410
|
+
this.prestigeIcon = data.selected_prestige_icon ? SkyWarsPrestigeIcons[data.selected_prestige_icon] : null;
|
|
411
|
+
/**
|
|
412
|
+
* Opals
|
|
413
|
+
* @type {number}
|
|
414
|
+
*/
|
|
415
|
+
this.opals = data.opals || 0;
|
|
416
|
+
/**
|
|
417
|
+
* Avarice
|
|
418
|
+
* @type {number}
|
|
419
|
+
*/
|
|
420
|
+
this.avarice = data.avarice || 0;
|
|
421
|
+
/**
|
|
422
|
+
* Tenacity
|
|
423
|
+
* @type {number}
|
|
424
|
+
*/
|
|
425
|
+
this.tenacity = data.tenacity || 0;
|
|
426
|
+
/**
|
|
427
|
+
* Shards
|
|
428
|
+
* @type {number}
|
|
429
|
+
*/
|
|
430
|
+
this.shards = data.shard || 0;
|
|
431
|
+
/**
|
|
432
|
+
* Angel Of Death Level
|
|
433
|
+
* @type {number}
|
|
434
|
+
*/
|
|
435
|
+
this.angelOfDeathLevel = data.angel_of_death_level || 0;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Killstreak
|
|
439
|
+
* @type {number}
|
|
440
|
+
*/
|
|
441
|
+
this.killstreak = data.killstreak || 0;
|
|
442
|
+
/**
|
|
443
|
+
* kills
|
|
236
444
|
* @type {number}
|
|
237
445
|
*/
|
|
238
446
|
this.kills = data.kills || 0;
|
|
239
447
|
/**
|
|
240
|
-
*
|
|
448
|
+
* Void Kills
|
|
241
449
|
* @type {number}
|
|
242
450
|
*/
|
|
243
|
-
this.
|
|
451
|
+
this.voidKills = data.void_kills || 0;
|
|
452
|
+
/**
|
|
453
|
+
* Melee Kills
|
|
454
|
+
* @type {number}
|
|
455
|
+
*/
|
|
456
|
+
this.meleeKills = data.melee_kills || 0;
|
|
457
|
+
/**
|
|
458
|
+
* Bow Kills
|
|
459
|
+
* @type {number}
|
|
460
|
+
*/
|
|
461
|
+
this.bowKills = data.bow_kills || 0;
|
|
462
|
+
/**
|
|
463
|
+
* Mob Kills
|
|
464
|
+
* @type {number}
|
|
465
|
+
*/
|
|
466
|
+
this.mobKills = data.mob_kills || 0;
|
|
467
|
+
/**
|
|
468
|
+
* Assists
|
|
469
|
+
* @type {number}
|
|
470
|
+
*/
|
|
471
|
+
this.assists = data.assists || 0;
|
|
244
472
|
/**
|
|
245
473
|
* Deaths
|
|
246
474
|
* @type {number}
|
|
247
475
|
*/
|
|
248
476
|
this.deaths = data.deaths || 0;
|
|
477
|
+
/**
|
|
478
|
+
* KDRatio
|
|
479
|
+
* @type {number}
|
|
480
|
+
*/
|
|
481
|
+
this.KDRatio = divide(data.kills, data.deaths);
|
|
249
482
|
/**
|
|
250
483
|
* Wins
|
|
251
484
|
* @type {number}
|
|
252
485
|
*/
|
|
253
486
|
this.wins = data.wins || 0;
|
|
254
487
|
/**
|
|
255
|
-
*
|
|
488
|
+
* Losses
|
|
256
489
|
* @type {number}
|
|
257
490
|
*/
|
|
258
|
-
this.
|
|
491
|
+
this.losses = data.losses || 0;
|
|
259
492
|
/**
|
|
260
|
-
*
|
|
493
|
+
* WLRatio
|
|
261
494
|
* @type {number}
|
|
262
495
|
*/
|
|
263
|
-
this.
|
|
496
|
+
this.WLRatio = divide(data.wins, data.losses);
|
|
264
497
|
/**
|
|
265
|
-
*
|
|
498
|
+
* Games Played
|
|
266
499
|
* @type {number}
|
|
267
500
|
*/
|
|
268
|
-
this.
|
|
501
|
+
this.gamesPlayed = data.games || 0;
|
|
269
502
|
/**
|
|
270
|
-
*
|
|
271
|
-
* @type {
|
|
503
|
+
* Survived Players
|
|
504
|
+
* @type {number}
|
|
272
505
|
*/
|
|
273
|
-
this.
|
|
506
|
+
this.survivedPlayers = data.survived_players || 0;
|
|
274
507
|
/**
|
|
275
|
-
*
|
|
276
|
-
* @type {
|
|
508
|
+
* Chests Opened
|
|
509
|
+
* @type {number}
|
|
277
510
|
*/
|
|
278
|
-
this.
|
|
279
|
-
? data.levelFormatted
|
|
280
|
-
.replace(/§l/gm, '**')
|
|
281
|
-
.replace(/§([a-f]|[1-9])/gm, '')
|
|
282
|
-
.replace(/§r/gm, '')
|
|
283
|
-
: null;
|
|
511
|
+
this.chestsOpened = data.chests_opened || 0;
|
|
284
512
|
/**
|
|
285
|
-
*
|
|
286
|
-
* @type {
|
|
513
|
+
* Time Played (In Seconds)
|
|
514
|
+
* @type {number}
|
|
287
515
|
*/
|
|
288
|
-
this.
|
|
516
|
+
this.timePlayed = data.time_played || 0;
|
|
289
517
|
/**
|
|
290
|
-
*
|
|
291
|
-
* @type {
|
|
518
|
+
* Shard
|
|
519
|
+
* @type {number}
|
|
292
520
|
*/
|
|
293
|
-
this.
|
|
521
|
+
this.shard = data.shard || 0;
|
|
294
522
|
/**
|
|
295
|
-
*
|
|
523
|
+
* Longest Bow Shot
|
|
296
524
|
* @type {number}
|
|
297
525
|
*/
|
|
298
|
-
this.
|
|
299
|
-
(data.games_solo || 0) +
|
|
300
|
-
(data.games_team || 0) +
|
|
301
|
-
(data.games_mega || 0) +
|
|
302
|
-
(data.games_mega_doubles || 0) +
|
|
303
|
-
(data.games_lab || 0);
|
|
526
|
+
this.longestBowShot = data.longest_bow_shot || 0;
|
|
304
527
|
/**
|
|
305
|
-
*
|
|
528
|
+
* Arrows Shot
|
|
306
529
|
* @type {number}
|
|
307
530
|
*/
|
|
308
|
-
this.
|
|
531
|
+
this.arrowsShot = data.arrows_shot || 0;
|
|
309
532
|
/**
|
|
310
|
-
*
|
|
533
|
+
* Arrows Hit
|
|
311
534
|
* @type {number}
|
|
312
535
|
*/
|
|
313
|
-
this.
|
|
536
|
+
this.arrowsHit = data.arrows_hit || 0;
|
|
314
537
|
/**
|
|
315
|
-
*
|
|
538
|
+
* Bow Accuracy
|
|
316
539
|
* @type {number}
|
|
317
540
|
*/
|
|
318
|
-
this.
|
|
541
|
+
this.bowAccuracy = divide(this.arrowsHit, this.arrowsShot);
|
|
319
542
|
/**
|
|
320
|
-
*
|
|
543
|
+
* Fastest Win
|
|
321
544
|
* @type {number}
|
|
322
545
|
*/
|
|
323
|
-
this.
|
|
546
|
+
this.fastestWin = data.fastest_win || 0;
|
|
324
547
|
/**
|
|
325
|
-
*
|
|
548
|
+
* Heads
|
|
326
549
|
* @type {number}
|
|
327
550
|
*/
|
|
328
|
-
this.
|
|
551
|
+
this.heads = data.heads || 0;
|
|
329
552
|
/**
|
|
330
|
-
*
|
|
553
|
+
* Blocks Placed
|
|
331
554
|
* @type {number}
|
|
332
555
|
*/
|
|
333
|
-
this.
|
|
556
|
+
this.blocksPlaced = data.blocks_placed || 0;
|
|
334
557
|
/**
|
|
335
|
-
*
|
|
558
|
+
* Blocks Broken
|
|
336
559
|
* @type {number}
|
|
337
560
|
*/
|
|
338
|
-
this.
|
|
561
|
+
this.blocksBroken = data.blocks_broken || 0;
|
|
339
562
|
/**
|
|
340
|
-
*
|
|
341
|
-
* @type {
|
|
563
|
+
* Egg Thrown
|
|
564
|
+
* @type {number}
|
|
342
565
|
*/
|
|
343
|
-
this.
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
566
|
+
this.eggThrown = data.egg_thrown || 0;
|
|
567
|
+
/**
|
|
568
|
+
* Enderpearls Thrown
|
|
569
|
+
* @type {number}
|
|
570
|
+
*/
|
|
571
|
+
this.enderpearlsThrown = data.enderpearls_thrown || 0;
|
|
572
|
+
|
|
349
573
|
/**
|
|
350
574
|
* Solo Skywars Stats
|
|
351
|
-
* @type {
|
|
352
|
-
*/
|
|
353
|
-
this.solo =
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
normal: generateStatsForMode(data, 'solo_normal'),
|
|
365
|
-
insane: generateStatsForMode(data, 'solo_insane')
|
|
366
|
-
};
|
|
575
|
+
* @type {SkywarsModeStats}
|
|
576
|
+
*/
|
|
577
|
+
this.solo = new SkywarsModeStats(data, 'solo');
|
|
578
|
+
/**
|
|
579
|
+
* Solo Normal Stats
|
|
580
|
+
* @type {SkywarsMode}
|
|
581
|
+
*/
|
|
582
|
+
this.soloNormal = new SkywarsMode(data, 'solo_normal');
|
|
583
|
+
/**
|
|
584
|
+
* Solo Insane Stats
|
|
585
|
+
* @type {SkywarsMode}
|
|
586
|
+
*/
|
|
587
|
+
this.soloInsane = new SkywarsMode(data, 'solo_insane');
|
|
367
588
|
/**
|
|
368
589
|
* Team Skywars Stats
|
|
369
|
-
* @type {
|
|
370
|
-
*/
|
|
371
|
-
this.team =
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
normal: generateStatsForMode(data, 'team_normal'),
|
|
383
|
-
insane: generateStatsForMode(data, 'team_insane')
|
|
384
|
-
};
|
|
590
|
+
* @type {SkywarsModeStats}
|
|
591
|
+
*/
|
|
592
|
+
this.team = new SkywarsModeStats(data, 'team');
|
|
593
|
+
/**
|
|
594
|
+
* Team Normal Stats
|
|
595
|
+
* @type {SkywarsMode}
|
|
596
|
+
*/
|
|
597
|
+
this.teamNormal = new SkywarsMode(data, 'team_normal');
|
|
598
|
+
/**
|
|
599
|
+
* Team Insane Stats
|
|
600
|
+
* @type {SkywarsMode}
|
|
601
|
+
*/
|
|
602
|
+
this.teamInsane = new SkywarsMode(data, 'team_insane');
|
|
385
603
|
/**
|
|
386
604
|
* Mega Skywars Stats
|
|
387
|
-
* @type {
|
|
388
|
-
*/
|
|
389
|
-
this.mega =
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
losses: (data.losses_mega || 0) + (data.losses_mega_doubles || 0),
|
|
396
|
-
deaths: (data.deaths_mega || 0) + (data.deaths_mega_doubles || 0),
|
|
397
|
-
KDRatio: divide(
|
|
398
|
-
(data.kills_mega || 0) + (data.kills_mega_doubles || 0),
|
|
399
|
-
(data.deaths_mega || 0) + (data.deaths_mega_doubles || 0)
|
|
400
|
-
),
|
|
401
|
-
WLRatio: divide(
|
|
402
|
-
(data.wins_mega || 0) + (data.wins_mega_doubles || 0),
|
|
403
|
-
(data.losses_mega || 0) + (data.losses_mega_doubles || 0)
|
|
404
|
-
)
|
|
405
|
-
},
|
|
406
|
-
solo: {
|
|
407
|
-
playedGames: data.games_mega || 0,
|
|
408
|
-
kills: data.kills_mega || 0,
|
|
409
|
-
wins: data.wins_mega || 0,
|
|
410
|
-
losses: data.losses_mega || 0,
|
|
411
|
-
deaths: data.deaths_mega || 0,
|
|
412
|
-
KDRatio: divide(data.kills_mega || 0, data.deaths_mega || 0),
|
|
413
|
-
WLRatio: divide(data.wins_mega || 0, data.losses_mega || 0)
|
|
414
|
-
},
|
|
415
|
-
doubles: {
|
|
416
|
-
playedGames: data.games_mega_doubles || 0,
|
|
417
|
-
kills: data.kills_mega_doubles || 0,
|
|
418
|
-
wins: data.wins_mega_doubles || 0,
|
|
419
|
-
losses: data.losses_mega_doubles || 0,
|
|
420
|
-
deaths: data.deaths_mega_doubles || 0,
|
|
421
|
-
KDRatio: divide(data.kills_mega_doubles || 0, data.deaths_mega_doubles || 0),
|
|
422
|
-
WLRatio: divide(data.wins_mega_doubles || 0, data.losses_mega_doubles || 0)
|
|
423
|
-
}
|
|
424
|
-
};
|
|
605
|
+
* @type {SkywarsMode}
|
|
606
|
+
*/
|
|
607
|
+
this.mega = new SkywarsMode(data, 'mega');
|
|
608
|
+
/**
|
|
609
|
+
* Mega Doubles Skywars Stats
|
|
610
|
+
* @type {SkywarsMode}
|
|
611
|
+
*/
|
|
612
|
+
this.megaDoubles = new SkywarsMode(data, 'mega_doubles');
|
|
425
613
|
/**
|
|
426
614
|
* Skywars Laboratory Stats
|
|
427
|
-
* @type {
|
|
428
|
-
*/
|
|
429
|
-
this.lab =
|
|
430
|
-
winstreak: data.winstreak_lab || 0,
|
|
431
|
-
playedGames: data.games_lab || 0,
|
|
432
|
-
kills: data.kills_lab || 0,
|
|
433
|
-
wins: data.wins_lab || 0,
|
|
434
|
-
losses: data.losses_lab || 0,
|
|
435
|
-
deaths: data.deaths_lab || 0,
|
|
436
|
-
KDRatio: divide(data.kills_lab, data.deaths_lab),
|
|
437
|
-
WLRatio: divide(data.wins_lab, data.losses_lab)
|
|
438
|
-
};
|
|
615
|
+
* @type {SkywarsMode}
|
|
616
|
+
*/
|
|
617
|
+
this.lab = new SkywarsMode(data, 'lab');
|
|
439
618
|
/**
|
|
440
619
|
* Player Packages, can range from kits to achievement
|
|
441
620
|
* @type {SkywarsPackages}
|
|
@@ -486,39 +665,5 @@ w */
|
|
|
486
665
|
* * 'ಠ_ಠ',
|
|
487
666
|
* * '⚔'
|
|
488
667
|
*/
|
|
489
|
-
|
|
490
|
-
* @typedef {Object} SkyWarsModeStats
|
|
491
|
-
* @property {number} kills Kills
|
|
492
|
-
* @property {number} deaths Deaths
|
|
493
|
-
* @property {number} wins Wins
|
|
494
|
-
* @property {number} losses Losses
|
|
495
|
-
* @property {number} KDRatio Kill Death ratio
|
|
496
|
-
* @property {number} WLRatio Win Loss ratio
|
|
497
|
-
*/
|
|
498
|
-
/**
|
|
499
|
-
* @typedef {Object} SkyWarsTotalModeStats
|
|
500
|
-
* @property {number} winstreak Winstreak
|
|
501
|
-
* @property {number} playedGames Played games
|
|
502
|
-
* @property {number} kills Kills
|
|
503
|
-
* @property {number} deaths Deaths
|
|
504
|
-
* @property {number} wins Wins
|
|
505
|
-
* @property {number} losses Losses
|
|
506
|
-
* @property {number} KDRatio Kill Death ratio
|
|
507
|
-
* @property {number} WLRatio Win Loss ratio
|
|
508
|
-
*/
|
|
509
|
-
/**
|
|
510
|
-
* @typedef {string} PseudoDate String date, in the format of MM-YY ( YY is 20YY )
|
|
511
|
-
w */
|
|
512
|
-
/**
|
|
513
|
-
* @typedef {Object} SkyWarsModeExtendedStats
|
|
514
|
-
* @property {SkyWarsTotalModeStats} overall Overall Stats
|
|
515
|
-
* @property {SkyWarsModeStats} normal Normal Mode Stats
|
|
516
|
-
* @property {SkyWarsModeStats} insane Insane Mode Stats
|
|
517
|
-
*/
|
|
518
|
-
/**
|
|
519
|
-
* @typedef {Object} SkyWarsMegaStats
|
|
520
|
-
* @property {SkyWarsTotalModeStats} overall Overall Mega Stats
|
|
521
|
-
* @property {SkyWarsModeStats} solo Mega Solo Stats
|
|
522
|
-
* @property {SkyWarsModeStats} doubles Mega Doubles Stats
|
|
523
|
-
*/
|
|
668
|
+
|
|
524
669
|
module.exports = SkyWars;
|