hypixel-api-reborn 10.0.0 → 11.0.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.
Files changed (105) hide show
  1. package/.prettierrc +13 -0
  2. package/README.md +28 -16
  3. package/package.json +60 -58
  4. package/src/API/getAPIStatus.js +8 -8
  5. package/src/API/getBoosters.js +6 -6
  6. package/src/API/getGameCounts.js +6 -6
  7. package/src/API/getGuild.js +18 -18
  8. package/src/API/getLeaderboards.js +13 -13
  9. package/src/API/getPlayer.js +22 -27
  10. package/src/API/getRecentGames.js +18 -18
  11. package/src/API/getServerInfo.js +66 -77
  12. package/src/API/getStatus.js +8 -8
  13. package/src/API/getWatchdogStats.js +6 -6
  14. package/src/API/index.js +19 -23
  15. package/src/API/skyblock/getEndedSkyblockAuctions.js +10 -10
  16. package/src/API/skyblock/getSkyblockAuctions.js +64 -64
  17. package/src/API/skyblock/getSkyblockAuctionsByPlayer.js +11 -11
  18. package/src/API/skyblock/getSkyblockBazaar.js +10 -10
  19. package/src/API/skyblock/getSkyblockMember.js +28 -25
  20. package/src/API/skyblock/getSkyblockNews.js +6 -6
  21. package/src/API/skyblock/getSkyblockProfiles.js +44 -41
  22. package/src/Client.js +406 -450
  23. package/src/Errors.js +44 -39
  24. package/src/Private/defaultCache.js +77 -78
  25. package/src/Private/rateLimit.js +79 -98
  26. package/src/Private/requests.js +65 -54
  27. package/src/Private/updater.js +45 -45
  28. package/src/Private/uuidCache.js +37 -33
  29. package/src/Private/validate.js +97 -97
  30. package/src/index.js +82 -83
  31. package/src/structures/APIIncident.js +78 -78
  32. package/src/structures/APIStatus.js +47 -47
  33. package/src/structures/Boosters/Booster.js +83 -87
  34. package/src/structures/Color.js +129 -129
  35. package/src/structures/Game.js +164 -160
  36. package/src/structures/GameCounts.js +151 -151
  37. package/src/structures/Guild/Guild.js +204 -218
  38. package/src/structures/Guild/GuildMember.js +66 -66
  39. package/src/structures/Guild/GuildRank.js +48 -48
  40. package/src/structures/ItemBytes.js +33 -36
  41. package/src/structures/Leaderboard.js +31 -31
  42. package/src/structures/MiniGames/Arcade.js +567 -569
  43. package/src/structures/MiniGames/ArenaBrawl.js +52 -56
  44. package/src/structures/MiniGames/BedWars.js +423 -351
  45. package/src/structures/MiniGames/BlitzSurvivalGames.js +172 -148
  46. package/src/structures/MiniGames/BuildBattle.js +53 -53
  47. package/src/structures/MiniGames/CopsAndCrims.js +90 -90
  48. package/src/structures/MiniGames/Duels.js +694 -630
  49. package/src/structures/MiniGames/MegaWalls.js +137 -137
  50. package/src/structures/MiniGames/MurderMystery.js +93 -93
  51. package/src/structures/MiniGames/Paintball.js +67 -67
  52. package/src/structures/MiniGames/Pit.js +19 -19
  53. package/src/structures/MiniGames/Quakecraft.js +101 -101
  54. package/src/structures/MiniGames/SkyWars.js +508 -559
  55. package/src/structures/MiniGames/SmashHeroes.js +144 -151
  56. package/src/structures/MiniGames/SpeedUHC.js +115 -57
  57. package/src/structures/MiniGames/TNTGames.js +116 -116
  58. package/src/structures/MiniGames/TurboKartRacers.js +201 -176
  59. package/src/structures/MiniGames/UHC.js +164 -143
  60. package/src/structures/MiniGames/VampireZ.js +60 -60
  61. package/src/structures/MiniGames/Walls.js +52 -52
  62. package/src/structures/MiniGames/Warlords.js +62 -62
  63. package/src/structures/MiniGames/WoolWars.js +123 -0
  64. package/src/structures/Pet.js +96 -97
  65. package/src/structures/Pets.js +64 -64
  66. package/src/structures/Player.js +433 -449
  67. package/src/structures/PlayerCosmetics.js +100 -95
  68. package/src/structures/RecentGame.js +57 -57
  69. package/src/structures/ServerInfo.js +78 -78
  70. package/src/structures/SkyBlock/Auctions/Auction.js +104 -104
  71. package/src/structures/SkyBlock/Auctions/AuctionInfo.js +54 -54
  72. package/src/structures/SkyBlock/Auctions/BaseAuction.js +45 -45
  73. package/src/structures/SkyBlock/Auctions/Bid.js +48 -48
  74. package/src/structures/SkyBlock/Auctions/PartialAuction.js +25 -25
  75. package/src/structures/SkyBlock/Bazzar/Order.js +38 -38
  76. package/src/structures/SkyBlock/Bazzar/Product.js +53 -53
  77. package/src/structures/SkyBlock/News/SkyblockNews.js +60 -68
  78. package/src/structures/SkyBlock/SkyblockInventoryItem.js +124 -130
  79. package/src/structures/SkyBlock/SkyblockMember.js +820 -687
  80. package/src/structures/SkyBlock/SkyblockPet.js +71 -71
  81. package/src/structures/SkyBlock/SkyblockProfile.js +60 -60
  82. package/src/structures/Status.js +41 -41
  83. package/src/structures/Watchdog/Stats.js +36 -36
  84. package/src/utils/Constants.js +2789 -809
  85. package/src/utils/SkyblockUtils.js +208 -164
  86. package/src/utils/arrayTools.js +4 -4
  87. package/src/utils/divide.js +5 -5
  88. package/src/utils/guildExp.js +57 -67
  89. package/src/utils/index.js +13 -13
  90. package/src/utils/isGuildID.js +3 -3
  91. package/src/utils/isUUID.js +5 -5
  92. package/src/utils/oscillation.js +15 -23
  93. package/src/utils/removeSnakeCase.js +22 -35
  94. package/src/utils/rgbToHexColor.js +8 -8
  95. package/src/utils/romanize.js +11 -13
  96. package/src/utils/toIGN.js +20 -20
  97. package/src/utils/toUuid.js +19 -19
  98. package/src/utils/varInt.js +17 -21
  99. package/typings/index.d.ts +3532 -2644
  100. package/src/API/getFriends.js +0 -14
  101. package/src/API/getKeyInfo.js +0 -10
  102. package/src/API/getRankedSkyWars.js +0 -11
  103. package/src/structures/Friend.js +0 -38
  104. package/src/structures/KeyInfo.js +0 -42
  105. package/src/structures/MiniGames/SkyWarsRanked.js +0 -45
