Skip to content

Commit

Permalink
feat(goals): Bridge goals
Browse files Browse the repository at this point in the history
  • Loading branch information
Kathund committed Feb 21, 2024
1 parent 4012452 commit 06086e4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
31 changes: 23 additions & 8 deletions src/structures/MiniGames/Duels.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,15 @@ class Duels {
(data.bridge_3v3v3v3_rounds_played || 0) +
(data.bridge_four_rounds_played || 0) +
(data.bridge_threes_bridge_rounds_played || 0) +
(data.capture_threes_rounds_played || 0)
(data.capture_threes_rounds_played || 0),
goals:
(data.bridge_duel_goals || 0) +
(data.bridge_doubles_goals || 0) +
(data.bridge_2v2v2v2_goals || 0) +
(data.bridge_3v3v3v3_goals || 0) +
(data.bridge_four_goals || 0) +
(data.bridge_threes_bridge_goals || 0) +
(data.capture_threes_goals || 0)
},
'1v1': {
division: getDivision(data, 'bridge'),
Expand All @@ -456,7 +464,8 @@ class Duels {
wins: data.bridge_duel_wins || 0,
losses: data.bridge_duel_losses || 0,
WLRatio: divide(data.bridge_duel_wins, data.bridge_duel_losses),
playedGames: data.bridge_duel_rounds_played || 0
playedGames: data.bridge_duel_rounds_played || 0,
goals: data.bridge_duel_goals || 0
},
'2v2': {
division: getDivision(data, 'bridge'),
Expand All @@ -468,7 +477,8 @@ class Duels {
wins: data.bridge_doubles_wins || 0,
losses: data.bridge_doubles_losses || 0,
WLRatio: divide(data.bridge_doubles_wins, data.bridge_doubles_losses),
playedGames: data.bridge_doubles_rounds_played || 0
playedGames: data.bridge_doubles_rounds_played || 0,
goals: data.bridge_doubles_goals || 0
},
'3v3': {
division: getDivision(data, 'bridge'),
Expand All @@ -480,7 +490,8 @@ class Duels {
wins: data.bridge_threes_wins || 0,
losses: data.bridge_threes_losses || 0,
WLRatio: divide(data.bridge_threes_wins, data.bridge_threes_losses),
playedGames: data.bridge_threes_rounds_played || 0
playedGames: data.bridge_threes_rounds_played || 0,
goals: data.bridge_threes_goals || 0
},
'2v2v2v2': {
division: getDivision(data, 'bridge'),
Expand All @@ -492,7 +503,8 @@ class Duels {
wins: data.bridge_2v2v2v2_wins || 0,
losses: data.bridge_2v2v2v2_losses || 0,
WLRatio: divide(data.bridge_2v2v2v2_wins, data.bridge_2v2v2v2_losses),
playedGames: data.bridge_2v2v2v2_rounds_played || 0
playedGames: data.bridge_2v2v2v2_rounds_played || 0,
goals: data.bridge_2v2v2v2_goals || 0
},
'3v3v3v3': {
division: getDivision(data, 'bridge'),
Expand All @@ -504,7 +516,8 @@ class Duels {
wins: data.bridge_3v3v3v3_wins || 0,
losses: data.bridge_3v3v3v3_losses || 0,
WLRatio: divide(data.bridge_3v3v3v3_wins, data.bridge_3v3v3v3_losses),
playedGames: data.bridge_3v3v3v3_rounds_played || 0
playedGames: data.bridge_3v3v3v3_rounds_played || 0,
goals: data.bridge_3v3v3v3_goals || 0
},
'4v4': {
division: getDivision(data, 'bridge'),
Expand All @@ -516,7 +529,8 @@ class Duels {
wins: data.bridge_four_wins || 0,
losses: data.bridge_four_losses || 0,
WLRatio: divide(data.bridge_four_wins, data.bridge_four_losses),
playedGames: data.bridge_four_rounds_played || 0
playedGames: data.bridge_four_rounds_played || 0,
goals: data.bridge_four_goals || 0
},
// eslint-disable-next-line quote-props
ctf: {
Expand All @@ -528,7 +542,8 @@ class Duels {
losses: data.capture_threes_losses || 0,
WLRatio: divide(data.capture_threes_wins, data.capture_threes_losses),
captures: data.capture_threes_captures || 0,
playedGames: data.capture_threes_rounds_played || 0
playedGames: data.capture_threes_rounds_played || 0,
goals: data.capture_threes_goals || 0
}
};
/**
Expand Down
5 changes: 1 addition & 4 deletions src/structures/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ const VampireZ = require('./MiniGames/VampireZ');
const BlitzSurvivalGames = require('./MiniGames/BlitzSurvivalGames');
const ArenaBrawl = require('./MiniGames/ArenaBrawl');
const Arcade = require('./MiniGames/Arcade');
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const Pit = require('./MiniGames/Pit');
const Color = require('./Color');
const Game = require('./Game');
const PlayerCosmetics = require('./PlayerCosmetics');
Expand Down Expand Up @@ -225,8 +223,7 @@ class Player {
turbokartracers: data.stats.GingerBread ? new TurboKartRacers(data.stats.GingerBread) : null,
walls: data.stats.Walls ? new Walls(data.stats.Walls) : null,
warlords: data.stats.Battleground ? new Warlords(data.stats.Battleground) : null,
woolwars: data.stats.WoolGames ? new WoolWars(data.stats.WoolGames) : null,
pit: null
woolwars: data.stats.WoolGames ? new WoolWars(data.stats.WoolGames) : null
}
: null;
/**
Expand Down
8 changes: 8 additions & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3361,6 +3361,7 @@ declare module 'hypixel-api-reborn' {
losses: number;
WLRatio: number;
playedGames: number;
goals: number;
};
'1v1': {
division?: string;
Expand All @@ -3373,6 +3374,7 @@ declare module 'hypixel-api-reborn' {
KDRatio: number;
WLRatio: number;
playedGames: number;
goals: number;
};
'2v2': {
division?: string;
Expand All @@ -3385,6 +3387,7 @@ declare module 'hypixel-api-reborn' {
KDRatio: number;
WLRatio: number;
playedGames: number;
goals: number;
};
'3v3': {
division?: string;
Expand All @@ -3397,6 +3400,7 @@ declare module 'hypixel-api-reborn' {
losses: number;
WLRatio: number;
playedGames: number;
goals: number;
};
'4v4': {
division?: string;
Expand All @@ -3409,6 +3413,7 @@ declare module 'hypixel-api-reborn' {
KDRatio: number;
WLRatio: number;
playedGames: number;
goals: number;
};
'2v2v2v2': {
division?: string;
Expand All @@ -3421,6 +3426,7 @@ declare module 'hypixel-api-reborn' {
KDRatio: number;
WLRatio: number;
playedGames: number;
goals: number;
};
'3v3v3v3': {
division?: string;
Expand All @@ -3433,6 +3439,7 @@ declare module 'hypixel-api-reborn' {
KDRatio: number;
WLRatio: number;
playedGames: number;
goals: number;
};
ctf: {
division?: string;
Expand All @@ -3443,6 +3450,7 @@ declare module 'hypixel-api-reborn' {
losses: number;
WLRatio: number;
playedGames: number;
goals: number;
};
};
megawalls: {
Expand Down

0 comments on commit 06086e4

Please sign in to comment.