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.
Files changed (101) hide show
  1. package/README.md +1 -1
  2. package/eslint.config.mjs +71 -0
  3. package/package.json +14 -20
  4. package/src/API/getAchievements.js +1 -0
  5. package/src/API/getBoosters.js +1 -0
  6. package/src/API/getChallenges.js +1 -0
  7. package/src/API/getGameCounts.js +1 -0
  8. package/src/API/getGuild.js +4 -3
  9. package/src/API/getGuildAchievements.js +1 -0
  10. package/src/API/getLeaderboards.js +1 -1
  11. package/src/API/getPlayer.js +1 -0
  12. package/src/API/getQuests.js +1 -0
  13. package/src/API/getRecentGames.js +5 -9
  14. package/src/API/getServerInfo.js +40 -37
  15. package/src/API/getStatus.js +1 -0
  16. package/src/API/getWatchdogStats.js +1 -0
  17. package/src/API/housing/getActiveHouses.js +7 -0
  18. package/src/API/housing/getHouse.js +9 -0
  19. package/src/API/housing/getPlayerHouses.js +11 -0
  20. package/src/API/index.js +6 -1
  21. package/src/API/skyblock/getAuction.js +8 -6
  22. package/src/API/skyblock/getAuctions.js +15 -12
  23. package/src/API/skyblock/getAuctionsByPlayer.js +1 -1
  24. package/src/API/skyblock/getBazaar.js +1 -3
  25. package/src/API/skyblock/getBingo.js +1 -2
  26. package/src/API/skyblock/getBingoByPlayer.js +3 -3
  27. package/src/API/skyblock/getEndedAuctions.js +1 -0
  28. package/src/API/skyblock/getFireSales.js +1 -1
  29. package/src/API/skyblock/getGarden.js +7 -0
  30. package/src/API/skyblock/getGovernment.js +1 -2
  31. package/src/API/skyblock/getMember.js +5 -2
  32. package/src/API/skyblock/getMuseum.js +1 -0
  33. package/src/API/skyblock/getNews.js +1 -0
  34. package/src/API/skyblock/getProfiles.js +5 -2
  35. package/src/Client.js +88 -16
  36. package/src/Private/rateLimit.js +7 -11
  37. package/src/Private/requests.js +12 -13
  38. package/src/Private/updater.js +2 -3
  39. package/src/Private/uuidCache.js +1 -2
  40. package/src/Private/validate.js +19 -19
  41. package/src/index.js +5 -0
  42. package/src/structures/APIIncident.js +1 -2
  43. package/src/structures/APIStatus.js +0 -1
  44. package/src/structures/Boosters/Booster.js +9 -8
  45. package/src/structures/Game.js +1 -1
  46. package/src/structures/Guild/Guild.js +19 -36
  47. package/src/structures/Guild/GuildMember.js +2 -2
  48. package/src/structures/House.js +54 -0
  49. package/src/structures/MiniGames/Arcade.js +798 -312
  50. package/src/structures/MiniGames/ArenaBrawl.js +98 -32
  51. package/src/structures/MiniGames/BedWars.js +197 -194
  52. package/src/structures/MiniGames/BlitzSurvivalGames.js +381 -129
  53. package/src/structures/MiniGames/BuildBattle.js +19 -8
  54. package/src/structures/MiniGames/CopsAndCrims.js +253 -25
  55. package/src/structures/MiniGames/Duels.js +905 -664
  56. package/src/structures/MiniGames/MegaWalls.js +390 -51
  57. package/src/structures/MiniGames/MurderMystery.js +151 -30
  58. package/src/structures/MiniGames/Paintball.js +31 -11
  59. package/src/structures/MiniGames/Pit.js +4 -5
  60. package/src/structures/MiniGames/Quakecraft.js +113 -50
  61. package/src/structures/MiniGames/SkyWars.js +528 -372
  62. package/src/structures/MiniGames/SmashHeroes.js +201 -73
  63. package/src/structures/MiniGames/SpeedUHC.js +77 -24
  64. package/src/structures/MiniGames/TNTGames.js +242 -73
  65. package/src/structures/MiniGames/TurboKartRacers.js +55 -115
  66. package/src/structures/MiniGames/UHC.js +144 -132
  67. package/src/structures/MiniGames/VampireZ.js +70 -37
  68. package/src/structures/MiniGames/Warlords.js +126 -1
  69. package/src/structures/MiniGames/WoolWars.js +60 -9
  70. package/src/structures/Pet.js +1 -1
  71. package/src/structures/Player.js +43 -128
  72. package/src/structures/PlayerCosmetics.js +5 -4
  73. package/src/structures/SkyBlock/Auctions/AuctionInfo.js +2 -1
  74. package/src/structures/SkyBlock/Auctions/BaseAuction.js +1 -1
  75. package/src/structures/SkyBlock/News/SkyblockNews.js +15 -15
  76. package/src/structures/SkyBlock/PlayerBingo.js +7 -14
  77. package/src/structures/SkyBlock/SkyblockGarden.js +146 -0
  78. package/src/structures/SkyBlock/SkyblockInventoryItem.js +4 -28
  79. package/src/structures/SkyBlock/SkyblockMember.js +90 -228
  80. package/src/structures/SkyBlock/SkyblockPet.js +3 -4
  81. package/src/structures/SkyBlock/Static/Bingo.js +10 -11
  82. package/src/structures/SkyBlock/Static/BingoData.js +1 -1
  83. package/src/structures/Static/Achievement.js +16 -15
  84. package/src/structures/Static/AchievementTier.js +2 -2
  85. package/src/structures/Static/Quest.js +2 -2
  86. package/src/utils/Constants.js +522 -520
  87. package/src/utils/{guildExp.js → Guild.js} +42 -12
  88. package/src/utils/Player.js +112 -0
  89. package/src/utils/SkyblockUtils.js +482 -192
  90. package/src/utils/arrayTools.js +1 -1
  91. package/src/utils/divide.js +1 -1
  92. package/src/utils/index.js +2 -1
  93. package/src/utils/isGuildID.js +1 -1
  94. package/src/utils/oscillation.js +4 -2
  95. package/src/utils/removeSnakeCase.js +11 -7
  96. package/src/utils/rgbToHexColor.js +1 -1
  97. package/src/utils/romanize.js +3 -3
  98. package/src/utils/toUuid.js +4 -4
  99. package/src/utils/varInt.js +2 -2
  100. package/typings/index.d.ts +1186 -967
  101. package/src/utils/toIGN.js +0 -24
