Skip to content

Commit ee909e3

Browse files
committed
fixed QuakeCraft#solo stats, imported these minigames to Player#stats, extra semicolons
1 parent 2585b1b commit ee909e3

File tree

3 files changed

+265
-243
lines changed

3 files changed

+265
-243
lines changed

src/structures/MiniGames/Quakecraft.js

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ class Quakecraft {
1616
* Kills
1717
* @type {number}
1818
*/
19-
this.kills = data.kills || 0;
19+
this.kills = ((data.kills || 0) + (data.kills_teams || 0));
2020
/**
2121
* Deaths
2222
* @type {number}
2323
*/
24-
this.deaths = data.deaths || 0;
24+
this.deaths = ((data.deaths || 0) + (data.deaths_teams || 0));
2525
/**
2626
* Kill Death ratio
2727
* @type {number}
@@ -31,27 +31,27 @@ class Quakecraft {
3131
* Wins
3232
* @type {number}
3333
*/
34-
this.wins = data.wins || 0;
34+
this.wins = ((data.wins || 0) + (data.wins_teams || 0));
3535
/**
3636
* Distance travelled
3737
* @type {number}
3838
*/
39-
this.distanceTravelled = data.distance_travelled || 0;
39+
this.distanceTravelled = (data.distance_travelled + data.distance_travelled_teams) || 0;
4040
/**
4141
* Headshots
4242
* @type {number}
4343
*/
44-
this.headshots = data.headshots || 0;
44+
this.headshots = ((data.headshots || 0) + (data.headshots_teams || 0));
4545
/**
4646
* Shots fired
4747
* @type {number}
4848
*/
49-
this.shotsFired = data.shots_fired || 0;
49+
this.shotsFired = ((data.shots_fired || 0) + (data.shots_fired_teams || 0));
5050
/**
5151
* Kill streaks
5252
* @type {number}
5353
*/
54-
this.killstreaks = data.killstreaks || 0;
54+
this.killstreaks = ((data.killstreaks || 0) + (data.killstreaks_teams || 0));
5555
/**
5656
* Highest killstreak
5757
* @type {number}
@@ -62,14 +62,14 @@ class Quakecraft {
6262
* @type {QuakecraftModeStats}
6363
*/
6464
this.solo = {
65-
kills: data.kills - data.kills_teams || 0,
66-
deaths: data.deaths - data.deaths_teams || 0,
67-
KDRatio: divide((data.kills - data.kills_teams), (data.deaths - data.deaths_teams)),
68-
wins: data.wins - data.wins_teams || 0,
69-
distanceTravelled: data.distance_travelled - data.distance_travelled_teams || 0,
70-
headshots: data.headshots - data.headshots_teams || 0,
71-
shotsFired: data.shots_fired - data.shots_fired_teams || 0,
72-
killstreaks: data.killstreaks - data.killstreaks_teams || 0
65+
kills: data.kills || 0,
66+
deaths: data.deaths|| 0,
67+
KDRatio: divide((data.kills), (data.deaths)),
68+
wins: data.wins || 0,
69+
distanceTravelled: data.distance_travelled || 0,
70+
headshots: data.headshots || 0,
71+
shotsFired: data.shots_fired || 0,
72+
killstreaks: data.killstreaks || 0
7373
};
7474
/**
7575
* Teams
@@ -88,3 +88,15 @@ class Quakecraft {
8888
}
8989
}
9090
module.exports = Quakecraft;
91+
/**
92+
* @typedef {object} QuakecraftModeStats
93+
* @property {number} kills Kills
94+
* @property {number} deaths Deaths
95+
* @property {number} KDRatio Kill Death ratio
96+
* @property {number} wins Wins
97+
* @property {number} distanceTravelled Distance travelled
98+
* @property {number} headshots Headshots
99+
* @property {number} killstreaks Killstreaks
100+
* @property {number} highestKillstreak Highest killstreak
101+
* @property {number} shotsFired Shots fired
102+
*/

src/structures/Player.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const Color = require('./Color');
2020
const Game = require('./Game');
2121
const PlayerCosmetics = require('./PlayerCosmetics');
2222
const { recursive } = require('../utils/removeSnakeCase');
23+
const TurboKartRacers = require('./MiniGames/TurboKartRacers');
24+
const Paintball = require('./MiniGames/Paintball');
25+
const Quakecraft = require('./MiniGames/Quakecraft');
26+
const Walls = require('./MiniGames/Walls');
27+
const Warlords = require('./MiniGames/Warlords');
2328
/**
2429
* Player class
2530
*/
@@ -227,6 +232,11 @@ class Player {
227232
blitzsg: (data.stats.HungerGames ? new BlitzSurvivalGames(data.stats.HungerGames) : null),
228233
arena: (data.stats.Arena ? new ArenaBrawl(data.stats.Arena) : null),
229234
arcade: (data.stats.Arcade ? new Arcade({...data.stats.Arcade, ...data.achievements}) : null),
235+
paintball: (data.stats.Paintball ? new Paintball(data.stats.Paintball) : null),
236+
quakecraft: (data.stats.Quake ? new Quakecraft(data.stats.Quake) : null),
237+
turbokartracers: (data.stats.GingerBread ? new TurboKartRacers(data.stats.GingerBread) : null),
238+
walls: (data.stats.Walls ? new Walls(data.stats.Walls) : null),
239+
warlords: (data.stats.Battleground ? new Warlords(data.stats.Battleground) : null),
230240
pit: null
231241
} : null);
232242
/**

0 commit comments

Comments
 (0)