@@ -1,148 +1,172 @@
1
- const divide = require('../../utils/divide');
2
- const kits = [
3
- 'arachnologist', 'archer', 'armorer',
4
- 'astronaut', 'baker', 'blaze',
5
- 'creepertamer', 'fisherman', 'horsetamer',
6
- 'hunter', 'knight', 'meatmaster',
7
- 'necromancer', 'pigman', 'reddragon',
8
- 'rogue', 'scout', 'slimeyslime',
9
- 'speleologist', 'tim', 'toxicologist',
10
- 'troll', 'wolftamer', 'paladin',
11
- 'shadow knight', 'hype train', 'jockey',
12
- 'reaper', 'golem', 'farmer',
13
- 'florist', 'snowman', 'guardian',
14
- 'warlock', 'viking', 'diver',
15
- 'ranger', 'donkeytamer', 'phoenix',
16
- 'warrior', 'rambo'
17
- ];
18
- /**
19
- * Blitz SG class
20
- */
21
- class BlitzSurvivalGames {
22
- /**
23
- * @param {object} data Blitz SG data
24
- */
25
- constructor (data) {
26
- /**
27
- * Coins
28
- * @type {number}
29
- */
30
- this.coins = data.coins || 0;
31
- /**
32
- * Kills
33
- * @type {number}
34
- */
35
- this.kills = data.kills || 0;
36
- /**
37
- * Deaths
38
- * @type {number}
39
- */
40
- this.deaths = data.deaths || 0;
41
- /**
42
- * Kill Death ratio
43
- * @type {number}
44
- */
45
- this.KDRatio = divide(this.kills, this.deaths);
46
- /**
47
- * Solo wins
48
- * @type {number}
49
- */
50
- this.winsSolo = data.wins || 0;
51
- /**
52
- * Team wins
53
- * @type {number}
54
- */
55
- this.winsTeam = data.wins_teams || 0;
56
- /**
57
- * Stats for each kit
58
- * @type {BlitzSGKitStats[]}
59
- */
60
- this.kitStats = generateKitStats(data);
61
- }
62
- }
63
- /**
64
- * @param {object} data
65
- * @return {object}
66
- */
67
- function generateKitStats (data) {
68
- const stats = [];
69
- for (let i = 0; i < kits.length; i++) {
70
- if (data[kits[i]]) {
71
- stats.push({
72
- name: kits[i],
73
- games: data[`games_played_${kits[i]}`] || 0,
74
- level: (data[kits[i]] + 1) || 1,
75
- experience: data[`exp_${kits[i]}`] || 0,
76
- prestige: data[`p${kits[i]}`] || 0,
77
- kills: data[`kills_${kits[i]}`] || 0,
78
- deaths: data[`deaths_${kits[i]}`] || 0,
79
- KDRatio: divide(data[`kills_${kits[i]}`], data[`deaths_${kits[i]}`]),
80
- wins: data[`wins_${kits[i]}`] || 0,
81
- losses: data[`losses_${kits[i]}`] || 0,
82
- WLRatio: divide(data[`wins_${kits[i]}`], data[`losses_${kits[i]}`]),
83
- timePlayed: data[`time_played_${kits[i]}`] || null
84
- });
85
- }
86
- }
87
- return stats;
88
- }
89
- /**
90
- * @typedef {string} BlitzSGKit
91
- * * `arachnologist`
92
- * * `archer`
93
- * * `armorer`
94
- * * `astronaut`
95
- * * `baker`
96
- * * `blaze`
97
- * * `creepertamer`
98
- * * `fisherman`
99
- * * `horsetamer`
100
- * * `hunter`
101
- * * `knight`
102
- * * `meatmaster`
103
- * * `necromancer`
104
- * * `pigman`
105
- * * `reddragon`
106
- * * `rogue`
107
- * * `scout`
108
- * * `slimeyslime`
109
- * * `speleologist`
110
- * * `tim`
111
- * * `toxicologist`
112
- * * `troll`
113
- * * `wolftamer`
114
- * * `paladin`
115
- * * `shadow knight`
116
- * * `hype train`
117
- * * `jockey`
118
- * * `reaper`
119
- * * `golem`
120
- * * `farmer`
121
- * * `florist`
122
- * * `snowman`
123
- * * `guardian`
124
- * * `warlock`
125
- * * `viking`
126
- * * `diver`
127
- * * `ranger`
128
- * * `donkeytamer`
129
- * * `phoenix`
130
- * * `warrior`
131
- * * `rambo`
132
- */
133
- /**
134
- * @typedef {object} BlitzSGKitStats
135
- * @property {BlitzSGKit} name Kit name
136
- * @property {number} games Played games
137
- * @property {number} level level
138
- * @property {number} experience Total experience
139
- * @property {number} prestige Prestige
140
- * @property {number} kills Kills
141
- * @property {number} deaths Deaths
142
- * @property {number} KDRatio Kill Death ratio
143
- * @property {number} wins Wins
144
- * @property {number} losses Losses
145
- * @property {number} WLRatio Win Loss ratio
146
- * @property {number|null} timePlayed Time played
147
- */
148
- module.exports = BlitzSurvivalGames;
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
+ ];
45
+ /**
46
+ * Blitz SG class
47
+ */
48
+ class BlitzSurvivalGames {
49
+ /**
50
+ * @param {object} data Blitz SG data
51
+ */
52
+ constructor(data) {
53
+ /**
54
+ * Coins
55
+ * @type {number}
56
+ */
57
+ this.coins = data.coins || 0;
58
+ /**
59
+ * Kills
60
+ * @type {number}
61
+ */
62
+ this.kills = data.kills || 0;
63
+ /**
64
+ * Deaths
65
+ * @type {number}
66
+ */
67
+ this.deaths = data.deaths || 0;
68
+ /**
69
+ * Kill Death ratio
70
+ * @type {number}
71
+ */
72
+ this.KDRatio = divide(this.kills, this.deaths);
73
+ /**
74
+ * Solo wins
75
+ * @type {number}
76
+ */
77
+ this.winsSolo = data.wins || 0;
78
+ /**
79
+ * Team wins
80
+ * @type {number}
81
+ */
82
+ this.winsTeam = data.wins_teams || 0;
83
+ /**
84
+ * Stats for each kit
85
+ * @type {BlitzSGKitStats[]}
86
+ */
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
+ }
110
+ }
111
+ return stats;
112
+ }
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
+ */
172
+ module.exports = BlitzSurvivalGames;
@@ -1,53 +1,53 @@
1
- /**
2
- * BuildBattle class
3
- */
4
- class BuildBattle {
5
- /**
6
- * @param {object} data BuildBattle data
7
- */
8
- constructor (data) {
9
- /**
10
- * Score
11
- * @type {number}
12
- */
13
- this.score = data.score || 0;
14
- /**
15
- * Played games
16
- * @type {number}
17
- */
18
- this.playedGames = data.games_played || 0;
19
- /**
20
- * Coins
21
- * @type {number}
22
- */
23
- this.coins = data.coins || 0;
24
- /**
25
- * Total votes
26
- * @type {number}
27
- */
28
- this.totalVotes = data.total_votes || 0;
29
- /**
30
- * Total wins
31
- * @type {number}
32
- */
33
- this.totalWins = data.wins || 0;
34
- /**
35
- * Wins for each mode
36
- * @type {BuildBattleWins}
37
- */
38
- this.wins = {
39
- solo: data.wins_solo_normal || 0,
40
- team: data.wins_teams_normal || 0,
41
- pro: data.wins_solo_pro || 0,
42
- gtb: data.wins_guess_the_build || 0
43
- };
44
- }
45
- }
46
- /**
47
- * @typedef {object} BuildBattleWins
48
- * @property {number} solo BuildBattle Solo wins
49
- * @property {number} team BuildBattle Team wins
50
- * @property {number} pro BuildBattle Pro wins
51
- * @property {number} gtb BuildBattle Guess The Build wins
52
- */
53
- module.exports = BuildBattle;
1
+ /**
2
+ * BuildBattle class
3
+ */
4
+ class BuildBattle {
5
+ /**
6
+ * @param {object} data BuildBattle data
7
+ */
8
+ constructor(data) {
9
+ /**
10
+ * Score
11
+ * @type {number}
12
+ */
13
+ this.score = data.score || 0;
14
+ /**
15
+ * Played games
16
+ * @type {number}
17
+ */
18
+ this.playedGames = data.games_played || 0;
19
+ /**
20
+ * Coins
21
+ * @type {number}
22
+ */
23
+ this.coins = data.coins || 0;
24
+ /**
25
+ * Total votes
26
+ * @type {number}
27
+ */
28
+ this.totalVotes = data.total_votes || 0;
29
+ /**
30
+ * Total wins
31
+ * @type {number}
32
+ */
33
+ this.totalWins = data.wins || 0;
34
+ /**
35
+ * Wins for each mode
36
+ * @type {BuildBattleWins}
37
+ */
38
+ this.wins = {
39
+ solo: data.wins_solo_normal || 0,
40
+ team: data.wins_teams_normal || 0,
41
+ pro: data.wins_solo_pro || 0,
42
+ gtb: data.wins_guess_the_build || 0
43
+ };
44
+ }
45
+ }
46
+ /**
47
+ * @typedef {object} BuildBattleWins
48
+ * @property {number} solo BuildBattle Solo wins
49
+ * @property {number} team BuildBattle Team wins
50
+ * @property {number} pro BuildBattle Pro wins
51
+ * @property {number} gtb BuildBattle Guess The Build wins
52
+ */
53
+ module.exports = BuildBattle;
@@ -1,90 +1,90 @@
1
- const divide = require('../../utils/divide');
2
- /**
3
- * Cops and crims class
4
- */
5
- class CopsAndCrims {
6
- /**
7
- * @param {object} data Cops and crims data
8
- */
9
- constructor (data) {
10
- /**
11
- * Coins
12
- * @type {number}
13
- */
14
- this.coins = data.coins || 0;
15
- /**
16
- * Kills
17
- * @type {number}
18
- */
19
- this.kills = data.kills || 0;
20
- /**
21
- * Deaths
22
- * @type {number}
23
- */
24
- this.deaths = data.deaths || 0;
25
- /**
26
- * Kill Death ratio
27
- * @type {number}
28
- */
29
- this.KDRatio = divide(this.kills, this.deaths);
30
- /**
31
- * Wins
32
- * @type {number}
33
- */
34
- this.wins = data.game_wins || 0;
35
- /**
36
- * Round wins
37
- * @type {number}
38
- */
39
- this.roundWins = data.round_wins || 0;
40
- /**
41
- * Shows fired
42
- * @type {number}
43
- */
44
- this.shotsFired = data.shots_fired || 0;
45
- /**
46
- * Headshot kills
47
- * @type {number}
48
- */
49
- this.headshotKills = data.headshot_kills || 0;
50
- /**
51
- * Bombs defused
52
- * @type {number}
53
- */
54
- this.bombsDefused = data.bombs_defused || 0;
55
- /**
56
- * Bombs planted
57
- * @type {number}
58
- */
59
- this.bombsPlanted = data.bombs_planted || 0;
60
- /**
61
- * Kills as Crim
62
- * @type {number}
63
- */
64
- this.killsAsCrim = data.criminal_kills || 0;
65
- /**
66
- * Kills as Cop
67
- * @type {number}
68
- */
69
- this.killsAsCop = data.cop_kills || 0;
70
- /**
71
- * Deathmatch stats
72
- * @type {CopsAndCrimsDeathmatch}
73
- */
74
- this.deathmatch = {
75
- kills: data.kills_deathmatch || 0,
76
- deaths: data.deaths_deathmatch || 0,
77
- KDRatio: divide(data.kills_deathmatch, data.deaths_deathmatch),
78
- killsAsCrim: data.criminal_kills_deathmatch || 0,
79
- killsAsCop: data.cop_kills_deathmatch || 0
80
- };
81
- }
82
- }
83
- /**
84
- * @typedef {object} CopsAndCrimsDeathmatch
85
- * @property {number} kills Deathmatch kills
86
- * @property {number} deaths Deathmatch deaths
87
- * @property {number} killsAsCrim Deathmatch kills as crim
88
- * @property {number} killsAsCop Deathmatch kills as cop
89
- */
90
- module.exports = CopsAndCrims;
1
+ const divide = require('../../utils/divide');
2
+ /**
3
+ * Cops and crims class
4
+ */
5
+ class CopsAndCrims {
6
+ /**
7
+ * @param {object} data Cops and crims data
8
+ */
9
+ constructor(data) {
10
+ /**
11
+ * Coins
12
+ * @type {number}
13
+ */
14
+ this.coins = data.coins || 0;
15
+ /**
16
+ * Kills
17
+ * @type {number}
18
+ */
19
+ this.kills = data.kills || 0;
20
+ /**
21
+ * Deaths
22
+ * @type {number}
23
+ */
24
+ this.deaths = data.deaths || 0;
25
+ /**
26
+ * Kill Death ratio
27
+ * @type {number}
28
+ */
29
+ this.KDRatio = divide(this.kills, this.deaths);
30
+ /**
31
+ * Wins
32
+ * @type {number}
33
+ */
34
+ this.wins = data.game_wins || 0;
35
+ /**
36
+ * Round wins
37
+ * @type {number}
38
+ */
39
+ this.roundWins = data.round_wins || 0;
40
+ /**
41
+ * Shows fired
42
+ * @type {number}
43
+ */
44
+ this.shotsFired = data.shots_fired || 0;
45
+ /**
46
+ * Headshot kills
47
+ * @type {number}
48
+ */
49
+ this.headshotKills = data.headshot_kills || 0;
50
+ /**
51
+ * Bombs defused
52
+ * @type {number}
53
+ */
54
+ this.bombsDefused = data.bombs_defused || 0;
55
+ /**
56
+ * Bombs planted
57
+ * @type {number}
58
+ */
59
+ this.bombsPlanted = data.bombs_planted || 0;
60
+ /**
61
+ * Kills as Crim
62
+ * @type {number}
63
+ */
64
+ this.killsAsCrim = data.criminal_kills || 0;
65
+ /**
66
+ * Kills as Cop
67
+ * @type {number}
68
+ */
69
+ this.killsAsCop = data.cop_kills || 0;
70
+ /**
71
+ * Deathmatch stats
72
+ * @type {CopsAndCrimsDeathmatch}
73
+ */
74
+ this.deathmatch = {
75
+ kills: data.kills_deathmatch || 0,
76
+ deaths: data.deaths_deathmatch || 0,
77
+ KDRatio: divide(data.kills_deathmatch, data.deaths_deathmatch),
78
+ killsAsCrim: data.criminal_kills_deathmatch || 0,
79
+ killsAsCop: data.cop_kills_deathmatch || 0
80
+ };
81
+ }
82
+ }
83
+ /**
84
+ * @typedef {object} CopsAndCrimsDeathmatch
85
+ * @property {number} kills Deathmatch kills
86
+ * @property {number} deaths Deathmatch deaths
87
+ * @property {number} killsAsCrim Deathmatch kills as crim
88
+ * @property {number} killsAsCop Deathmatch kills as cop
89
+ */
90
+ module.exports = CopsAndCrims;