@@ -1,47 +1,109 @@
1
1
  const divide = require('../../utils/divide');
2
- const kits = [
3
- 'arachnologist',
4
- 'archer',
5
- 'armorer',
6
- 'astronaut',
7
- 'baker',
8
- 'blaze',
9
- 'creepertamer',
10
- 'fisherman',
11
- 'horsetamer',
12
- 'hunter',
13
- 'knight',
14
- 'meatmaster',
15
- 'necromancer',
16
- 'pigman',
17
- 'reddragon',
18
- 'rogue',
19
- 'scout',
20
- 'slimeyslime',
21
- 'speleologist',
22
- 'tim',
23
- 'toxicologist',
24
- 'troll',
25
- 'wolftamer',
26
- 'paladin',
27
- 'shadow knight',
28
- 'hype train',
29
- 'jockey',
30
- 'reaper',
31
- 'golem',
32
- 'farmer',
33
- 'florist',
34
- 'snowman',
35
- 'guardian',
36
- 'warlock',
37
- 'viking',
38
- 'diver',
39
- 'ranger',
40
- 'donkeytamer',
41
- 'phoenix',
42
- 'warrior',
43
- 'rambo'
44
- ];
2
+
3
+ class BlitzSGKit {
4
+ /**
5
+ * @param {object} data Blitz SG data
6
+ * @param {string} kitName Kit name
7
+ */
8
+ constructor(data, kitName) {
9
+ /**
10
+ * Kit Level
11
+ * @type {number}
12
+ */
13
+ this.level = data[kitName] || 0;
14
+ /**
15
+ * Kit Level
16
+ * @type {number}
17
+ */
18
+ this.exp = data[`exp_${kitName}`] || 0;
19
+ /**
20
+ * Kills
21
+ * @type {number}
22
+ */
23
+ this.kills = data[`kills_${kitName}`] || 0;
24
+ /**
25
+ * Deaths
26
+ * @type {number}
27
+ */
28
+ this.deaths = data[`deaths_${kitName}`] || 0;
29
+ /**
30
+ * Kill Death ratio
31
+ * @type {number}
32
+ */
33
+ this.KDRatio = divide(this.kills, this.deaths);
34
+ /**
35
+ * Wins
36
+ * @type {number}
37
+ */
38
+ this.wins = data[`wins_${kitName}`] || 0;
39
+ /**
40
+ * Games Played
41
+ * @type {number}
42
+ */
43
+ this.gamesPlayed = data[`games_played_${kitName}`] || 0;
44
+ /**
45
+ * Losses
46
+ * @type {number}
47
+ */
48
+ this.losses = this.gamesPlayed - this.wins;
49
+ /**
50
+ * Win Loss ratio
51
+ * @type {number}
52
+ */
53
+ this.WLRatio = divide(this.wins, this.losses);
54
+ /**
55
+ * Arrows Shot
56
+ * @type {number}
57
+ */
58
+ this.arrowsShot = data[`arrows_fired_${kitName}`] || 0;
59
+ /**
60
+ * Arrows Hit
61
+ * @type {number}
62
+ */
63
+ this.arrowsHit = data[`arrows_hit_${kitName}`] || 0;
64
+ /**
65
+ * Bow Accuracy
66
+ * @type {number}
67
+ */
68
+ this.bowAccuracy = divide(this.arrowsHit, this.arrowsShot);
69
+ /**
70
+ * Damage Delt
71
+ * @type {number}
72
+ */
73
+ this.damage = data[`damage_${kitName}`] || 0;
74
+ /**
75
+ * Damage Taken
76
+ * @type {number}
77
+ */
78
+ this.damageTaken = data[`damage_taken_${kitName}`] || 0;
79
+ /**
80
+ * Potions Drunk
81
+ * @type {number}
82
+ */
83
+ this.potionsDrunk = data[`potions_drunk_${kitName}`] || 0;
84
+ /**
85
+ * Potions Thrown
86
+ * @type {number}
87
+ */
88
+ this.potionsThrown = data[`potions_thrown_${kitName}`] || 0;
89
+ /**
90
+ * Time Played (In seconds)
91
+ * @type {number}
92
+ */
93
+ this.playTime = data[`time_played_${kitName}`] || 0;
94
+ /**
95
+ * Mobs Spawned
96
+ * @type {number}
97
+ */
98
+ this.mobsSpawned = data[`mobs_spawned_${kitName}`] || 0;
99
+ /**
100
+ * Chests Opened
101
+ * @type {number}
102
+ */
103
+ this.chestsOpened = data[`chests_opened_${kitName}`] || 0;
104
+ }
105
+ }
106
+
45
107
  /**
46
108
  * Blitz SG class
47
109
  */
