Skip to content

Commit

Permalink
fix(leaderboards): party games best time and woolgames level lb (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobk999 authored Aug 21, 2024
1 parent 5088dcd commit a0adc6a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/schemas/src/player/gamemodes/arcade/mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@ export class PartyGames {
@Field()
public workshopWins: number;

@Field({ leaderboard: { formatter: formatRaceTime, sort: "ASC" } })
// The goal of anvil spleef is to live the longest not the shortest so we sort in descending order
@Field({ leaderboard: { formatter: formatRaceTime } })
public anvilSpleefBestTime: number;

@Field({ leaderboard: { formatter: formatRaceTime, sort: "ASC" } })
Expand All @@ -757,7 +758,8 @@ export class PartyGames {
@Field({ leaderboard: { formatter: formatRaceTime, sort: "ASC" } })
public jungleJumpBestTime: number;

@Field({ leaderboard: { formatter: formatRaceTime, sort: "ASC" } })
// The goal of bombardment is to live the longest not the shortest so we sort in descending order
@Field({ leaderboard: { formatter: formatRaceTime } })
public bombardmentBestTime: number;

@Field({ leaderboard: { formatter: formatRaceTime, sort: "ASC" } })
Expand Down
7 changes: 6 additions & 1 deletion packages/schemas/src/player/gamemodes/woolgames/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Field } from "#metadata";
import { Progression } from "#progression";
import { SheepWars } from "./sheepwars.js";
import { WoolWars } from "./woolwars.js";
import { add } from "@statsify/math";
import { getExpReq, getFormattedLevel, getLevel } from "./util.js";

export const WOOLGAMES_MODES = new GameModes([
Expand Down Expand Up @@ -49,7 +50,7 @@ export class WoolGames {
fieldName: "Level",
hidden: true,
formatter: (exp: number) => getFormattedLevel(Math.floor(getLevel(exp))),
additionalFields: ["this.overall.wins", "this.overall.kills", "this.overall.kdr"],
additionalFields: ["this.wins", "this.playtime"],
},
historical: {
hidden: false,
Expand All @@ -75,6 +76,9 @@ export class WoolGames {
@Field({ leaderboard: { formatter: formatTime }, historical: { enabled: false } })
public playtime: number;

@Field()
public wins: number;

@Field({ leaderboard: { name: "WoolWars" } })
public woolwars: WoolWars;

Expand Down Expand Up @@ -106,6 +110,7 @@ export class WoolGames {
this.woolwars = new WoolWars(data.wool_wars);
this.sheepwars = new SheepWars(data.sheep_wars, ap);
this.captureTheWool = new CaptureTheWool(data.capture_the_wool?.stats);
this.wins = add(this.woolwars.overall.wins, this.sheepwars.wins, this.captureTheWool.wins);
}
}

Expand Down

0 comments on commit a0adc6a

Please sign in to comment.