feat: add x power to stat.ink

main
spacemeowx2 2022-12-01 16:00:41 +08:00 committed by imspace
parent 057bfa508e
commit db636756e3
2 changed files with 19 additions and 4 deletions

View File

@ -424,6 +424,7 @@ export class StatInkExporter implements GameExporter {
}; };
async mapBattle( async mapBattle(
{ {
groupInfo,
challengeProgress, challengeProgress,
bankaraMatchChallenge, bankaraMatchChallenge,
listNode, listNode,
@ -511,7 +512,7 @@ export class StatInkExporter implements GameExporter {
result.our_team_count = myTeam?.result?.score ?? undefined; result.our_team_count = myTeam?.result?.score ?? undefined;
result.their_team_count = otherTeams?.[0]?.result?.score ?? undefined; result.their_team_count = otherTeams?.[0]?.result?.score ?? undefined;
result.rank_exp_change = bankaraMatch?.earnedUdemaePoint ?? undefined; result.rank_exp_change = bankaraMatch?.earnedUdemaePoint ?? undefined;
if (listNode) { if (listNode?.udemae) {
[result.rank_before, result.rank_before_s_plus] = parseUdemae( [result.rank_before, result.rank_before_s_plus] = parseUdemae(
listNode.udemae, listNode.udemae,
); );
@ -529,11 +530,25 @@ export class StatInkExporter implements GameExporter {
result.rank_after = result.rank_before; result.rank_after = result.rank_before;
result.rank_after_s_plus = result.rank_before_s_plus; result.rank_after_s_plus = result.rank_before_s_plus;
} }
}
if (challengeProgress) {
result.challenge_win = challengeProgress.winCount; result.challenge_win = challengeProgress.winCount;
result.challenge_lose = challengeProgress.loseCount; result.challenge_lose = challengeProgress.loseCount;
} }
if (vsDetail.xMatch) {
result.x_power_before = result.x_power_after = vsDetail.xMatch.lastXPower;
if (
groupInfo?.xMatchMeasurement &&
groupInfo?.xMatchMeasurement.state === "COMPLETED" &&
challengeProgress?.index === 0
) {
result.x_power_after = groupInfo.xMatchMeasurement.xPowerAfter;
}
}
if (rankBeforeState && rankState) { if (rankBeforeState && rankState) {
result.rank_before_exp = rankBeforeState.rankPoint; result.rank_before_exp = rankBeforeState.rankPoint;
result.rank_after_exp = rankState.rankPoint; result.rank_after_exp = rankState.rankPoint;

View File

@ -69,7 +69,7 @@ export type XMatchMeasurement = {
}; };
export type BattleListNode = { export type BattleListNode = {
id: string; id: string;
udemae: string; udemae?: string;
judgement: "LOSE" | "WIN" | "DEEMED_LOSE" | "EXEMPTED_LOSE" | "DRAW"; judgement: "LOSE" | "WIN" | "DEEMED_LOSE" | "EXEMPTED_LOSE" | "DRAW";
bankaraMatch: null | { bankaraMatch: null | {
earnedUdemaePoint: null | number; earnedUdemaePoint: null | number;
@ -765,8 +765,8 @@ export type StatInkPostBody = {
rank_up_battle?: "yes" | "no"; // Set "yes" if now "Rank-up Battle" mode. rank_up_battle?: "yes" | "no"; // Set "yes" if now "Rank-up Battle" mode.
challenge_win?: number; // Win count for Anarchy (Series) If rank_up_battle is truthy("yes"), the value range is limited to [0, 3]. challenge_win?: number; // Win count for Anarchy (Series) If rank_up_battle is truthy("yes"), the value range is limited to [0, 3].
challenge_lose?: number; challenge_lose?: number;
x_power_before?: number; x_power_before?: number | null;
x_power_after?: number; x_power_after?: number | null;
fest_power?: number; // Splatfest Power (Pro) fest_power?: number; // Splatfest Power (Pro)
fest_dragon?: fest_dragon?:
| "10x" | "10x"