@@ -60,6 +122,21 @@ class BlitzSurvivalGames {
60
122
  * @type {number}
61
123
  */
62
124
  this.kills = data.kills || 0;
125
+ /**
126
+ * Kit
127
+ * @type {string}
128
+ */
129
+ this.kit = data.defaultkit || '';
130
+ /**
131
+ * Solo Kills
132
+ * @type {number}
133
+ */
134
+ this.killsSolo = data.kills_solo_normal || 0;
135
+ /**
136
+ * Teams Kills
137
+ * @type {number}
138
+ */
139
+ this.killsTeams = data.kills_teams_normal || 0;
63
140
  /**
64
141
  * Deaths
65
142
  * @type {number}
@@ -70,103 +147,278 @@ class BlitzSurvivalGames {
70
147
  * @type {number}
71
148
  */
72
149
  this.KDRatio = divide(this.kills, this.deaths);
150
+ /**
151
+ * Wins
152
+ * @type {number}
153
+ */
154
+ this.wins = data.wins || 0;
73
155
  /**
74
156
  * Solo wins
75
157
  * @type {number}
76
158
  */
77
- this.winsSolo = data.wins || 0;
159
+ this.winsSolo = data.wins_solo_normal || 0;
78
160
  /**
79
161
  * Team wins
80
162
  * @type {number}
81
163
  */
82
164
  this.winsTeam = data.wins_teams || 0;
83
165
  /**
84
- * Stats for each kit
85
- * @type {BlitzSGKitStats[]}
166
+ * Games Played
167
+ * @type {number}
86
168
  */
87
- this.kitStats = generateKitStats(data);
88
- }
89
- }
90
- // eslint-disable-next-line require-jsdoc
91
- function generateKitStats(data) {
92
- const stats = [];
93
- for (let i = 0; i < kits.length; i++) {
94
- if (data[kits[i]]) {
95
- stats.push({
96
- name: kits[i],
97
- games: data[`games_played_${kits[i]}`] || 0,
98
- level: data[kits[i]] + 1 || 1,
99
- experience: data[`exp_${kits[i]}`] || 0,
100
- prestige: data[`p${kits[i]}`] || 0,
101
- kills: data[`kills_${kits[i]}`] || 0,
102
- deaths: data[`deaths_${kits[i]}`] || 0,
103
- KDRatio: divide(data[`kills_${kits[i]}`], data[`deaths_${kits[i]}`]),
104
- wins: data[`wins_${kits[i]}`] || 0,
105
- losses: data[`losses_${kits[i]}`] || 0,
106
- WLRatio: divide(data[`wins_${kits[i]}`], data[`losses_${kits[i]}`]),
107
- timePlayed: data[`time_played_${kits[i]}`] || null
108
- });
109
- }
169
+ this.gamesPlayed = data.games_played || 0;
170
+ /**
171
+ * Losses
172
+ * @type {number}
173
+ */
174
+ this.losses = this.gamesPlayed - this.wins;
175
+ /**
176
+ * Win Loss ratio
177
+ * @type {number}
178
+ */
179
+ this.WLRatio = divide(this.wins, this.losses);
180
+ /**
181
+ * Arrows Shot
182
+ * @type {number}
183
+ */
184
+ this.arrowsShot = data.arrows_fired || 0;
185
+ /**
186
+ * Arrows Hit
187
+ * @type {number}
188
+ */
189
+ this.arrowsHit = data.arrows_hit || 0;
190
+ /**
191
+ * Bow Accuracy
192
+ * @type {number}
193
+ */
194
+ this.bowAccuracy = divide(this.arrowsHit, this.arrowsShot);
195
+ /**
196
+ * Damage Delt
197
+ * @type {number}
198
+ */
199
+ this.damage = data.damage || 0;
200
+ /**
201
+ * Damage Taken
202
+ * @type {number}
203
+ */
204
+ this.damageTaken = data.damage_taken || 0;
205
+ /**
206
+ * Potions Drunk
207
+ * @type {number}
208
+ */
209
+ this.potionsDrunk = data.potions_drunk || 0;
210
+ /**
211
+ * Potions Thrown
212
+ * @type {number}
213
+ */
214
+ this.potionsThrown = data.potions_thrown || 0;
215
+ /**
216
+ * Mobs Spawned
217
+ * @type {number}
218
+ */
219
+ this.mobsSpawned = data.mobs_spawned || 0;
220
+ /**
221
+ * Time Played (In seconds)
222
+ * @type {number}
223
+ */
224
+ this.playTime = data.time_played || 0;
225
+ /**
226
+ * Blitz Uses
227
+ * @type {number}
228
+ */
229
+ this.blitzUses = data.blitz_uses || 0;
230
+ /**
231
+ * Chests Opened
232
+ * @type {number}
233
+ */
234
+ this.chestsOpened = data.chests_opened || 0;
235
+
236
+ /**
237
+ * Archer Kit Stats
238
+ * @type {BlitzSGKit}
239
+ */
240
+ this.archer = new BlitzSGKit(data, 'archer');
241
+ /**
242
+ * Meatmaster Kit Stats
243
+ * @type {BlitzSGKit}
244
+ */
245
+ this.meatmaster = new BlitzSGKit(data, 'meatmaster');
246
+ /**
247
+ * Speleologist Kit Stats
248
+ * @type {BlitzSGKit}
249
+ */
250
+ this.speleologist = new BlitzSGKit(data, 'speleologist');
251
+ /**
252
+ * Baker Kit Stats
253
+ * @type {BlitzSGKit}
254
+ */
255
+ this.baker = new BlitzSGKit(data, 'baker');
256
+ /**
257
+ * Knight Kit Stats
258
+ * @type {BlitzSGKit}
259
+ */
260
+ this.knight = new BlitzSGKit(data, 'knight');
261
+ /**
262
+ * Guardian Kit Stats
263
+ * @type {BlitzSGKit}
264
+ */
265
+ this.guardian = new BlitzSGKit(data, 'guardian');
266
+ /**
267
+ * Scout Kit Stats
268
+ * @type {BlitzSGKit}
269
+ */
270
+ this.scout = new BlitzSGKit(data, 'scout');
271
+ /**
272
+ * Hunter Kit Stats
273
+ * @type {BlitzSGKit}
274
+ */
275
+ this.hunter = new BlitzSGKit(data, 'hunter');
276
+ /**
277
+ * Hype Train Kit Stats
278
+ * @type {BlitzSGKit}
279
+ */
280
+ this.hypeTrain = new BlitzSGKit(data, 'hype train');
281
+ /**
282
+ * Fisherman Kit Stats
283
+ * @type {BlitzSGKit}
284
+ */
285
+ this.fisherman = new BlitzSGKit(data, 'fisherman');
286
+ /**
287
+ * Armorer Kit Stats
288
+ * @type {BlitzSGKit}
289
+ */
290
+ this.armorer = new BlitzSGKit(data, 'armorer');
291
+ /**
292
+ * Horsetamer Kit Stats
293
+ * @type {BlitzSGKit}
294
+ */
295
+ this.horsetamer = new BlitzSGKit(data, 'horsetamer');
296
+ /**
297
+ * Astronaut Kit Stats
298
+ * @type {BlitzSGKit}
299
+ */
300
+ this.astronaut = new BlitzSGKit(data, 'astronaut');
301
+ /**
302
+ * Troll Kit Stats
303
+ * @type {BlitzSGKit}
304
+ */
305
+ this.troll = new BlitzSGKit(data, 'troll');
306
+ /**
307
+ * Reaper Kit Stats
308
+ * @type {BlitzSGKit}
309
+ */
310
+ this.reaper = new BlitzSGKit(data, 'reaper');
311
+ /**
312
+ * Shark Kit Stats
313
+ * @type {BlitzSGKit}
314
+ */
315
+ this.shark = new BlitzSGKit(data, 'shark');
316
+ /**
317
+ * Reddragon Kit Stats
318
+ * @type {BlitzSGKit}
319
+ */
320
+ this.reddragon = new BlitzSGKit(data, 'reddragon');
321
+ /**
322
+ * Toxicologist Kit Stats
323
+ * @type {BlitzSGKit}
324
+ */
325
+ this.toxicologist = new BlitzSGKit(data, 'toxicologist');
326
+ /**
327
+ * Rogue Kit Stats
328
+ * @type {BlitzSGKit}
329
+ */
330
+ this.rogue = new BlitzSGKit(data, 'rogue');
331
+ /**
332
+ * Warlock Kit Stats
333
+ * @type {BlitzSGKit}
334
+ */
335
+ this.warlock = new BlitzSGKit(data, 'warlock');
336
+ /**
337
+ * Slimeyslime Kit Stats
338
+ * @type {BlitzSGKit}
339
+ */
340
+ this.slimeyslime = new BlitzSGKit(data, 'slimeyslime');
341
+ /**
342
+ * Jockey Kit Stats
343
+ * @type {BlitzSGKit}
344
+ */
345
+ this.jockey = new BlitzSGKit(data, 'jockey');
346
+ /**
347
+ * Golem Kit Stats
348
+ * @type {BlitzSGKit}
349
+ */
350
+ this.golem = new BlitzSGKit(data, 'golem');
351
+ /**
352
+ * Viking Kit Stats
353
+ * @type {BlitzSGKit}
354
+ */
355
+ this.viking = new BlitzSGKit(data, 'viking');
356
+ /**
357
+ * Shadow Knight Kit Stats
358
+ * @type {BlitzSGKit}
359
+ */
360
+ this.shadowKnight = new BlitzSGKit(data, 'shadow knight');
361
+ /**
362
+ * Pigman Kit Stats
363
+ * @type {BlitzSGKit}
364
+ */
365
+ this.pigman = new BlitzSGKit(data, 'pigman');
366
+ /**
367
+ * Paladin Kit Stats
368
+ * @type {BlitzSGKit}
369
+ */
370
+ this.paladin = new BlitzSGKit(data, 'paladin');
371
+ /**
372
+ * Necromancer Kit Stats
373
+ * @type {BlitzSGKit}
374
+ */
375
+ this.necromancer = new BlitzSGKit(data, 'necromancer');
376
+ /**
377
+ * Florist Kit Stats
378
+ * @type {BlitzSGKit}
379
+ */
380
+ this.florist = new BlitzSGKit(data, 'florist');
381
+ /**
382
+ * Diver Kit Stats
383
+ * @type {BlitzSGKit}
384
+ */
385
+ this.diver = new BlitzSGKit(data, 'diver');
386
+ /**
387
+ * Arachnologist Kit Stats
388
+ * @type {BlitzSGKit}
389
+ */
390
+ this.arachnologist = new BlitzSGKit(data, 'arachnologist');
391
+ /**
392
+ * Blaze Kit Stats
393
+ * @type {BlitzSGKit}
394
+ */
395
+ this.blaze = new BlitzSGKit(data, 'blaze');
396
+ /**
397
+ * Wolftamer Kit Stats
398
+ * @type {BlitzSGKit}
399
+ */
400
+ this.wolftamer = new BlitzSGKit(data, 'wolftamer');
401
+ /**
402
+ * Tim Kit Stats
403
+ * @type {BlitzSGKit}
404
+ */
405
+ this.tim = new BlitzSGKit(data, 'tim');
406
+ /**
407
+ * Farmer Kit Stats
408
+ * @type {BlitzSGKit}
409
+ */
410
+ this.farmer = new BlitzSGKit(data, 'farmer');
411
+ /**
412
+ * Creepertamer Kit Stats
413
+ * @type {BlitzSGKit}
414
+ */
415
+ this.creepertamer = new BlitzSGKit(data, 'creepertamer');
416
+ /**
417
+ * Snowman Kit Stats
418
+ * @type {BlitzSGKit}
419
+ */
420
+ this.snowman = new BlitzSGKit(data, 'snowman');
110
421
  }
111
- return stats;
112
422
  }
