hypixel-api-reborn 11.2.0 → 11.2.1
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/README.md +1 -1
- package/eslint.config.mjs +71 -0
- package/package.json +11 -17
- package/src/API/getAchievements.js +1 -0
- package/src/API/getBoosters.js +1 -0
- package/src/API/getChallenges.js +1 -0
- package/src/API/getGameCounts.js +1 -0
- package/src/API/getGuild.js +4 -3
- package/src/API/getGuildAchievements.js +1 -0
- package/src/API/getLeaderboards.js +1 -1
- package/src/API/getPlayer.js +1 -0
- package/src/API/getQuests.js +1 -0
- package/src/API/getRecentGames.js +5 -9
- package/src/API/getServerInfo.js +40 -37
- package/src/API/getStatus.js +1 -0
- package/src/API/getWatchdogStats.js +1 -0
- package/src/API/skyblock/getAuction.js +8 -6
- package/src/API/skyblock/getAuctions.js +15 -12
- package/src/API/skyblock/getAuctionsByPlayer.js +1 -1
- package/src/API/skyblock/getBazaar.js +1 -3
- package/src/API/skyblock/getBingo.js +1 -2
- package/src/API/skyblock/getBingoByPlayer.js +3 -3
- package/src/API/skyblock/getEndedAuctions.js +1 -0
- package/src/API/skyblock/getFireSales.js +1 -1
- package/src/API/skyblock/getGovernment.js +1 -2
- package/src/API/skyblock/getMember.js +1 -0
- package/src/API/skyblock/getMuseum.js +1 -0
- package/src/API/skyblock/getNews.js +1 -0
- package/src/API/skyblock/getProfiles.js +1 -0
- package/src/Client.js +42 -14
- package/src/Private/rateLimit.js +7 -11
- package/src/Private/requests.js +11 -12
- package/src/Private/updater.js +2 -3
- package/src/Private/uuidCache.js +1 -2
- package/src/Private/validate.js +19 -19
- package/src/structures/APIIncident.js +1 -2
- package/src/structures/APIStatus.js +0 -1
- package/src/structures/Boosters/Booster.js +9 -8
- package/src/structures/Game.js +1 -1
- package/src/structures/Guild/Guild.js +19 -36
- package/src/structures/Guild/GuildMember.js +2 -2
- package/src/structures/MiniGames/Arcade.js +242 -240
- package/src/structures/MiniGames/ArenaBrawl.js +11 -11
- package/src/structures/MiniGames/BedWars.js +197 -194
- package/src/structures/MiniGames/BlitzSurvivalGames.js +24 -23
- package/src/structures/MiniGames/CopsAndCrims.js +1 -0
- package/src/structures/MiniGames/Duels.js +9 -11
- package/src/structures/MiniGames/Pit.js +4 -5
- package/src/structures/MiniGames/SkyWars.js +197 -186
- package/src/structures/MiniGames/SmashHeroes.js +36 -34
- package/src/structures/MiniGames/SpeedUHC.js +17 -4
- package/src/structures/MiniGames/UHC.js +26 -25
- package/src/structures/MiniGames/WoolWars.js +6 -5
- package/src/structures/Pet.js +1 -1
- package/src/structures/Player.js +13 -104
- package/src/structures/PlayerCosmetics.js +5 -4
- package/src/structures/SkyBlock/Auctions/AuctionInfo.js +2 -1
- package/src/structures/SkyBlock/Auctions/BaseAuction.js +1 -1
- package/src/structures/SkyBlock/News/SkyblockNews.js +15 -15
- package/src/structures/SkyBlock/PlayerBingo.js +7 -14
- package/src/structures/SkyBlock/SkyblockInventoryItem.js +4 -28
- package/src/structures/SkyBlock/SkyblockMember.js +78 -223
- package/src/structures/SkyBlock/SkyblockPet.js +3 -4
- package/src/structures/SkyBlock/Static/Bingo.js +10 -11
- package/src/structures/SkyBlock/Static/BingoData.js +1 -1
- package/src/structures/Static/Achievement.js +16 -15
- package/src/structures/Static/AchievementTier.js +2 -2
- package/src/structures/Static/Quest.js +2 -2
- package/src/utils/Constants.js +17 -517
- package/src/utils/{guildExp.js → Guild.js} +42 -12
- package/src/utils/Player.js +112 -0
- package/src/utils/SkyblockUtils.js +449 -192
- package/src/utils/arrayTools.js +1 -1
- package/src/utils/divide.js +1 -1
- package/src/utils/index.js +2 -1
- package/src/utils/isGuildID.js +1 -1
- package/src/utils/oscillation.js +4 -2
- package/src/utils/removeSnakeCase.js +11 -7
- package/src/utils/rgbToHexColor.js +1 -1
- package/src/utils/romanize.js +3 -3
- package/src/utils/toUuid.js +4 -4
- package/src/utils/varInt.js +2 -2
- package/typings/index.d.ts +272 -162
- package/src/utils/toIGN.js +0 -24
|
@@ -1,178 +1,16 @@
|
|
|
1
1
|
// IMPORTANT : a lot of the properties from the API seem to be nonsense
|
|
2
2
|
|
|
3
|
-
const divide = require('../../utils/divide');
|
|
4
|
-
const { weekAB, monthAB } = require('../../utils/oscillation');
|
|
5
3
|
const { removeSnakeCaseString } = require('../../utils/removeSnakeCase');
|
|
4
|
+
const { weekAB, monthAB } = require('../../utils/oscillation');
|
|
5
|
+
const divide = require('../../utils/divide');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
constructor(data = {}) {
|
|
16
|
-
/**
|
|
17
|
-
* Amount of coins
|
|
18
|
-
* @type {number}
|
|
19
|
-
*/
|
|
20
|
-
this.coins = data.coins || 0;
|
|
21
|
-
/**
|
|
22
|
-
* Weekly coins
|
|
23
|
-
* @type {number}
|
|
24
|
-
*/
|
|
25
|
-
this.weeklyCoins = parseInt(data[`weekly_coins_${weekAB()}`] || 0, 10);
|
|
26
|
-
/**
|
|
27
|
-
* Monthly coins
|
|
28
|
-
* @type {number}
|
|
29
|
-
*/
|
|
30
|
-
this.monthlyCoins = parseInt(data[`monthly_coins_${monthAB()}`] || 0, 10);
|
|
31
|
-
/**
|
|
32
|
-
* Hints Disabled
|
|
33
|
-
* @type {boolean}
|
|
34
|
-
*/
|
|
35
|
-
this.hintsDisabled = !data.hints;
|
|
36
|
-
/**
|
|
37
|
-
* Flash Disabled
|
|
38
|
-
* @type {boolean}
|
|
39
|
-
*/
|
|
40
|
-
this.flashDisabled = !data.flash;
|
|
41
|
-
/**
|
|
42
|
-
* Draw their thing stats
|
|
43
|
-
* @type {BaseGame}
|
|
44
|
-
*/
|
|
45
|
-
this.drawTheirThing = new BaseGame(data, 'draw_their_thing');
|
|
46
|
-
/**
|
|
47
|
-
* Dragon wars "2" stats
|
|
48
|
-
* @type {BaseGame}
|
|
49
|
-
*/
|
|
50
|
-
this.dragonWars = new BaseGame(data, 'dragonwars2');
|
|
51
|
-
/**
|
|
52
|
-
* Easter Simulator stats
|
|
53
|
-
* @type {EasterSimulator}
|
|
54
|
-
*/
|
|
55
|
-
this.easterSimulator = new BaseGame(data, 'easter_simulator').extend(
|
|
56
|
-
'eggsFound',
|
|
57
|
-
data.eggs_found_easter_simulator || 0
|
|
58
|
-
);
|
|
59
|
-
/**
|
|
60
|
-
* Grinch Simulator stats
|
|
61
|
-
* @type {GrinchSimulator}
|
|
62
|
-
*/
|
|
63
|
-
this.grinchSimulator = new BaseGame(data, 'grinch_simulator_v2').extend(
|
|
64
|
-
'giftsFound',
|
|
65
|
-
data.gifts_grinch_simulator_v2 || 0
|
|
66
|
-
);
|
|
67
|
-
/**
|
|
68
|
-
* Scuba Simulator stats
|
|
69
|
-
* @type {ScubaSimulator}
|
|
70
|
-
*/
|
|
71
|
-
this.scubaSimulator = new BaseGame(data, 'scuba_simulator').extend(
|
|
72
|
-
'itemsFound',
|
|
73
|
-
data.items_found_scuba_simulator || 0
|
|
74
|
-
);
|
|
75
|
-
/**
|
|
76
|
-
* Santa Simulator stats
|
|
77
|
-
* @type {SantaSimulator}
|
|
78
|
-
*/
|
|
79
|
-
this.santaSimulator = new BaseGame(data, 'santa_simulator').extend(
|
|
80
|
-
'giftsDelivered',
|
|
81
|
-
data.delivered_santa_simulator || 0
|
|
82
|
-
);
|
|
83
|
-
/**
|
|
84
|
-
* Santa Says stats
|
|
85
|
-
* @type {BaseGame}
|
|
86
|
-
*/
|
|
87
|
-
this.santaSays = new BaseGame(data, 'santa_says');
|
|
88
|
-
/**
|
|
89
|
-
* Simon Says stats
|
|
90
|
-
* @type {BaseGame}
|
|
91
|
-
*/
|
|
92
|
-
this.simonSays = new BaseGame(data, 'simon_says');
|
|
93
|
-
/**
|
|
94
|
-
* Farm Hunt stats
|
|
95
|
-
* @type {BaseGame}
|
|
96
|
-
*/
|
|
97
|
-
this.farmHunt = new BaseGame(data, 'farm_hunt');
|
|
98
|
-
/**
|
|
99
|
-
* Hole in the Wall stats
|
|
100
|
-
* @type {HITW}
|
|
101
|
-
*/
|
|
102
|
-
this.holeInTheWall = new HITW(data, 'hole_in_the_wall');
|
|
103
|
-
/**
|
|
104
|
-
* Mini Walls stats
|
|
105
|
-
* @type {MiniWalls}
|
|
106
|
-
*/
|
|
107
|
-
this.miniWalls = new MiniWalls(data); // needs extension
|
|
108
|
-
/**
|
|
109
|
-
* Party games (1) stats
|
|
110
|
-
* @type {BaseGame}
|
|
111
|
-
*/
|
|
112
|
-
this.partyGames = new BaseGame(data, 'party');
|
|
113
|
-
/**
|
|
114
|
-
* Party Games 2 stats ( legacy )
|
|
115
|
-
* @type {BaseGame}
|
|
116
|
-
* @deprecated
|
|
117
|
-
*/
|
|
118
|
-
this.partyGames2 = new BaseGame(data, 'party_2');
|
|
119
|
-
/**
|
|
120
|
-
* Party Games 3 stats ( legacy )
|
|
121
|
-
* @type {BaseGame}
|
|
122
|
-
* @deprecated
|
|
123
|
-
*/
|
|
124
|
-
this.partyGames3 = new BaseGame(data, 'party_3');
|
|
125
|
-
/**
|
|
126
|
-
* Throw out stats
|
|
127
|
-
* @type {BaseGame}
|
|
128
|
-
*/
|
|
129
|
-
this.throwOut = new BaseGame(data, 'throw_out');
|
|
130
|
-
/**
|
|
131
|
-
* Soccer stats
|
|
132
|
-
* @type {Soccer}
|
|
133
|
-
*/
|
|
134
|
-
this.soccer = new Soccer(data);
|
|
135
|
-
/**
|
|
136
|
-
* Hypixel Sports stats
|
|
137
|
-
* @type {BaseGame}
|
|
138
|
-
* @deprecated
|
|
139
|
-
*/
|
|
140
|
-
this.hypixelSports = new BaseGame(data, 'hypixel_sports');
|
|
141
|
-
/**
|
|
142
|
-
* Ender Spleef stats
|
|
143
|
-
* @type {BaseGame}
|
|
144
|
-
*/
|
|
145
|
-
this.enderSpleef = new BaseGame(data, 'ender');
|
|
146
|
-
/**
|
|
147
|
-
* Blocking dead ( previously known as DayOne ) stats
|
|
148
|
-
* @type {BlockingDead}
|
|
149
|
-
*/
|
|
150
|
-
this.blockingDead = new BaseGame(data, 'dayone').extend('headshots', data.headshots_dayone || 0);
|
|
151
|
-
/**
|
|
152
|
-
* Galaxy Wars stats
|
|
153
|
-
* @type {GalaxyWars}
|
|
154
|
-
*/
|
|
155
|
-
this.galaxyWars = new GalaxyWars(data);
|
|
156
|
-
// Lenient parsing
|
|
157
|
-
/**
|
|
158
|
-
* OITQ / One In The Quiver stats
|
|
159
|
-
* @type {OITQ}
|
|
160
|
-
*/
|
|
161
|
-
this.oitq = this.oneInTheQuiver = new BaseGame(data, 'oneinthequiver').extend(
|
|
162
|
-
'bountyKills',
|
|
163
|
-
data.bounty_kills_oneinthequiver || 0
|
|
164
|
-
);
|
|
165
|
-
/**
|
|
166
|
-
* Zombies
|
|
167
|
-
* @type {Zombies}
|
|
168
|
-
*/
|
|
169
|
-
this.zombies = new Zombies(data);
|
|
170
|
-
/**
|
|
171
|
-
* Capture The Wool
|
|
172
|
-
* @type {{kills: number, captures: number}}
|
|
173
|
-
*/
|
|
174
|
-
this.captureTheWool = { kills: data.arcade_ctw_slayer || 0, captures: data.arcade_ctw_oh_sheep || 0 };
|
|
175
|
-
}
|
|
7
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
8
|
+
function parseZombiesKills(data) {
|
|
9
|
+
const matches = Array.from(Object.keys(data))
|
|
10
|
+
.map((x) => x.match(/^([A-Za-z]+)_zombie_kills_zombies$/))
|
|
11
|
+
.filter((x) => x);
|
|
12
|
+
// From entries might be broken
|
|
13
|
+
return Object.fromEntries(matches.map((x) => [removeSnakeCaseString(x[1]), data[x[0]] || 0]));
|
|
176
14
|
}
|
|
177
15
|
/**
|
|
178
16
|
* Most basic game class, used by all arcade games
|
|
@@ -366,64 +204,76 @@ class MiniWalls extends BaseGame {
|
|
|
366
204
|
}
|
|
367
205
|
}
|
|
368
206
|
/**
|
|
369
|
-
* Zombies -
|
|
207
|
+
* Zombies - Stats by Map + Difficulty
|
|
370
208
|
*/
|
|
371
|
-
class
|
|
209
|
+
class ZombiesStats {
|
|
372
210
|
/**
|
|
373
211
|
* Constructor
|
|
374
212
|
* @param {Object} data Data from API
|
|
213
|
+
* @param {string} type Map name + difficulty ( default overall )
|
|
375
214
|
*/
|
|
376
|
-
constructor(data) {
|
|
215
|
+
constructor(data, type = '') {
|
|
216
|
+
if (type) type = `_${type}`;
|
|
377
217
|
/**
|
|
378
|
-
*
|
|
379
|
-
* @type {
|
|
218
|
+
* Best Round
|
|
219
|
+
* @type {number}
|
|
380
220
|
*/
|
|
381
|
-
this.
|
|
221
|
+
this.bestRound = data[`best_round_zombies${type}`] || 0;
|
|
382
222
|
/**
|
|
383
|
-
*
|
|
384
|
-
* @type {
|
|
223
|
+
* Deaths ( NOT losses )
|
|
224
|
+
* @type {number}
|
|
385
225
|
*/
|
|
386
|
-
this.
|
|
226
|
+
this.deaths = data[`deaths_zombies${type}`] || 0;
|
|
387
227
|
/**
|
|
388
|
-
*
|
|
389
|
-
* @type {
|
|
228
|
+
* Doors opened
|
|
229
|
+
* @type {number}
|
|
390
230
|
*/
|
|
391
|
-
this.
|
|
231
|
+
this.doorsOpened = data[`doors_opened_zombies${type}`] || 0;
|
|
392
232
|
/**
|
|
393
|
-
*
|
|
394
|
-
* @type {
|
|
233
|
+
* Fastest time to reach round 10 in seconds
|
|
234
|
+
* @type {number}
|
|
395
235
|
*/
|
|
396
|
-
this.
|
|
236
|
+
this.fastestRound10 = data[`fastest_time_10_zombies${type}`] || 0;
|
|
397
237
|
/**
|
|
398
|
-
*
|
|
399
|
-
* @type {
|
|
238
|
+
* Fastest time to reach round 20 in seconds
|
|
239
|
+
* @type {number}
|
|
400
240
|
*/
|
|
401
|
-
this.
|
|
241
|
+
this.fastestRound20 = data[`fastest_time_20_zombies${type}`] || 0;
|
|
402
242
|
/**
|
|
403
|
-
*
|
|
243
|
+
* Fastest time to reach round 30 in seconds
|
|
404
244
|
* @type {number}
|
|
405
245
|
*/
|
|
406
|
-
this.
|
|
246
|
+
this.fastestRound30 = data[`fastest_time_30_zombies${type}`] || 0;
|
|
407
247
|
/**
|
|
408
|
-
*
|
|
248
|
+
* Players revived
|
|
409
249
|
* @type {number}
|
|
410
250
|
*/
|
|
411
|
-
this.
|
|
251
|
+
this.playersRevived = data[`players_revived_zombies${type}`] || 0;
|
|
412
252
|
/**
|
|
413
|
-
*
|
|
253
|
+
* Number of times player is knocked down
|
|
414
254
|
* @type {number}
|
|
415
255
|
*/
|
|
416
|
-
this.
|
|
256
|
+
this.timesKnockedDown = data[`times_knocked_down_zombies${type}`] || 0;
|
|
417
257
|
/**
|
|
418
|
-
*
|
|
258
|
+
* Total amount of rounds the player survived
|
|
419
259
|
* @type {number}
|
|
420
260
|
*/
|
|
421
|
-
this.
|
|
261
|
+
this.roundsSurvived = data[`total_rounds_survived_zombies${type}`] || 0;
|
|
422
262
|
/**
|
|
423
|
-
*
|
|
263
|
+
* Total amount of windows fully repaired by player
|
|
424
264
|
* @type {number}
|
|
425
265
|
*/
|
|
426
|
-
this.
|
|
266
|
+
this.windowsRepaired = data[`windows_repaired_zombies${type}`] || 0;
|
|
267
|
+
/**
|
|
268
|
+
* Wins
|
|
269
|
+
* @type {number}
|
|
270
|
+
*/
|
|
271
|
+
this.wins = data[`wins_zombies${type}`] || 0;
|
|
272
|
+
/**
|
|
273
|
+
* Total Zombie Kills
|
|
274
|
+
* @type {number}
|
|
275
|
+
*/
|
|
276
|
+
this.zombieKills = data[`zombie_kills_zombies${type}`] || 0;
|
|
427
277
|
}
|
|
428
278
|
}
|
|
429
279
|
/**
|
|
@@ -459,86 +309,238 @@ class ZombieMap {
|
|
|
459
309
|
}
|
|
460
310
|
}
|
|
461
311
|
/**
|
|
462
|
-
* Zombies -
|
|
312
|
+
* Zombies - Overall stats
|
|
463
313
|
*/
|
|
464
|
-
class
|
|
314
|
+
class Zombies {
|
|
465
315
|
/**
|
|
466
316
|
* Constructor
|
|
467
317
|
* @param {Object} data Data from API
|
|
468
|
-
* @param {string} type Map name + difficulty ( default overall )
|
|
469
318
|
*/
|
|
470
|
-
constructor(data
|
|
471
|
-
if (type) type = `_${type}`;
|
|
319
|
+
constructor(data) {
|
|
472
320
|
/**
|
|
473
|
-
*
|
|
474
|
-
* @type {
|
|
321
|
+
* Overall Stats
|
|
322
|
+
* @type {ZombiesStats}
|
|
475
323
|
*/
|
|
476
|
-
this.
|
|
324
|
+
this.overall = new ZombiesStats(data);
|
|
477
325
|
/**
|
|
478
|
-
*
|
|
479
|
-
* @type {
|
|
326
|
+
* Stats for Dead End
|
|
327
|
+
* @type {ZombieMap}
|
|
480
328
|
*/
|
|
481
|
-
this.
|
|
329
|
+
this.deadEnd = new ZombieMap(data, 'deadend');
|
|
482
330
|
/**
|
|
483
|
-
*
|
|
484
|
-
* @type {
|
|
331
|
+
* Stats for Bad Blood
|
|
332
|
+
* @type {ZombieMap}
|
|
485
333
|
*/
|
|
486
|
-
this.
|
|
334
|
+
this.badBlood = new ZombieMap(data, 'badblood');
|
|
487
335
|
/**
|
|
488
|
-
*
|
|
489
|
-
* @type {
|
|
336
|
+
* Stats for Alien Arcadium
|
|
337
|
+
* @type {ZombieMap}
|
|
490
338
|
*/
|
|
491
|
-
this.
|
|
339
|
+
this.alienArcadium = new ZombieMap(data, 'alienarcadium');
|
|
492
340
|
/**
|
|
493
|
-
*
|
|
341
|
+
* Kills By Zombie
|
|
342
|
+
* @type {Record<string,number>}
|
|
343
|
+
*/
|
|
344
|
+
this.killsByZombie = parseZombiesKills(data);
|
|
345
|
+
/**
|
|
346
|
+
* Bullets Hit
|
|
494
347
|
* @type {number}
|
|
495
348
|
*/
|
|
496
|
-
this.
|
|
349
|
+
this.bulletsHit = data.bullets_hit_zombies || 0;
|
|
497
350
|
/**
|
|
498
|
-
*
|
|
351
|
+
* Bullets Shot
|
|
499
352
|
* @type {number}
|
|
500
353
|
*/
|
|
501
|
-
this.
|
|
354
|
+
this.bulletsShot = data.bullets_shot_zombies || 0;
|
|
502
355
|
/**
|
|
503
|
-
*
|
|
356
|
+
* Gun Accuracy
|
|
504
357
|
* @type {number}
|
|
505
358
|
*/
|
|
506
|
-
this.
|
|
359
|
+
this.gunAccuracy = divide(this.bulletsHit, this.bulletsShot);
|
|
507
360
|
/**
|
|
508
|
-
*
|
|
361
|
+
* Headshots
|
|
509
362
|
* @type {number}
|
|
510
363
|
*/
|
|
511
|
-
this.
|
|
364
|
+
this.headshots = data.headshots_zombies || 0;
|
|
512
365
|
/**
|
|
513
|
-
*
|
|
366
|
+
* Headshot Accuracy
|
|
514
367
|
* @type {number}
|
|
515
368
|
*/
|
|
516
|
-
this.
|
|
369
|
+
this.headshotAccuracy = divide(this.headshots, this.bulletsShot);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Arcade class
|
|
375
|
+
*/
|
|
376
|
+
class Arcade {
|
|
377
|
+
/**
|
|
378
|
+
* Constructor
|
|
379
|
+
* @param {Object} data Data from the API
|
|
380
|
+
*/
|
|
381
|
+
constructor(data = {}) {
|
|
517
382
|
/**
|
|
518
|
-
*
|
|
383
|
+
* Amount of coins
|
|
519
384
|
* @type {number}
|
|
520
385
|
*/
|
|
521
|
-
this.
|
|
386
|
+
this.coins = data.coins || 0;
|
|
522
387
|
/**
|
|
523
|
-
*
|
|
388
|
+
* Weekly coins
|
|
524
389
|
* @type {number}
|
|
525
390
|
*/
|
|
526
|
-
this.
|
|
391
|
+
this.weeklyCoins = parseInt(data[`weekly_coins_${weekAB()}`] || 0, 10);
|
|
527
392
|
/**
|
|
528
|
-
*
|
|
393
|
+
* Monthly coins
|
|
529
394
|
* @type {number}
|
|
530
395
|
*/
|
|
531
|
-
this.
|
|
396
|
+
this.monthlyCoins = parseInt(data[`monthly_coins_${monthAB()}`] || 0, 10);
|
|
397
|
+
/**
|
|
398
|
+
* Hints Disabled
|
|
399
|
+
* @type {boolean}
|
|
400
|
+
*/
|
|
401
|
+
this.hintsDisabled = !data.hints;
|
|
402
|
+
/**
|
|
403
|
+
* Flash Disabled
|
|
404
|
+
* @type {boolean}
|
|
405
|
+
*/
|
|
406
|
+
this.flashDisabled = !data.flash;
|
|
407
|
+
/**
|
|
408
|
+
* Draw their thing stats
|
|
409
|
+
* @type {BaseGame}
|
|
410
|
+
*/
|
|
411
|
+
this.drawTheirThing = new BaseGame(data, 'draw_their_thing');
|
|
412
|
+
/**
|
|
413
|
+
* Dragon wars "2" stats
|
|
414
|
+
* @type {BaseGame}
|
|
415
|
+
*/
|
|
416
|
+
this.dragonWars = new BaseGame(data, 'dragonwars2');
|
|
417
|
+
/**
|
|
418
|
+
* Easter Simulator stats
|
|
419
|
+
* @type {EasterSimulator}
|
|
420
|
+
*/
|
|
421
|
+
this.easterSimulator = new BaseGame(data, 'easter_simulator').extend(
|
|
422
|
+
'eggsFound',
|
|
423
|
+
data.eggs_found_easter_simulator || 0
|
|
424
|
+
);
|
|
425
|
+
/**
|
|
426
|
+
* Grinch Simulator stats
|
|
427
|
+
* @type {GrinchSimulator}
|
|
428
|
+
*/
|
|
429
|
+
this.grinchSimulator = new BaseGame(data, 'grinch_simulator_v2').extend(
|
|
430
|
+
'giftsFound',
|
|
431
|
+
data.gifts_grinch_simulator_v2 || 0
|
|
432
|
+
);
|
|
433
|
+
/**
|
|
434
|
+
* Scuba Simulator stats
|
|
435
|
+
* @type {ScubaSimulator}
|
|
436
|
+
*/
|
|
437
|
+
this.scubaSimulator = new BaseGame(data, 'scuba_simulator').extend(
|
|
438
|
+
'itemsFound',
|
|
439
|
+
data.items_found_scuba_simulator || 0
|
|
440
|
+
);
|
|
441
|
+
/**
|
|
442
|
+
* Santa Simulator stats
|
|
443
|
+
* @type {SantaSimulator}
|
|
444
|
+
*/
|
|
445
|
+
this.santaSimulator = new BaseGame(data, 'santa_simulator').extend(
|
|
446
|
+
'giftsDelivered',
|
|
447
|
+
data.delivered_santa_simulator || 0
|
|
448
|
+
);
|
|
449
|
+
/**
|
|
450
|
+
* Santa Says stats
|
|
451
|
+
* @type {BaseGame}
|
|
452
|
+
*/
|
|
453
|
+
this.santaSays = new BaseGame(data, 'santa_says');
|
|
454
|
+
/**
|
|
455
|
+
* Simon Says stats
|
|
456
|
+
* @type {BaseGame}
|
|
457
|
+
*/
|
|
458
|
+
this.simonSays = new BaseGame(data, 'simon_says');
|
|
459
|
+
/**
|
|
460
|
+
* Farm Hunt stats
|
|
461
|
+
* @type {BaseGame}
|
|
462
|
+
*/
|
|
463
|
+
this.farmHunt = new BaseGame(data, 'farm_hunt');
|
|
464
|
+
/**
|
|
465
|
+
* Hole in the Wall stats
|
|
466
|
+
* @type {HITW}
|
|
467
|
+
*/
|
|
468
|
+
this.holeInTheWall = new HITW(data, 'hole_in_the_wall');
|
|
469
|
+
/**
|
|
470
|
+
* Mini Walls stats
|
|
471
|
+
* @type {MiniWalls}
|
|
472
|
+
*/
|
|
473
|
+
// TODO needs extension
|
|
474
|
+
this.miniWalls = new MiniWalls(data);
|
|
475
|
+
/**
|
|
476
|
+
* Party games (1) stats
|
|
477
|
+
* @type {BaseGame}
|
|
478
|
+
*/
|
|
479
|
+
this.partyGames = new BaseGame(data, 'party');
|
|
480
|
+
/**
|
|
481
|
+
* Party Games 2 stats ( legacy )
|
|
482
|
+
* @type {BaseGame}
|
|
483
|
+
* @deprecated
|
|
484
|
+
*/
|
|
485
|
+
this.partyGames2 = new BaseGame(data, 'party_2');
|
|
486
|
+
/**
|
|
487
|
+
* Party Games 3 stats ( legacy )
|
|
488
|
+
* @type {BaseGame}
|
|
489
|
+
* @deprecated
|
|
490
|
+
*/
|
|
491
|
+
this.partyGames3 = new BaseGame(data, 'party_3');
|
|
492
|
+
/**
|
|
493
|
+
* Throw out stats
|
|
494
|
+
* @type {BaseGame}
|
|
495
|
+
*/
|
|
496
|
+
this.throwOut = new BaseGame(data, 'throw_out');
|
|
497
|
+
/**
|
|
498
|
+
* Soccer stats
|
|
499
|
+
* @type {Soccer}
|
|
500
|
+
*/
|
|
501
|
+
this.soccer = new Soccer(data);
|
|
502
|
+
/**
|
|
503
|
+
* Hypixel Sports stats
|
|
504
|
+
* @type {BaseGame}
|
|
505
|
+
* @deprecated
|
|
506
|
+
*/
|
|
507
|
+
this.hypixelSports = new BaseGame(data, 'hypixel_sports');
|
|
508
|
+
/**
|
|
509
|
+
* Ender Spleef stats
|
|
510
|
+
* @type {BaseGame}
|
|
511
|
+
*/
|
|
512
|
+
this.enderSpleef = new BaseGame(data, 'ender');
|
|
513
|
+
/**
|
|
514
|
+
* Blocking dead ( previously known as DayOne ) stats
|
|
515
|
+
* @type {BlockingDead}
|
|
516
|
+
*/
|
|
517
|
+
this.blockingDead = new BaseGame(data, 'dayone').extend('headshots', data.headshots_dayone || 0);
|
|
518
|
+
/**
|
|
519
|
+
* Galaxy Wars stats
|
|
520
|
+
* @type {GalaxyWars}
|
|
521
|
+
*/
|
|
522
|
+
this.galaxyWars = new GalaxyWars(data);
|
|
523
|
+
// Lenient parsing
|
|
524
|
+
/**
|
|
525
|
+
* OITQ / One In The Quiver stats
|
|
526
|
+
* @type {OITQ}
|
|
527
|
+
*/
|
|
528
|
+
this.oitq = this.oneInTheQuiver = new BaseGame(data, 'oneinthequiver').extend(
|
|
529
|
+
'bountyKills',
|
|
530
|
+
data.bounty_kills_oneinthequiver || 0
|
|
531
|
+
);
|
|
532
|
+
/**
|
|
533
|
+
* Zombies
|
|
534
|
+
* @type {Zombies}
|
|
535
|
+
*/
|
|
536
|
+
this.zombies = new Zombies(data);
|
|
537
|
+
/**
|
|
538
|
+
* Capture The Wool
|
|
539
|
+
* @type {{kills: number, captures: number}}
|
|
540
|
+
*/
|
|
541
|
+
this.captureTheWool = { kills: data.arcade_ctw_slayer || 0, captures: data.arcade_ctw_oh_sheep || 0 };
|
|
532
542
|
}
|
|
533
543
|
}
|
|
534
|
-
// eslint-disable-next-line require-jsdoc
|
|
535
|
-
function parseZombiesKills(data) {
|
|
536
|
-
const matches = Array.from(Object.keys(data))
|
|
537
|
-
.map((x) => x.match(/^([A-z]+)_zombie_kills_zombies$/))
|
|
538
|
-
.filter((x) => x);
|
|
539
|
-
// From entries might be broken
|
|
540
|
-
return Object.fromEntries(matches.map((x) => [removeSnakeCaseString(x[1]), data[x[0]] || 0]));
|
|
541
|
-
}
|
|
542
544
|
/**
|
|
543
545
|
* @typedef {Object} EasterSimulator
|
|
544
546
|
* @extends BaseGame
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
const divide = require('../../utils/divide');
|
|
2
|
+
// eslint-disable-next-line jsdoc/require-jsdoc
|
|
3
|
+
function generateModeStats(data, mode) {
|
|
4
|
+
return {
|
|
5
|
+
kills: data[`kills_${mode}`] || 0,
|
|
6
|
+
deaths: data[`deaths_${mode}`] || 0,
|
|
7
|
+
KDRatio: divide(data[`kills_${mode}`], data[`deaths_${mode}`]),
|
|
8
|
+
wins: data[`wins_${mode}`] || 0,
|
|
9
|
+
losses: data[`losses_${mode}`] || 0,
|
|
10
|
+
WLRatio: divide(data[`wins_${mode}`], data[`losses_${mode}`])
|
|
11
|
+
};
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* ArenaBrawl class
|
|
4
15
|
*/
|
|
@@ -23,17 +34,6 @@ class ArenaBrawl {
|
|
|
23
34
|
};
|
|
24
35
|
}
|
|
25
36
|
}
|
|
26
|
-
// eslint-disable-next-line require-jsdoc
|
|
27
|
-
function generateModeStats(data, mode) {
|
|
28
|
-
return {
|
|
29
|
-
kills: data[`kills_${mode}`] || 0,
|
|
30
|
-
deaths: data[`deaths_${mode}`] || 0,
|
|
31
|
-
KDRatio: divide(data[`kills_${mode}`], data[`deaths_${mode}`]),
|
|
32
|
-
wins: data[`wins_${mode}`] || 0,
|
|
33
|
-
losses: data[`losses_${mode}`] || 0,
|
|
34
|
-
WLRatio: divide(data[`wins_${mode}`], data[`losses_${mode}`])
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
37
|
/**
|
|
38
38
|
* @typedef {Object} ArenaBrawlStats
|
|
39
39
|
* @property {ArenaBrawlModeStats} '1v1' ArenaBrawl 1v1 stats
|