Skip to content

Commit

Permalink
Added k_d, w_l, final_k_d and bed_ratio to bedwars gamemodes (#678)
Browse files Browse the repository at this point in the history
* Fixed 4v4 stats

* Added k_d, w_l, final_k_d and bed_ratio to gamemodes

* Updated for better readability

> It would make more sense to loop through `gamemodes` instead
  • Loading branch information
TheMysterys committed Aug 1, 2021
1 parent 595ec12 commit e2ed144
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions processors/games/Bedwars.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ module.exports = ({
Object.keys(betterModeNames).forEach((name) => {
gamemodes[betterModeNames[name]] = getModeStats(new RegExp(`^${name}_`));
});
Object.keys(gamemodes).forEach(function(name) {
const mode = gamemodes[name];
mode.k_d = getRatio(mode.kills,mode.deaths);
mode.w_l = getRatio(mode.wins,mode.losses);
mode.final_k_d = getRatio(mode.final_kills,mode.final_deaths);
mode.bed_ratio = getRatio(mode.beds_broken,mode.beds_lost);
});
const bedwarsLevel = getLevelForExp(Experience);
return ({
coins,
Expand Down

0 comments on commit e2ed144

Please sign in to comment.