113
- /**
114
- * @typedef {string} BlitzSGKit
115
- * * `arachnologist`
116
- * * `archer`
117
- * * `armorer`
118
- * * `astronaut`
119
- * * `baker`
120
- * * `blaze`
121
- * * `creepertamer`
122
- * * `fisherman`
123
- * * `horsetamer`
124
- * * `hunter`
125
- * * `knight`
126
- * * `meatmaster`
127
- * * `necromancer`
128
- * * `pigman`
129
- * * `reddragon`
130
- * * `rogue`
131
- * * `scout`
132
- * * `slimeyslime`
133
- * * `speleologist`
134
- * * `tim`
135
- * * `toxicologist`
136
- * * `troll`
137
- * * `wolftamer`
138
- * * `paladin`
139
- * * `shadow knight`
140
- * * `hype train`
141
- * * `jockey`
142
- * * `reaper`
143
- * * `golem`
144
- * * `farmer`
145
- * * `florist`
146
- * * `snowman`
147
- * * `guardian`
148
- * * `warlock`
149
- * * `viking`
150
- * * `diver`
151
- * * `ranger`
152
- * * `donkeytamer`
153
- * * `phoenix`
154
- * * `warrior`
155
- * * `rambo`
156
- */
157
- /**
158
- * @typedef {object} BlitzSGKitStats
159
- * @property {BlitzSGKit} name Kit name
160
- * @property {number} games Played games
161
- * @property {number} level level
162
- * @property {number} experience Total experience
163
- * @property {number} prestige Prestige
164
- * @property {number} kills Kills
165
- * @property {number} deaths Deaths
166
- * @property {number} KDRatio Kill Death ratio
167
- * @property {number} wins Wins
168
- * @property {number} losses Losses
169
- * @property {number} WLRatio Win Loss ratio
170
- * @property {number|null} timePlayed Time played
171
- */
423
+
172
424
  module.exports = BlitzSurvivalGames;
