hypixel-api-reborn 11.2.0 → 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/README.md +1 -1
- package/eslint.config.mjs +71 -0
- package/package.json +14 -20
- 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/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/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/getGarden.js +7 -0
- package/src/API/skyblock/getGovernment.js +1 -2
- package/src/API/skyblock/getMember.js +5 -2
- package/src/API/skyblock/getMuseum.js +1 -0
- package/src/API/skyblock/getNews.js +1 -0
- package/src/API/skyblock/getProfiles.js +5 -2
- package/src/Client.js +88 -16
- package/src/Private/rateLimit.js +7 -11
- package/src/Private/requests.js +12 -13
- package/src/Private/updater.js +2 -3
- package/src/Private/uuidCache.js +1 -2
- package/src/Private/validate.js +19 -19
- package/src/index.js +5 -0
- 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/House.js +54 -0
- package/src/structures/MiniGames/Arcade.js +798 -312
- package/src/structures/MiniGames/ArenaBrawl.js +98 -32
- package/src/structures/MiniGames/BedWars.js +197 -194
- package/src/structures/MiniGames/BlitzSurvivalGames.js +381 -129
- package/src/structures/MiniGames/BuildBattle.js +19 -8
- package/src/structures/MiniGames/CopsAndCrims.js +253 -25
- package/src/structures/MiniGames/Duels.js +905 -664
- 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/Pit.js +4 -5
- package/src/structures/MiniGames/Quakecraft.js +113 -50
- package/src/structures/MiniGames/SkyWars.js +528 -372
- package/src/structures/MiniGames/SmashHeroes.js +201 -73
- package/src/structures/MiniGames/SpeedUHC.js +77 -24
- package/src/structures/MiniGames/TNTGames.js +242 -73
- package/src/structures/MiniGames/TurboKartRacers.js +55 -115
- package/src/structures/MiniGames/UHC.js +144 -132
- package/src/structures/MiniGames/VampireZ.js +70 -37
- package/src/structures/MiniGames/Warlords.js +126 -1
- package/src/structures/MiniGames/WoolWars.js +60 -9
- package/src/structures/Pet.js +1 -1
- package/src/structures/Player.js +43 -128
- 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/SkyblockGarden.js +146 -0
- package/src/structures/SkyBlock/SkyblockInventoryItem.js +4 -28
- package/src/structures/SkyBlock/SkyblockMember.js +90 -228
- 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 +522 -520
- package/src/utils/{guildExp.js → Guild.js} +42 -12
- package/src/utils/Player.js +112 -0
- package/src/utils/SkyblockUtils.js +482 -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 +1186 -967
- package/src/utils/toIGN.js +0 -24
|
@@ -1,226 +1,649 @@
|
|
|
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
|
+
// 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]));
|
|
14
|
+
}
|
|
7
15
|
/**
|
|
8
|
-
*
|
|
16
|
+
* Zombies - Stats by Map + Difficulty
|
|
9
17
|
*/
|
|
10
|
-
class
|
|
18
|
+
class ZombiesStats {
|
|
11
19
|
/**
|
|
12
20
|
* Constructor
|
|
13
|
-
* @param {Object} data Data from
|
|
21
|
+
* @param {Object} data Data from API
|
|
22
|
+
* @param {string} type Map name + difficulty ( default overall )
|
|
14
23
|
*/
|
|
15
|
-
constructor(data =
|
|
24
|
+
constructor(data, type = '') {
|
|
25
|
+
if (type) type = `_${type}`;
|
|
16
26
|
/**
|
|
17
|
-
*
|
|
27
|
+
* Best Round
|
|
18
28
|
* @type {number}
|
|
19
29
|
*/
|
|
20
|
-
this.
|
|
30
|
+
this.bestRound = data[`best_round_zombies${type}`] || 0;
|
|
21
31
|
/**
|
|
22
|
-
*
|
|
32
|
+
* Deaths ( NOT losses )
|
|
23
33
|
* @type {number}
|
|
24
34
|
*/
|
|
25
|
-
this.
|
|
35
|
+
this.deaths = data[`deaths_zombies${type}`] || 0;
|
|
26
36
|
/**
|
|
27
|
-
*
|
|
37
|
+
* Doors opened
|
|
28
38
|
* @type {number}
|
|
29
39
|
*/
|
|
30
|
-
this.
|
|
40
|
+
this.doorsOpened = data[`doors_opened_zombies${type}`] || 0;
|
|
31
41
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @type {
|
|
42
|
+
* Fastest time to reach round 10 in seconds
|
|
43
|
+
* @type {number}
|
|
34
44
|
*/
|
|
35
|
-
this.
|
|
45
|
+
this.fastestRound10 = data[`fastest_time_10_zombies${type}_normal`] || 0;
|
|
36
46
|
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {
|
|
47
|
+
* Fastest time to reach round 20 in seconds
|
|
48
|
+
* @type {number}
|
|
39
49
|
*/
|
|
40
|
-
this.
|
|
50
|
+
this.fastestRound20 = data[`fastest_time_20_zombies${type}_normal`] || 0;
|
|
41
51
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @type {
|
|
52
|
+
* Fastest time to reach round 30 in seconds
|
|
53
|
+
* @type {number}
|
|
44
54
|
*/
|
|
45
|
-
this.
|
|
55
|
+
this.fastestRound30 = data[`fastest_time_30_zombies${type}_normal`] || 0;
|
|
46
56
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @type {
|
|
57
|
+
* Players revived
|
|
58
|
+
* @type {number}
|
|
49
59
|
*/
|
|
50
|
-
this.
|
|
60
|
+
this.playersRevived = data[`players_revived_zombies${type}`] || 0;
|
|
51
61
|
/**
|
|
52
|
-
*
|
|
53
|
-
* @type {
|
|
62
|
+
* Number of times player is knocked down
|
|
63
|
+
* @type {number}
|
|
54
64
|
*/
|
|
55
|
-
this.
|
|
56
|
-
'eggsFound',
|
|
57
|
-
data.eggs_found_easter_simulator || 0
|
|
58
|
-
);
|
|
65
|
+
this.timesKnockedDown = data[`times_knocked_down_zombies${type}`] || 0;
|
|
59
66
|
/**
|
|
60
|
-
*
|
|
61
|
-
* @type {
|
|
67
|
+
* Total amount of rounds the player survived
|
|
68
|
+
* @type {number}
|
|
62
69
|
*/
|
|
63
|
-
this.
|
|
64
|
-
'giftsFound',
|
|
65
|
-
data.gifts_grinch_simulator_v2 || 0
|
|
66
|
-
);
|
|
70
|
+
this.roundsSurvived = data[`total_rounds_survived_zombies${type}`] || 0;
|
|
67
71
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @type {
|
|
72
|
+
* Total amount of windows fully repaired by player
|
|
73
|
+
* @type {number}
|
|
70
74
|
*/
|
|
71
|
-
this.
|
|
72
|
-
'itemsFound',
|
|
73
|
-
data.items_found_scuba_simulator || 0
|
|
74
|
-
);
|
|
75
|
+
this.windowsRepaired = data[`windows_repaired_zombies${type}`] || 0;
|
|
75
76
|
/**
|
|
76
|
-
*
|
|
77
|
-
* @type {
|
|
77
|
+
* Wins
|
|
78
|
+
* @type {number}
|
|
78
79
|
*/
|
|
79
|
-
this.
|
|
80
|
-
'giftsDelivered',
|
|
81
|
-
data.delivered_santa_simulator || 0
|
|
82
|
-
);
|
|
80
|
+
this.wins = data[`wins_zombies${type}`] || 0;
|
|
83
81
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @type {
|
|
82
|
+
* Total Zombie Kills
|
|
83
|
+
* @type {number}
|
|
86
84
|
*/
|
|
87
|
-
this.
|
|
85
|
+
this.zombieKills = data[`zombie_kills_zombies${type}`] || 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Zombies - Overall stats
|
|
91
|
+
*/
|
|
92
|
+
class Zombies {
|
|
93
|
+
/**
|
|
94
|
+
* Constructor
|
|
95
|
+
* @param {Object} data Data from API
|
|
96
|
+
*/
|
|
97
|
+
constructor(data) {
|
|
88
98
|
/**
|
|
89
|
-
*
|
|
90
|
-
* @type {
|
|
99
|
+
* Overall Stats
|
|
100
|
+
* @type {ZombiesStats}
|
|
91
101
|
*/
|
|
92
|
-
this.
|
|
102
|
+
this.overall = new ZombiesStats(data);
|
|
93
103
|
/**
|
|
94
|
-
*
|
|
95
|
-
* @type {
|
|
104
|
+
* Stats for Dead End
|
|
105
|
+
* @type {ZombiesStats}
|
|
96
106
|
*/
|
|
97
|
-
this.
|
|
107
|
+
this.deadEnd = new ZombiesStats(data, 'deadend');
|
|
98
108
|
/**
|
|
99
|
-
*
|
|
100
|
-
* @type {
|
|
109
|
+
* Stats for Bad Blood
|
|
110
|
+
* @type {ZombiesStats}
|
|
101
111
|
*/
|
|
102
|
-
this.
|
|
112
|
+
this.badBlood = new ZombiesStats(data, 'badblood');
|
|
103
113
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @type {
|
|
114
|
+
* Stats for Alien Arcadium
|
|
115
|
+
* @type {ZombiesStats}
|
|
106
116
|
*/
|
|
107
|
-
this.
|
|
117
|
+
this.alienArcadium = new ZombiesStats(data, 'alienarcadium');
|
|
108
118
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @type {
|
|
119
|
+
* Stats for Prison
|
|
120
|
+
* @type {ZombiesStats}
|
|
111
121
|
*/
|
|
112
|
-
this.
|
|
122
|
+
this.prison = new ZombiesStats(data, 'prison');
|
|
113
123
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @type {
|
|
116
|
-
* @deprecated
|
|
124
|
+
* Kills By Zombie
|
|
125
|
+
* @type {Record<string, number>}
|
|
117
126
|
*/
|
|
118
|
-
this.
|
|
127
|
+
this.killsByZombie = parseZombiesKills(data);
|
|
119
128
|
/**
|
|
120
|
-
*
|
|
121
|
-
* @type {
|
|
122
|
-
* @deprecated
|
|
129
|
+
* Bullets Hit
|
|
130
|
+
* @type {number}
|
|
123
131
|
*/
|
|
124
|
-
this.
|
|
132
|
+
this.bulletsHit = data.bullets_hit_zombies || 0;
|
|
125
133
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @type {
|
|
134
|
+
* Bullets Shot
|
|
135
|
+
* @type {number}
|
|
128
136
|
*/
|
|
129
|
-
this.
|
|
137
|
+
this.bulletsShot = data.bullets_shot_zombies || 0;
|
|
130
138
|
/**
|
|
131
|
-
*
|
|
132
|
-
* @type {
|
|
139
|
+
* Gun Accuracy
|
|
140
|
+
* @type {number}
|
|
133
141
|
*/
|
|
134
|
-
this.
|
|
142
|
+
this.gunAccuracy = divide(this.bulletsHit, this.bulletsShot);
|
|
135
143
|
/**
|
|
136
|
-
*
|
|
137
|
-
* @type {
|
|
138
|
-
* @deprecated
|
|
144
|
+
* Headshots
|
|
145
|
+
* @type {number}
|
|
139
146
|
*/
|
|
140
|
-
this.
|
|
147
|
+
this.headshots = data.headshots_zombies || 0;
|
|
141
148
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @type {
|
|
149
|
+
* Headshot Accuracy
|
|
150
|
+
* @type {number}
|
|
144
151
|
*/
|
|
145
|
-
this.
|
|
152
|
+
this.headshotAccuracy = divide(this.headshots, this.bulletsShot);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Dropper stats by map
|
|
158
|
+
*/
|
|
159
|
+
class DropperMap {
|
|
160
|
+
/**
|
|
161
|
+
* Constructor
|
|
162
|
+
* @param {Object} data Data from API
|
|
163
|
+
* @param {string} mapName String map name
|
|
164
|
+
*/
|
|
165
|
+
constructor(data, mapName) {
|
|
146
166
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @type {
|
|
167
|
+
* Best Complete Time
|
|
168
|
+
* @type {number}
|
|
149
169
|
*/
|
|
150
|
-
this.
|
|
170
|
+
this.bestTime = data?.[mapName]?.best_time ?? 0;
|
|
151
171
|
/**
|
|
152
|
-
*
|
|
153
|
-
* @type {
|
|
172
|
+
* Total completions
|
|
173
|
+
* @type {number}
|
|
154
174
|
*/
|
|
155
|
-
this.
|
|
156
|
-
|
|
175
|
+
this.completions = data?.[mapName]?.completions ?? 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Blocking Dead class
|
|
181
|
+
*/
|
|
182
|
+
class BlockingDead {
|
|
183
|
+
constructor(data) {
|
|
184
|
+
/**
|
|
185
|
+
* Wins
|
|
186
|
+
* @type {number}
|
|
187
|
+
*/
|
|
188
|
+
this.wins = data.wins_dayone || 0;
|
|
189
|
+
/**
|
|
190
|
+
* Kills
|
|
191
|
+
* @type {number}
|
|
192
|
+
*/
|
|
193
|
+
this.kills = data.kills_dayone || 0;
|
|
194
|
+
/**
|
|
195
|
+
* Headshots
|
|
196
|
+
* @type {number}
|
|
197
|
+
*/
|
|
198
|
+
this.headshots = data.headshots_dayone || 0;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Bounty Hunters class
|
|
203
|
+
*/
|
|
204
|
+
class BountyHunters {
|
|
205
|
+
constructor(data) {
|
|
206
|
+
/**
|
|
207
|
+
* Wins
|
|
208
|
+
* @type {number}
|
|
209
|
+
*/
|
|
210
|
+
this.wins = data.wins_oneinthequiver || 0;
|
|
211
|
+
/**
|
|
212
|
+
* Kills
|
|
213
|
+
* @type {number}
|
|
214
|
+
*/
|
|
215
|
+
this.kills = data.kills_oneinthequiver || 0;
|
|
216
|
+
/**
|
|
217
|
+
* Deaths
|
|
218
|
+
* @type {number}
|
|
219
|
+
*/
|
|
220
|
+
this.deaths = data.deaths_oneinthequiver || 0;
|
|
221
|
+
/**
|
|
222
|
+
* Kill Death Ratio
|
|
223
|
+
* @type {number}
|
|
224
|
+
*/
|
|
225
|
+
this.KDRatio = divide(this.kills, this.deaths);
|
|
226
|
+
/**
|
|
227
|
+
* Bounty Kills
|
|
228
|
+
* @type {number}
|
|
229
|
+
*/
|
|
230
|
+
this.bountyKills = data.bounty_kills_oneinthequiver || 0;
|
|
231
|
+
/**
|
|
232
|
+
* Bow Kills
|
|
233
|
+
* @type {number}
|
|
234
|
+
*/
|
|
235
|
+
this.bowKills = data.bow_kills_oneinthequiver || 0;
|
|
236
|
+
/**
|
|
237
|
+
* Sword Kills
|
|
238
|
+
* @type {number}
|
|
239
|
+
*/
|
|
240
|
+
this.swordKills = data.sword_kills_oneinthequiver || 0;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Capture the Wool class
|
|
245
|
+
*/
|
|
246
|
+
class CaptureTheWool {
|
|
247
|
+
constructor(data) {
|
|
248
|
+
/**
|
|
249
|
+
* Wins
|
|
250
|
+
* @type {number}
|
|
251
|
+
*/
|
|
252
|
+
this.wins = data.woolhunt_participated_wins || 0;
|
|
253
|
+
/**
|
|
254
|
+
* Losses
|
|
255
|
+
* @type {number}
|
|
256
|
+
*/
|
|
257
|
+
this.losses = data.woolhunt_participated_losses || 0;
|
|
258
|
+
/**
|
|
259
|
+
* Win Loss ratio
|
|
260
|
+
* @type {number}
|
|
261
|
+
*/
|
|
262
|
+
this.WLRatio = divide(this.wins, this.losses);
|
|
263
|
+
/**
|
|
264
|
+
* Draws
|
|
265
|
+
* @type {number}
|
|
266
|
+
*/
|
|
267
|
+
this.draws = data.woolhunt_participated_draws || 0;
|
|
268
|
+
/**
|
|
269
|
+
* Kills
|
|
270
|
+
* @type {number}
|
|
271
|
+
*/
|
|
272
|
+
this.kills = data.woolhunt_kills || 0;
|
|
273
|
+
/**
|
|
274
|
+
* Deaths
|
|
275
|
+
* @type {number}
|
|
276
|
+
*/
|
|
277
|
+
this.deaths = data.woolhunt_deaths || 0;
|
|
278
|
+
/**
|
|
279
|
+
* Kill Death ratio
|
|
280
|
+
* @type {number}
|
|
281
|
+
*/
|
|
282
|
+
this.KDRatio = divide(this.kills, this.deaths);
|
|
283
|
+
/**
|
|
284
|
+
* assists
|
|
285
|
+
* @type {number}
|
|
286
|
+
*/
|
|
287
|
+
this.assists = data.woolhunt_assists || 0;
|
|
288
|
+
/**
|
|
289
|
+
* woolPickedUp
|
|
290
|
+
* @type {number}
|
|
291
|
+
*/
|
|
292
|
+
this.woolPickedUp = data.woolhunt_wools_stolen || 0;
|
|
293
|
+
/**
|
|
294
|
+
* woolCaptured
|
|
295
|
+
* @type {number}
|
|
296
|
+
*/
|
|
297
|
+
this.woolCaptured = data.woolhunt_wools_captured || 0;
|
|
298
|
+
/**
|
|
299
|
+
* fastestWin (In seconds)
|
|
300
|
+
* @type {number}
|
|
301
|
+
*/
|
|
302
|
+
this.fastestWin = data.woolhunt_fastest_win || 0;
|
|
303
|
+
/**
|
|
304
|
+
* longestGame (In seconds)
|
|
305
|
+
* @type {number}
|
|
306
|
+
*/
|
|
307
|
+
this.longestGame = data.woolhunt_longest_game || 0;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Dragon Wars class
|
|
312
|
+
*/
|
|
313
|
+
class DragonWars {
|
|
314
|
+
constructor(data) {
|
|
315
|
+
/**
|
|
316
|
+
* Wins
|
|
317
|
+
* @type {number}
|
|
318
|
+
*/
|
|
319
|
+
this.wins = data.wins_dragonwars2 || 0;
|
|
320
|
+
/**
|
|
321
|
+
* Kills
|
|
322
|
+
* @type {number}
|
|
323
|
+
*/
|
|
324
|
+
this.kills = data.kills_dragonwars2 || 0;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Dropper class
|
|
329
|
+
*/
|
|
330
|
+
class Dropper {
|
|
331
|
+
constructor(data) {
|
|
332
|
+
/**
|
|
333
|
+
* Total Wins
|
|
334
|
+
* @type {number}
|
|
335
|
+
*/
|
|
336
|
+
this.wins = data?.wins ?? 0;
|
|
337
|
+
/**
|
|
338
|
+
* Total Fails
|
|
339
|
+
* @type {number}
|
|
340
|
+
*/
|
|
341
|
+
this.fails = data?.fails ?? 0;
|
|
342
|
+
/**
|
|
343
|
+
* Fastest Game
|
|
344
|
+
* @type {number}
|
|
345
|
+
*/
|
|
346
|
+
this.fastestGame = data?.fastest_game ?? 0;
|
|
347
|
+
/**
|
|
348
|
+
* Total Amount of Flawless Games
|
|
349
|
+
* @type {number}
|
|
350
|
+
*/
|
|
351
|
+
this.flawlessGames = data?.flawless_games ?? 0;
|
|
352
|
+
/**
|
|
353
|
+
* Total Amount of Games Played
|
|
354
|
+
* @type {number}
|
|
355
|
+
*/
|
|
356
|
+
this.gamesPlayed = data?.games_played ?? 0;
|
|
357
|
+
/**
|
|
358
|
+
* Total Amount of Maps Completed
|
|
359
|
+
* @type {number}
|
|
360
|
+
*/
|
|
361
|
+
this.mapsCompleted = data?.maps_completed ?? 0;
|
|
362
|
+
/**
|
|
363
|
+
* Total Amount of Games Finished
|
|
364
|
+
* @type {number}
|
|
365
|
+
*/
|
|
366
|
+
this.gamesFinished = data?.games_finished ?? 0;
|
|
367
|
+
/**
|
|
368
|
+
* Maps
|
|
369
|
+
* @type {Object.<string, DropperMap>}
|
|
370
|
+
*/
|
|
371
|
+
this.maps = {};
|
|
372
|
+
Object.keys(data?.map_stats ?? {}).forEach((map) => {
|
|
373
|
+
this.maps[map] = new DropperMap(data?.map_stats, map);
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Ender Spleef class
|
|
379
|
+
*/
|
|
380
|
+
class EnderSpleef {
|
|
381
|
+
constructor(data) {
|
|
382
|
+
/**
|
|
383
|
+
* Wins
|
|
384
|
+
* @type {number}
|
|
385
|
+
*/
|
|
386
|
+
this.wins = data.wins_ender || 0;
|
|
387
|
+
/**
|
|
388
|
+
* Kills
|
|
389
|
+
* @type {number}
|
|
390
|
+
*/
|
|
391
|
+
this.kills = data.kills_dragonwars2 || 0;
|
|
392
|
+
/**
|
|
393
|
+
* Trail
|
|
394
|
+
* @type {string}
|
|
395
|
+
*/
|
|
396
|
+
this.trail = data.enderspleef_trail || '';
|
|
397
|
+
/**
|
|
398
|
+
* Blocks Destroyed
|
|
399
|
+
* @type {number}
|
|
400
|
+
*/
|
|
401
|
+
this.blocksDestroyed = data.blocks_destroyed_ender || 0;
|
|
402
|
+
/**
|
|
403
|
+
* Big Shot Activations
|
|
404
|
+
* @type {number}
|
|
405
|
+
*/
|
|
406
|
+
this.bigShotActivations = data.bigshot_powerup_activations_ender || 0;
|
|
407
|
+
/**
|
|
408
|
+
* Triple Shot Activations
|
|
409
|
+
* @type {number}
|
|
410
|
+
*/
|
|
411
|
+
this.tripleShotActivations = data.tripleshot_powerup_activations_ender || 0;
|
|
412
|
+
/**
|
|
413
|
+
* Total Powerup Activations
|
|
414
|
+
* @type {number}
|
|
415
|
+
*/
|
|
416
|
+
this.totalPowerUpActivations = this.bigShotActivations + this.tripleShotActivations;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Farm Hunt class
|
|
421
|
+
*/
|
|
422
|
+
class FarmHunt {
|
|
423
|
+
constructor(data) {
|
|
424
|
+
/**
|
|
425
|
+
* Wins
|
|
426
|
+
* @type {number}
|
|
427
|
+
*/
|
|
428
|
+
this.wins = data.wins_farm_hunt || 0;
|
|
429
|
+
/**
|
|
430
|
+
* Wins as Animal
|
|
431
|
+
* @type {number}
|
|
432
|
+
*/
|
|
433
|
+
this.winsAsAnimal = data.animal_wins_farm_hunt || 0;
|
|
434
|
+
/**
|
|
435
|
+
* Wins as Hunter
|
|
436
|
+
* @type {number}
|
|
437
|
+
*/
|
|
438
|
+
this.winsAsHunter = data.hunter_wins_farm_hunt || 0;
|
|
439
|
+
/**
|
|
440
|
+
* Kills
|
|
441
|
+
* @type {number}
|
|
442
|
+
*/
|
|
443
|
+
this.kills = data.kills_farm_hunt || 0;
|
|
444
|
+
/**
|
|
445
|
+
* Kills as Animal
|
|
446
|
+
* @type {number}
|
|
447
|
+
*/
|
|
448
|
+
this.killsAsAnimal = data.animal_kills_farm_hunt || 0;
|
|
449
|
+
/**
|
|
450
|
+
* Kills as Hunter
|
|
451
|
+
* @type {number}
|
|
452
|
+
*/
|
|
453
|
+
this.killsAsHunter = data.hunter_kills_farm_hunt || 0;
|
|
454
|
+
/**
|
|
455
|
+
* Taunts Used
|
|
456
|
+
* @type {number}
|
|
457
|
+
*/
|
|
458
|
+
this.tauntsUsed = data.taunts_used_farm_hunt || 0;
|
|
459
|
+
/**
|
|
460
|
+
* Risky Taunts Used
|
|
461
|
+
* @type {number}
|
|
462
|
+
*/
|
|
463
|
+
this.riskyTauntsUsed = data.risky_taunts_used_farm_hunt || 0;
|
|
464
|
+
/**
|
|
465
|
+
* Safe Taunts Used
|
|
466
|
+
* @type {number}
|
|
467
|
+
*/
|
|
468
|
+
this.safeTauntsUsed = data.safe_taunts_used_farm_hunt || 0;
|
|
469
|
+
/**
|
|
470
|
+
* Dangerous Taunts Used
|
|
471
|
+
* @type {number}
|
|
472
|
+
*/
|
|
473
|
+
this.dangerousTauntsUsed = data.dangerous_taunts_used_farm_hunt || 0;
|
|
474
|
+
/**
|
|
475
|
+
* Firework Taunts Used
|
|
476
|
+
* @type {number}
|
|
477
|
+
*/
|
|
478
|
+
this.fireworkTauntsUsed = data.firework_taunts_used_farm_hunt || 0;
|
|
479
|
+
/**
|
|
480
|
+
* Poop Collected
|
|
481
|
+
* @type {number}
|
|
482
|
+
*/
|
|
483
|
+
this.poop = (data.poop_collected_farm_hunt || 0) + (data.poop_collected || 0);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Football class
|
|
488
|
+
*/
|
|
489
|
+
class Football {
|
|
490
|
+
constructor(data) {
|
|
491
|
+
/**
|
|
492
|
+
* Wins
|
|
493
|
+
* @type {number}
|
|
494
|
+
*/
|
|
495
|
+
this.wins = data.wins_soccer || 0;
|
|
496
|
+
/**
|
|
497
|
+
* Goals
|
|
498
|
+
* @type {number}
|
|
499
|
+
*/
|
|
500
|
+
this.goals = data.goals_soccer || 0;
|
|
501
|
+
/**
|
|
502
|
+
* Kikcs
|
|
503
|
+
* @type {number}
|
|
504
|
+
*/
|
|
505
|
+
this.kicks = data.kicks_soccer || 0;
|
|
506
|
+
/**
|
|
507
|
+
* Power Kicks
|
|
508
|
+
* @type {number}
|
|
509
|
+
*/
|
|
510
|
+
this.powerKicks = data.powerkicks_soccer || 0;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Galxy Wars
|
|
515
|
+
*/
|
|
516
|
+
class GalaxyWars {
|
|
517
|
+
/**
|
|
518
|
+
* @param {Object} data Data from API
|
|
519
|
+
*/
|
|
520
|
+
constructor(data) {
|
|
521
|
+
/**
|
|
522
|
+
* Wins
|
|
523
|
+
* @type {number}
|
|
524
|
+
*/
|
|
525
|
+
this.wins = data.sw_game_wins || 0;
|
|
526
|
+
/**
|
|
527
|
+
* Kills
|
|
528
|
+
* @type {number}
|
|
529
|
+
*/
|
|
530
|
+
this.kills = data.sw_kills || 0;
|
|
531
|
+
/**
|
|
532
|
+
* Deaths
|
|
533
|
+
* @type {number}
|
|
534
|
+
*/
|
|
535
|
+
this.deaths = data.sw_deaths || 0;
|
|
536
|
+
/**
|
|
537
|
+
* Total shots fired
|
|
538
|
+
* @type {number}
|
|
539
|
+
*/
|
|
540
|
+
this.shotsFired = data.sw_shots_fired || 0;
|
|
541
|
+
/**
|
|
542
|
+
* Total weekly kills
|
|
543
|
+
* @type {number}
|
|
544
|
+
*/
|
|
545
|
+
this.weeklyKills = parseInt(data[`weekly_kills_${weekAB()}`] || 0, 10);
|
|
546
|
+
/**
|
|
547
|
+
* Total Monthly kills
|
|
548
|
+
* @type {number}
|
|
549
|
+
*/
|
|
550
|
+
this.monthlyKills = parseInt(data[`monthly_kills_${monthAB()}`] || 0, 10);
|
|
551
|
+
/**
|
|
552
|
+
* Attacker Kills
|
|
553
|
+
* @type {number}
|
|
554
|
+
*/
|
|
555
|
+
this.attackerKills = data.sw_rebel_kills || 0;
|
|
556
|
+
/**
|
|
557
|
+
* Defender Kills
|
|
558
|
+
* @type {number}
|
|
559
|
+
*/
|
|
560
|
+
this.defenderKills = data.sw_empire_kills || 0;
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Party Popper Stats (Sub gamemode of Hide and Seek)
|
|
565
|
+
*/
|
|
566
|
+
class PartyPopper {
|
|
567
|
+
/**
|
|
568
|
+
* @param {Object} data Data from API
|
|
569
|
+
*/
|
|
570
|
+
constructor(data) {
|
|
571
|
+
/**
|
|
572
|
+
* Wins as Seeker
|
|
573
|
+
* @type {number}
|
|
574
|
+
*/
|
|
575
|
+
this.winsAsSeeker = data.party_pooper_seeker_wins_hide_and_seek || 0;
|
|
576
|
+
/**
|
|
577
|
+
* Wins as Hider
|
|
578
|
+
* @type {number}
|
|
579
|
+
*/
|
|
580
|
+
this.winsAsHider = data.party_pooper_hider_wins_hide_and_seek || 0;
|
|
581
|
+
/**
|
|
582
|
+
* Wins
|
|
583
|
+
* @type {number}
|
|
584
|
+
*/
|
|
585
|
+
this.wins = this.winsAsSeeker + this.winsAsHider;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Prop Hunt Stats (Sub gamemode of Hide and Seek)
|
|
590
|
+
*/
|
|
591
|
+
class PropHunt {
|
|
592
|
+
/**
|
|
593
|
+
* @param {Object} data Data from API
|
|
594
|
+
*/
|
|
595
|
+
constructor(data) {
|
|
157
596
|
/**
|
|
158
|
-
*
|
|
159
|
-
* @type {
|
|
597
|
+
* Wins as Seeker
|
|
598
|
+
* @type {number}
|
|
160
599
|
*/
|
|
161
|
-
this.
|
|
162
|
-
'bountyKills',
|
|
163
|
-
data.bounty_kills_oneinthequiver || 0
|
|
164
|
-
);
|
|
600
|
+
this.winsAsSeeker = data.prop_hunt_seeker_wins_hide_and_seek || 0;
|
|
165
601
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @type {
|
|
602
|
+
* Wins as Hider
|
|
603
|
+
* @type {number}
|
|
168
604
|
*/
|
|
169
|
-
this.
|
|
605
|
+
this.winsAsHider = data.prop_hunt_hider_wins_hide_and_seek || 0;
|
|
170
606
|
/**
|
|
171
|
-
*
|
|
172
|
-
* @type {
|
|
607
|
+
* Wins
|
|
608
|
+
* @type {number}
|
|
173
609
|
*/
|
|
174
|
-
this.
|
|
610
|
+
this.wins = this.winsAsSeeker + this.winsAsHider;
|
|
175
611
|
}
|
|
176
612
|
}
|
|
177
613
|
/**
|
|
178
|
-
*
|
|
614
|
+
* Hide And Seek Stats
|
|
179
615
|
*/
|
|
180
|
-
class
|
|
616
|
+
class HideAndSeek {
|
|
181
617
|
/**
|
|
182
|
-
* @param {Object} data
|
|
183
|
-
* @param {string} gameName Game Name ( snake )
|
|
618
|
+
* @param {Object} data Data from API
|
|
184
619
|
*/
|
|
185
|
-
constructor(data
|
|
620
|
+
constructor(data) {
|
|
186
621
|
/**
|
|
187
|
-
*
|
|
188
|
-
* @type {
|
|
622
|
+
* Party Popper Stats
|
|
623
|
+
* @type {PartyPopper}
|
|
189
624
|
*/
|
|
190
|
-
this.
|
|
625
|
+
this.partyPopper = new PartyPopper(data);
|
|
191
626
|
/**
|
|
192
|
-
*
|
|
193
|
-
* @type {
|
|
627
|
+
* Prop Hunt Stats
|
|
628
|
+
* @type {PropHunt}
|
|
194
629
|
*/
|
|
195
|
-
this.
|
|
630
|
+
this.propHunt = new PropHunt(data);
|
|
196
631
|
/**
|
|
197
|
-
*
|
|
198
|
-
* @type {
|
|
632
|
+
* Wins as Seeker
|
|
633
|
+
* @type {number}
|
|
199
634
|
*/
|
|
200
|
-
this.
|
|
635
|
+
this.winsAsSeeker = data.seeker_wins_hide_and_seek || 0;
|
|
201
636
|
/**
|
|
202
|
-
*
|
|
203
|
-
* @type {
|
|
637
|
+
* Wins as Hider
|
|
638
|
+
* @type {number}
|
|
204
639
|
*/
|
|
205
|
-
this.
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Extend BaseGame without creating a new class
|
|
209
|
-
* @param {string} name Property to add
|
|
210
|
-
* @param {*} value Corresponding value
|
|
211
|
-
* @private
|
|
212
|
-
* @returns {BaseGame}
|
|
213
|
-
*/
|
|
214
|
-
extend(name, value) {
|
|
215
|
-
this[name] = value;
|
|
216
|
-
return this;
|
|
640
|
+
this.winsAsHider = data.hider_wins_hide_and_seek || 0;
|
|
217
641
|
}
|
|
218
642
|
}
|
|
219
|
-
|
|
220
643
|
/**
|
|
221
|
-
*
|
|
644
|
+
* Hide And Seek Stats
|
|
222
645
|
*/
|
|
223
|
-
class
|
|
646
|
+
class HoleInTheWall {
|
|
224
647
|
/**
|
|
225
648
|
* @param {Object} data Data from API
|
|
226
649
|
*/
|
|
@@ -229,344 +652,407 @@ class GalaxyWars {
|
|
|
229
652
|
* Wins
|
|
230
653
|
* @type {number}
|
|
231
654
|
*/
|
|
232
|
-
this.wins = data.
|
|
655
|
+
this.wins = data.wins_hole_in_the_wall || 0;
|
|
233
656
|
/**
|
|
234
|
-
*
|
|
657
|
+
* Rounds Played
|
|
235
658
|
* @type {number}
|
|
236
659
|
*/
|
|
237
|
-
this.
|
|
660
|
+
this.rounds = data.rounds_hole_in_the_wall || 0;
|
|
238
661
|
/**
|
|
239
|
-
*
|
|
662
|
+
* Score Record in Finals
|
|
240
663
|
* @type {number}
|
|
241
664
|
*/
|
|
242
|
-
this.
|
|
665
|
+
this.scoreRecordFinals = data.hitw_record_f || 0;
|
|
243
666
|
/**
|
|
244
|
-
*
|
|
667
|
+
* Score Record in Normal
|
|
245
668
|
* @type {number}
|
|
246
669
|
*/
|
|
247
|
-
this.
|
|
670
|
+
this.scoreRecordNormal = data.hitw_record_q || 0;
|
|
248
671
|
/**
|
|
249
|
-
*
|
|
672
|
+
* Score Record Overall
|
|
250
673
|
* @type {number}
|
|
251
674
|
*/
|
|
252
|
-
this.
|
|
675
|
+
this.scoreRecordOverall = this.scoreRecordFinals + this.scoreRecordNormal;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Hypixel Says Stats
|
|
680
|
+
*/
|
|
681
|
+
class HypixelSays {
|
|
682
|
+
constructor(data) {
|
|
253
683
|
/**
|
|
254
|
-
*
|
|
684
|
+
* Wins
|
|
255
685
|
* @type {number}
|
|
256
686
|
*/
|
|
257
|
-
this.
|
|
687
|
+
this.wins = data.wins_simon_says || 0;
|
|
258
688
|
/**
|
|
259
|
-
*
|
|
689
|
+
* Rounds
|
|
260
690
|
* @type {number}
|
|
261
691
|
*/
|
|
262
|
-
this.
|
|
692
|
+
this.rounds = data.rounds_simon_says || 0;
|
|
263
693
|
/**
|
|
264
|
-
*
|
|
694
|
+
* Round Wins
|
|
265
695
|
* @type {number}
|
|
266
696
|
*/
|
|
267
|
-
this.
|
|
697
|
+
this.roundWins = data.round_wins_simon_says || 0;
|
|
698
|
+
/**
|
|
699
|
+
* Top Score
|
|
700
|
+
* @type {number}
|
|
701
|
+
*/
|
|
702
|
+
this.topScore = data.top_score_simon_says || 0;
|
|
268
703
|
}
|
|
269
704
|
}
|
|
270
705
|
/**
|
|
271
|
-
*
|
|
706
|
+
* Mini Walls class
|
|
272
707
|
*/
|
|
273
|
-
class
|
|
708
|
+
class MiniWalls {
|
|
274
709
|
/**
|
|
275
|
-
*
|
|
710
|
+
* Constructor
|
|
711
|
+
* @param {Object} data data from API
|
|
276
712
|
*/
|
|
277
713
|
constructor(data) {
|
|
714
|
+
/**
|
|
715
|
+
* Active Kit
|
|
716
|
+
* @type {string}
|
|
717
|
+
*/
|
|
718
|
+
this.kit = data.miniWalls_activeKit || '';
|
|
278
719
|
/**
|
|
279
720
|
* Wins
|
|
280
721
|
* @type {number}
|
|
281
722
|
*/
|
|
282
|
-
this.wins = data.
|
|
723
|
+
this.wins = data.wins_mini_walls || 0;
|
|
283
724
|
/**
|
|
284
|
-
*
|
|
725
|
+
* Kills
|
|
285
726
|
* @type {number}
|
|
286
727
|
*/
|
|
287
|
-
this.
|
|
728
|
+
this.kills = data.kills_mini_walls || 0;
|
|
288
729
|
/**
|
|
289
|
-
*
|
|
730
|
+
* Deaths
|
|
290
731
|
* @type {number}
|
|
291
732
|
*/
|
|
292
|
-
this.
|
|
733
|
+
this.deaths = data.deaths_mini_walls || 0;
|
|
293
734
|
/**
|
|
294
|
-
*
|
|
735
|
+
* Kill Death Ratio
|
|
295
736
|
* @type {number}
|
|
296
737
|
*/
|
|
297
|
-
this.
|
|
738
|
+
this.KDRatio = divide(this.kills, this.deaths);
|
|
739
|
+
/**
|
|
740
|
+
* Final Kills
|
|
741
|
+
* @type {number}
|
|
742
|
+
*/
|
|
743
|
+
this.finalKills = data.final_kills_mini_walls || 0;
|
|
744
|
+
/**
|
|
745
|
+
* Wither Kills
|
|
746
|
+
* @type {number}
|
|
747
|
+
*/
|
|
748
|
+
this.witherKills = data.wither_kills_mini_walls || 0;
|
|
749
|
+
/**
|
|
750
|
+
* Wither Damage
|
|
751
|
+
* @type {number}
|
|
752
|
+
*/
|
|
753
|
+
this.witherDamage = data.wither_damage_mini_walls || 0;
|
|
754
|
+
/**
|
|
755
|
+
* Arrows Shot
|
|
756
|
+
* @type {number}
|
|
757
|
+
*/
|
|
758
|
+
this.arrowsShot = data.arrows_shot_mini_walls || 0;
|
|
759
|
+
/**
|
|
760
|
+
* Arrows Hit
|
|
761
|
+
* @type {number}
|
|
762
|
+
*/
|
|
763
|
+
this.arrowsHit = data.arrows_hit_mini_walls || 0;
|
|
764
|
+
/**
|
|
765
|
+
* Bow Accuracy
|
|
766
|
+
* @type {number}
|
|
767
|
+
*/
|
|
768
|
+
this.bowAccuracy = divide(this.arrowsHit, this.arrowsShot);
|
|
298
769
|
}
|
|
299
770
|
}
|
|
300
771
|
/**
|
|
301
|
-
*
|
|
772
|
+
* Party Games class
|
|
302
773
|
*/
|
|
303
|
-
class
|
|
774
|
+
class PartyGames {
|
|
304
775
|
/**
|
|
305
|
-
*
|
|
776
|
+
* Constructor
|
|
777
|
+
* @param {Object} data data from API
|
|
306
778
|
*/
|
|
307
779
|
constructor(data) {
|
|
308
|
-
super(data, 'hole_in_the_wall');
|
|
309
780
|
/**
|
|
310
|
-
*
|
|
781
|
+
* Wins
|
|
311
782
|
* @type {number}
|
|
312
783
|
*/
|
|
313
|
-
this.
|
|
784
|
+
this.wins = data.wins_party || 0;
|
|
314
785
|
/**
|
|
315
|
-
*
|
|
786
|
+
* Rounds Won
|
|
316
787
|
* @type {number}
|
|
317
788
|
*/
|
|
318
|
-
this.
|
|
789
|
+
this.roundWins = data.round_wins_party || 0;
|
|
319
790
|
/**
|
|
320
|
-
*
|
|
791
|
+
* Stars Earned
|
|
321
792
|
* @type {number}
|
|
322
793
|
*/
|
|
323
|
-
this.
|
|
794
|
+
this.stars = data.total_stars_party || 0;
|
|
324
795
|
}
|
|
325
796
|
}
|
|
326
797
|
/**
|
|
327
|
-
*
|
|
798
|
+
* Pixel Party Game Mode
|
|
328
799
|
*/
|
|
329
|
-
class
|
|
800
|
+
class PixelPartyGameMode {
|
|
330
801
|
/**
|
|
331
802
|
* Constructor
|
|
332
803
|
* @param {Object} data data from API
|
|
804
|
+
* @param {string} modeName Mode name
|
|
333
805
|
*/
|
|
334
|
-
constructor(data) {
|
|
335
|
-
super(data, 'mini_walls');
|
|
806
|
+
constructor(data, modeName) {
|
|
336
807
|
/**
|
|
337
|
-
*
|
|
808
|
+
* Wins
|
|
338
809
|
* @type {number}
|
|
339
810
|
*/
|
|
340
|
-
this.
|
|
811
|
+
this.wins = data?.[`wins_${modeName}`] || 0;
|
|
341
812
|
/**
|
|
342
|
-
*
|
|
813
|
+
* Games Played
|
|
343
814
|
* @type {number}
|
|
344
815
|
*/
|
|
345
|
-
this.
|
|
816
|
+
this.gamesPlayed = data?.[`games_played_${modeName}`] || 0;
|
|
346
817
|
/**
|
|
347
|
-
*
|
|
818
|
+
* Losses
|
|
348
819
|
* @type {number}
|
|
349
820
|
*/
|
|
350
|
-
this.
|
|
821
|
+
this.losses = this.gamesPlayed - this.wins;
|
|
351
822
|
/**
|
|
352
|
-
*
|
|
823
|
+
* Win Loss Ratio
|
|
353
824
|
* @type {number}
|
|
354
825
|
*/
|
|
355
|
-
this.
|
|
826
|
+
this.WLRatio = divide(this.wins, this.losses);
|
|
356
827
|
/**
|
|
357
|
-
*
|
|
828
|
+
* Rounds Played
|
|
358
829
|
* @type {number}
|
|
359
830
|
*/
|
|
360
|
-
this.
|
|
831
|
+
this.roundsPlayed = data?.[`rounds_completed_${modeName}`] || 0;
|
|
361
832
|
/**
|
|
362
|
-
*
|
|
833
|
+
* Power Ups Collected
|
|
363
834
|
* @type {number}
|
|
364
835
|
*/
|
|
365
|
-
this.
|
|
836
|
+
this.powerUpsCollected = data?.[`power_ups_collected_${modeName}`] || 0;
|
|
366
837
|
}
|
|
367
838
|
}
|
|
368
839
|
/**
|
|
369
|
-
*
|
|
840
|
+
* Party Games class
|
|
370
841
|
*/
|
|
371
|
-
class
|
|
842
|
+
class PixelParty {
|
|
372
843
|
/**
|
|
373
844
|
* Constructor
|
|
374
|
-
* @param {Object} data
|
|
845
|
+
* @param {Object} data data from API
|
|
375
846
|
*/
|
|
376
847
|
constructor(data) {
|
|
377
848
|
/**
|
|
378
|
-
*
|
|
379
|
-
* @type {
|
|
849
|
+
* Wins
|
|
850
|
+
* @type {number}
|
|
380
851
|
*/
|
|
381
|
-
this.
|
|
852
|
+
this.wins = data?.pixel_party?.wins || 0;
|
|
382
853
|
/**
|
|
383
|
-
*
|
|
384
|
-
* @type {
|
|
854
|
+
* Games Played
|
|
855
|
+
* @type {number}
|
|
385
856
|
*/
|
|
386
|
-
this.
|
|
857
|
+
this.gamesPlayed = data?.pixel_party?.games_played || 0;
|
|
387
858
|
/**
|
|
388
|
-
*
|
|
389
|
-
* @type {
|
|
859
|
+
* Losses
|
|
860
|
+
* @type {number}
|
|
390
861
|
*/
|
|
391
|
-
this.
|
|
862
|
+
this.losses = this.gamesPlayed - this.wins;
|
|
392
863
|
/**
|
|
393
|
-
*
|
|
394
|
-
* @type {
|
|
864
|
+
* Win Loss Ratio
|
|
865
|
+
* @type {number}
|
|
395
866
|
*/
|
|
396
|
-
this.
|
|
867
|
+
this.WLRatio = divide(this.wins, this.losses);
|
|
397
868
|
/**
|
|
398
|
-
*
|
|
399
|
-
* @type {
|
|
869
|
+
* Rounds Played
|
|
870
|
+
* @type {number}
|
|
400
871
|
*/
|
|
401
|
-
this.
|
|
872
|
+
this.roundsPlayed = data?.pixel_party?.rounds_completed || 0;
|
|
402
873
|
/**
|
|
403
|
-
*
|
|
874
|
+
* Power Ups Collected
|
|
404
875
|
* @type {number}
|
|
405
876
|
*/
|
|
406
|
-
this.
|
|
877
|
+
this.powerUpsCollected = data?.pixel_party?.power_ups_collected || 0;
|
|
407
878
|
/**
|
|
408
|
-
*
|
|
409
|
-
* @type {
|
|
879
|
+
* Normal Game Mode
|
|
880
|
+
* @type {PixelPartyGameMode}
|
|
410
881
|
*/
|
|
411
|
-
this.
|
|
882
|
+
this.normal = new PixelPartyGameMode(data.pixel_party, 'normal');
|
|
412
883
|
/**
|
|
413
|
-
*
|
|
414
|
-
* @type {
|
|
884
|
+
* Hyper Game Mode
|
|
885
|
+
* @type {PixelPartyGameMode}
|
|
415
886
|
*/
|
|
416
|
-
this.
|
|
887
|
+
this.hyper = new PixelPartyGameMode(data.pixel_party, 'hyper');
|
|
417
888
|
/**
|
|
418
|
-
*
|
|
889
|
+
* Highest Round
|
|
419
890
|
* @type {number}
|
|
420
891
|
*/
|
|
421
|
-
this.
|
|
892
|
+
this.highestRound = data?.pixel_party?.highest_round || 0;
|
|
422
893
|
/**
|
|
423
|
-
*
|
|
894
|
+
* Music Volume
|
|
424
895
|
* @type {number}
|
|
425
896
|
*/
|
|
426
|
-
this.
|
|
897
|
+
this.musicVolume = data.pixel_party_music_volume || 0;
|
|
898
|
+
/**
|
|
899
|
+
* Color Blind Settings
|
|
900
|
+
* @type {object}
|
|
901
|
+
*/
|
|
902
|
+
this.colorBlind = data.pixelparty || {};
|
|
427
903
|
}
|
|
428
904
|
}
|
|
429
905
|
/**
|
|
430
|
-
*
|
|
906
|
+
* Throw Out class
|
|
431
907
|
*/
|
|
432
|
-
class
|
|
908
|
+
class ThrowOut {
|
|
433
909
|
/**
|
|
434
910
|
* Constructor
|
|
435
|
-
* @param {Object} data
|
|
436
|
-
* @param {string} mapName String map name
|
|
911
|
+
* @param {Object} data data from API
|
|
437
912
|
*/
|
|
438
|
-
constructor(data
|
|
913
|
+
constructor(data) {
|
|
439
914
|
/**
|
|
440
|
-
*
|
|
441
|
-
* @type {
|
|
915
|
+
* Wins
|
|
916
|
+
* @type {number}
|
|
442
917
|
*/
|
|
443
|
-
this.
|
|
918
|
+
this.wins = data.wins_throw_out || 0;
|
|
444
919
|
/**
|
|
445
|
-
*
|
|
446
|
-
* @type {
|
|
920
|
+
* Kills
|
|
921
|
+
* @type {number}
|
|
447
922
|
*/
|
|
448
|
-
this.
|
|
923
|
+
this.kills = data.kills_throw_out || 0;
|
|
449
924
|
/**
|
|
450
|
-
*
|
|
451
|
-
* @type {
|
|
925
|
+
* Deaths
|
|
926
|
+
* @type {number}
|
|
452
927
|
*/
|
|
453
|
-
this.
|
|
928
|
+
this.deaths = data.deaths_throw_out || 0;
|
|
454
929
|
/**
|
|
455
|
-
*
|
|
456
|
-
* @type {
|
|
930
|
+
* KDRatio
|
|
931
|
+
* @type {number}
|
|
457
932
|
*/
|
|
458
|
-
this.
|
|
933
|
+
this.KDRatio = divide(this.kills, this.deaths);
|
|
459
934
|
}
|
|
460
935
|
}
|
|
461
936
|
/**
|
|
462
|
-
*
|
|
937
|
+
* Arcade class
|
|
463
938
|
*/
|
|
464
|
-
class
|
|
939
|
+
class Arcade {
|
|
465
940
|
/**
|
|
466
941
|
* Constructor
|
|
467
|
-
* @param {Object} data Data from API
|
|
468
|
-
* @param {string} type Map name + difficulty ( default overall )
|
|
942
|
+
* @param {Object} data Data from the API
|
|
469
943
|
*/
|
|
470
|
-
constructor(data
|
|
471
|
-
if (type) type = `_${type}`;
|
|
944
|
+
constructor(data = {}) {
|
|
472
945
|
/**
|
|
473
|
-
*
|
|
946
|
+
* Amount of coins
|
|
474
947
|
* @type {number}
|
|
475
948
|
*/
|
|
476
|
-
this.
|
|
949
|
+
this.coins = data.coins || 0;
|
|
477
950
|
/**
|
|
478
|
-
*
|
|
951
|
+
* Weekly coins
|
|
479
952
|
* @type {number}
|
|
480
953
|
*/
|
|
481
|
-
this.
|
|
954
|
+
this.weeklyCoins = parseInt(data[`weekly_coins_${weekAB()}`] || 0, 10);
|
|
482
955
|
/**
|
|
483
|
-
*
|
|
956
|
+
* Monthly coins
|
|
484
957
|
* @type {number}
|
|
485
958
|
*/
|
|
486
|
-
this.
|
|
959
|
+
this.monthlyCoins = parseInt(data[`monthly_coins_${monthAB()}`] || 0, 10);
|
|
487
960
|
/**
|
|
488
|
-
*
|
|
489
|
-
* @type {
|
|
961
|
+
* Hints Disabled
|
|
962
|
+
* @type {boolean}
|
|
490
963
|
*/
|
|
491
|
-
this.
|
|
964
|
+
this.hintsDisabled = !data.hints;
|
|
492
965
|
/**
|
|
493
|
-
*
|
|
494
|
-
* @type {
|
|
966
|
+
* Flash Disabled
|
|
967
|
+
* @type {boolean}
|
|
495
968
|
*/
|
|
496
|
-
this.
|
|
969
|
+
this.flashDisabled = !data.flash;
|
|
497
970
|
/**
|
|
498
|
-
*
|
|
499
|
-
* @type {
|
|
971
|
+
* Blocking dead ( previously known as DayOne ) stats
|
|
972
|
+
* @type {BlockingDead}
|
|
500
973
|
*/
|
|
501
|
-
this.
|
|
974
|
+
this.blockingDead = new BlockingDead(data);
|
|
502
975
|
/**
|
|
503
|
-
*
|
|
504
|
-
* @type {
|
|
976
|
+
* Bounty Hunters (previously known as One In The Quiver) stats
|
|
977
|
+
* @type {BountyHunters}
|
|
505
978
|
*/
|
|
506
|
-
this.
|
|
979
|
+
this.bountyHunters = new BountyHunters(data);
|
|
507
980
|
/**
|
|
508
|
-
*
|
|
509
|
-
* @type {
|
|
981
|
+
* Capture The Wool
|
|
982
|
+
* @type {CaptureTheWool}
|
|
510
983
|
*/
|
|
511
|
-
this.
|
|
984
|
+
this.captureTheWool = new CaptureTheWool(data);
|
|
512
985
|
/**
|
|
513
|
-
*
|
|
514
|
-
* @type {
|
|
986
|
+
* Dragon wars stats
|
|
987
|
+
* @type {DragonWars}
|
|
515
988
|
*/
|
|
516
|
-
this.
|
|
989
|
+
this.dragonWars = new DragonWars(data);
|
|
517
990
|
/**
|
|
518
|
-
*
|
|
519
|
-
* @type {
|
|
991
|
+
* Dropper
|
|
992
|
+
* @type {Dropper}
|
|
520
993
|
*/
|
|
521
|
-
this.
|
|
994
|
+
this.dropper = new Dropper(data.dropper);
|
|
522
995
|
/**
|
|
523
|
-
*
|
|
524
|
-
* @type {
|
|
996
|
+
* Ender Spleef stats
|
|
997
|
+
* @type {EnderSpleef}
|
|
525
998
|
*/
|
|
526
|
-
this.
|
|
999
|
+
this.enderSpleef = new EnderSpleef(data);
|
|
527
1000
|
/**
|
|
528
|
-
*
|
|
529
|
-
* @type {
|
|
1001
|
+
* Farm Hunt stats
|
|
1002
|
+
* @type {FarmHunt}
|
|
530
1003
|
*/
|
|
531
|
-
this.
|
|
1004
|
+
this.farmHunt = new FarmHunt(data);
|
|
1005
|
+
/**
|
|
1006
|
+
* Football stats
|
|
1007
|
+
* @type {Football}
|
|
1008
|
+
*/
|
|
1009
|
+
this.football = new Football(data);
|
|
1010
|
+
/**
|
|
1011
|
+
* Galaxy Wars stats
|
|
1012
|
+
* @type {GalaxyWars}
|
|
1013
|
+
*/
|
|
1014
|
+
this.galaxyWars = new GalaxyWars(data);
|
|
1015
|
+
/**
|
|
1016
|
+
* Hide and Seek stats
|
|
1017
|
+
* @type {HideAndSeek}
|
|
1018
|
+
*/
|
|
1019
|
+
this.hideAndSeek = new HideAndSeek(data);
|
|
1020
|
+
/**
|
|
1021
|
+
* Hole in the Wall stats
|
|
1022
|
+
* @type {HoleInTheWall}
|
|
1023
|
+
*/
|
|
1024
|
+
this.holeInTheWall = new HoleInTheWall(data);
|
|
1025
|
+
/**
|
|
1026
|
+
* Hypixel Says stats
|
|
1027
|
+
* @type {HypixelSays}
|
|
1028
|
+
*/
|
|
1029
|
+
this.hypixelSays = new HypixelSays(data);
|
|
1030
|
+
/**
|
|
1031
|
+
* Mini Walls stats
|
|
1032
|
+
* @type {MiniWalls}
|
|
1033
|
+
*/
|
|
1034
|
+
this.miniWalls = new MiniWalls(data);
|
|
1035
|
+
/**
|
|
1036
|
+
* Party games stats
|
|
1037
|
+
* @type {PartyGames}
|
|
1038
|
+
*/
|
|
1039
|
+
this.partyGames = new PartyGames(data);
|
|
1040
|
+
/**
|
|
1041
|
+
* Pixel Party stats
|
|
1042
|
+
* @type {PixelParty}
|
|
1043
|
+
*/
|
|
1044
|
+
this.pixelParty = new PixelParty(data);
|
|
1045
|
+
/**
|
|
1046
|
+
* Throw out stats
|
|
1047
|
+
* @type {ThrowOut}
|
|
1048
|
+
*/
|
|
1049
|
+
this.throwOut = new ThrowOut(data);
|
|
1050
|
+
/**
|
|
1051
|
+
* Zombies
|
|
1052
|
+
* @type {Zombies}
|
|
1053
|
+
*/
|
|
1054
|
+
this.zombies = new Zombies(data);
|
|
532
1055
|
}
|
|
533
1056
|
}
|
|
534
|
-
|
|
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
|
-
/**
|
|
543
|
-
* @typedef {Object} EasterSimulator
|
|
544
|
-
* @extends BaseGame
|
|
545
|
-
* @property {number} eggsFound Total eggs found
|
|
546
|
-
*/
|
|
547
|
-
/**
|
|
548
|
-
* @typedef {Object} GrinchSimulator
|
|
549
|
-
* @extends BaseGame
|
|
550
|
-
* @property {number} giftsFound Total gifts found and stolen
|
|
551
|
-
*/
|
|
552
|
-
/**
|
|
553
|
-
* @typedef {Object} ScubaSimulator
|
|
554
|
-
* @extends BaseGame
|
|
555
|
-
* @property {number} itemsFound Total items found
|
|
556
|
-
*/
|
|
557
|
-
/**
|
|
558
|
-
* @typedef {Object} SantaSimulator
|
|
559
|
-
* @extends BaseGame
|
|
560
|
-
* @property {number} giftsDelivered Total gifts delivered
|
|
561
|
-
*/
|
|
562
|
-
/**
|
|
563
|
-
* @typedef {Object} OITQ
|
|
564
|
-
* @extends BaseGame
|
|
565
|
-
* @property {number} bountyKills Bounty Kills
|
|
566
|
-
*/
|
|
567
|
-
/**
|
|
568
|
-
* @typedef {JSON} BlockingDead
|
|
569
|
-
* @extends BaseGame
|
|
570
|
-
* @property {number} headshots Headshots
|
|
571
|
-
*/
|
|
1057
|
+
|
|
572
1058
|
module.exports = Arcade;
|