fix: rank_up sent on last battle of challenge (0.1.5)

main
spacemeowx2 2022-10-22 18:20:47 +08:00
parent 4929f67895
commit a5120fbfef
3 changed files with 11 additions and 7 deletions

View File

@ -1,3 +1,7 @@
0.1.5
fix: rank_up sent on last battle of challenge
0.1.4
fix: wrong win/lose count in challenge

View File

@ -1,7 +1,7 @@
import type { StatInkPostBody, VsHistoryDetail } from "./types.ts";
export const AGENT_NAME = "s3si.ts";
export const S3SI_VERSION = "0.1.4";
export const S3SI_VERSION = "0.1.5";
export const NSOAPP_VERSION = "2.3.1";
export const WEB_VIEW_VERSION = "1.0.0-216d0219";

View File

@ -247,20 +247,20 @@ export class StatInkExporter implements BattleExporter<VsBattle> {
listNode.udemae,
);
}
if (bankaraMatchChallenge) {
if (bankaraMatchChallenge && challengeProgress) {
result.rank_up_battle = bankaraMatchChallenge.isPromo ? "yes" : "no";
if (bankaraMatchChallenge.udemaeAfter) {
if (challengeProgress.index === 0 && bankaraMatchChallenge.udemaeAfter) {
[result.rank_after, result.rank_after_s_plus] = parseUdemae(
bankaraMatchChallenge.udemaeAfter,
);
result.rank_exp_change = bankaraMatchChallenge.earnedUdemaePoint ??
undefined;
} else {
result.rank_after = result.rank_before;
result.rank_after_s_plus = result.rank_before_s_plus;
}
result.rank_exp_change = bankaraMatchChallenge.earnedUdemaePoint ??
undefined;
}
if (challengeProgress) {
result.challenge_win = challengeProgress.winCount;
result.challenge_lose = challengeProgress.loseCount;
}