@@ -1,3 +1,4 @@
1
+ const divide = require('../../utils/divide');
1
2
  /**
2
3
  * BuildBattle class
3
4
  */
@@ -11,11 +12,26 @@ class BuildBattle {
11
12
  * @type {number}
12
13
  */
13
14
  this.score = data.score || 0;
15
+ /**
16
+ * Total wins
17
+ * @type {number}
18
+ */
19
+ this.totalWins = data.wins || 0;
14
20
  /**
15
21
  * Played games
16
22
  * @type {number}
17
23
  */
18
- this.playedGames = data.games_played || 0;
24
+ this.games = data.games_played || 0;
25
+ /**
26
+ * Win Loss ratio
27
+ * @type {number}
28
+ */
29
+ this.WLRatio = divide(this.totalWins, this.games);
30
+ /**
31
+ * Amount of super votes the player has
32
+ * @type {number}
33
+ */
34
+ this.superVotes = data.super_votes || 0;
19
35
  /**
20
36
  * Coins
21
37
  * @type {number}
@@ -26,18 +42,13 @@ class BuildBattle {
26
42
  * @type {number}
27
43
  */
28
44
  this.totalVotes = data.total_votes || 0;
29
- /**
30
- * Total wins
31
- * @type {number}
32
- */
33
- this.totalWins = data.wins || 0;
34
45
  /**
35
46
  * Wins for each mode
36
47
  * @type {BuildBattleWins}
37
48
  */
38
49
  this.wins = {
39
50
  solo: data.wins_solo_normal || 0,
40
- team: data.wins_teams_normal || 0,
51
+ teams: data.wins_teams_normal || 0,
41
52
  pro: data.wins_solo_pro || 0,
42
53
  gtb: data.wins_guess_the_build || 0
43
54
  };
@@ -46,7 +57,7 @@ class BuildBattle {
46
57
  /**
47
58
  * @typedef {object} BuildBattleWins
48
59
  * @property {number} solo BuildBattle Solo wins
49
- * @property {number} team BuildBattle Team wins
60
+ * @property {number} teams BuildBattle Team wins
50
61
  * @property {number} pro BuildBattle Pro wins
51
62
  * @property {number} gtb BuildBattle Guess The Build wins
52
63
  */