fix: upgrade between Profreshional +n (#45)

main
spacemeowx2 2022-11-30 17:24:37 +08:00 committed by imspace
parent e2b7828ff3
commit 606fb263e1
3 changed files with 18 additions and 6 deletions

View File

@ -1,3 +1,8 @@
## 0.1.38
fix: upgrade between Profreshional +n
([#45](https://github.com/spacemeowx2/s3si.ts/issues/45))
## 0.1.37
feat: avoid duplicate with s3s' upload

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.37";
export const S3SI_VERSION = "0.1.38";
export const NSOAPP_VERSION = "2.3.1";
export const WEB_VIEW_VERSION = "2.0.0-8a061f6c";
export const S3SI_LINK = "https://github.com/spacemeowx2/s3si.ts";

View File

@ -712,11 +712,14 @@ export class StatInkExporter implements GameExporter {
clear_waves = 0;
}
let title_before = undefined;
let title_exp_before = undefined;
let title_before: string | undefined = undefined;
let title_exp_before: number | undefined = undefined;
const expDiff = COOP_POINT_MAP[clear_waves];
if (nonNullable(title_exp_after) && nonNullable(expDiff)) {
if (
nonNullable(title_after) && nonNullable(title_exp_after) &&
nonNullable(expDiff)
) {
if (title_exp_after === 40 && expDiff === 20) {
// 20 -> 40 or ?(rank up) -> 40
} else if (title_exp_after === 40 && expDiff < 0 && title_after !== "8") {
@ -725,8 +728,12 @@ export class StatInkExporter implements GameExporter {
// 980,990 -> 999
title_before = title_after;
} else {
if (title_exp_after - expDiff >= 0) {
title_before = title_after;
title_exp_before = title_exp_after - expDiff;
} else {
title_before = (parseInt(title_after) - 1).toString();
}
}
}