Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add sheep killed to sheep wars stats #687

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ export const WoolGamesProfile = ({
table = <SheepWarsTable sheepwars={woolgames[mode.api]} t={t} />;
sidebar.push(
[t("stats.magicWool"), t(woolgames.sheepwars.magicWool), "§5"],
[t("stats.sheepThrown"), t(woolgames.sheepwars.sheepThrown), "§c"]
[t("stats.sheepThrown"), t(woolgames.sheepwars.sheepThrown), "§c"],
[t("stats.sheepKilled"), t(woolgames.sheepwars.sheepKilled), "§4"]
);
break;
}
Expand Down
5 changes: 3 additions & 2 deletions locales/en-US/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,8 @@
"arcadeWins": "Arcade Wins",
"draws": "Draws",
"sheepThrown": "Sheep Thrown",
"magicWool": "Magic Wool"
"magicWool": "Magic Wool",
"sheepKilled": "Sheep Killed"
},
"tips": {
"discord": "$t(emojis:socials.discord) Join our **$t(socials.discord)** and get **20% lower cooldowns** $t(emojis:heart)",
Expand Down Expand Up @@ -839,4 +840,4 @@
"successfulUnverification": "Successfully unverified your account!",
"successfulVerification": "You are now verified to **{{displayName}}**"
}
}
}
4 changes: 2 additions & 2 deletions packages/schemas/src/player/gamemodes/woolgames/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class WoolGames {
@Field()
public captureTheWool: CaptureTheWool;

public constructor(data: APIData) {
public constructor(data: APIData, ap: APIData) {
this.coins = data.coins;
this.layers = data.progression?.available_layers;
this.exp = Math.round(data.progression?.experience ?? 0);
Expand All @@ -104,7 +104,7 @@ export class WoolGames {
this.playtime = (data.playtime ?? 0) * 1000;

this.woolwars = new WoolWars(data.wool_wars);
this.sheepwars = new SheepWars(data.sheep_wars);
this.sheepwars = new SheepWars(data.sheep_wars, ap);
this.captureTheWool = new CaptureTheWool(data.capture_the_wool?.stats);
}
}
Expand Down
6 changes: 5 additions & 1 deletion packages/schemas/src/player/gamemodes/woolgames/sheepwars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ export class SheepWars {
@Field()
public sheepThrown: number;

@Field()
public sheepKilled: number;

@Field()
public magicWool: number;

@Field({ store: { default: "none" } })
public kit: string;

public constructor(data: APIData = {}) {
public constructor(data: APIData = {}, ap: APIData = {}) {
this.gamesPlayed = data.stats?.games_played;
this.wins = data.stats?.wins;
this.losses = data.stats?.losses;
Expand All @@ -52,6 +55,7 @@ export class SheepWars {
this.kdr = ratio(this.kills, this.deaths);

this.sheepThrown = data.stats?.sheep_thrown;
this.sheepKilled = ap?.woolgames_sheep_wars_sheep_slayer;
this.magicWool = data.stats?.magic_wool_hit;

this.kit = data.default_kit;
Expand Down
2 changes: 1 addition & 1 deletion packages/schemas/src/player/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,6 @@ export class PlayerStats {
this.vampirez = new VampireZ(stats.VampireZ ?? {}, legacy);
this.walls = new Walls(stats.Walls ?? {}, legacy);
this.warlords = new Warlords(stats.Battleground ?? {});
this.woolgames = new WoolGames(stats.WoolGames ?? {});
this.woolgames = new WoolGames(stats.WoolGames ?? {}, achievements);
}
}