Merge remote-tracking branch 'upstream/main' into splashcat-exporter
commit
daad8f5a94
|
|
@ -1,3 +1,11 @@
|
|||
## 0.4.10
|
||||
|
||||
feat: support random primary ability
|
||||
|
||||
## 0.4.9
|
||||
|
||||
feat: add species and crown_type
|
||||
|
||||
## 0.4.8
|
||||
|
||||
chore: update `WEB_VIEW_VERSION` and queries
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"package": {
|
||||
"productName": "s3si-ts",
|
||||
"version": "0.4.8"
|
||||
"version": "0.4.10"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import type { StatInkPostBody, VsHistoryDetail } from "./types.ts";
|
|||
|
||||
export const AGENT_NAME = "splashcat / s3si.ts";
|
||||
export const AGENT_VERSION = "1.1.1";
|
||||
export const S3SI_VERSION = "0.4.8";
|
||||
export const S3SI_VERSION = "0.4.10";
|
||||
export const COMBINED_VERSION = `${AGENT_VERSION}/${S3SI_VERSION}`;
|
||||
export const NSOAPP_VERSION = "2.7.0";
|
||||
export const WEB_VIEW_VERSION = "4.0.0-091d4283";
|
||||
export const WEB_VIEW_VERSION = "4.0.0-dae4328c";
|
||||
export enum Queries {
|
||||
HomeQuery =
|
||||
"51fc56bbf006caf37728914aa8bc0e2c86a80cf195b4d4027d6822a3623098a8",
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ export class StatInkExporter implements GameExporter {
|
|||
{ primaryGearPower, additionalGearPowers }: PlayerGear,
|
||||
): StatInkGear => {
|
||||
const primary = mapAbility(primaryGearPower);
|
||||
if (!primary) {
|
||||
if (!primary && !this.isRandom(primaryGearPower.image)) {
|
||||
throw new Error("Unknown ability: " + primaryGearPower.name);
|
||||
}
|
||||
return {
|
||||
|
|
@ -394,6 +394,8 @@ export class StatInkExporter implements GameExporter {
|
|||
inked: player.paint,
|
||||
gears: await this.mapGears(player),
|
||||
crown: player.crown ? "yes" : "no",
|
||||
crown_type: undefined,
|
||||
species: player.species === "INKLING" ? "inkling" : "octoling",
|
||||
disconnected: player.result ? "no" : "yes",
|
||||
};
|
||||
if (player.result) {
|
||||
|
|
@ -404,6 +406,13 @@ export class StatInkExporter implements GameExporter {
|
|||
result.signal = player.result.noroshiTry ?? undefined;
|
||||
result.special = player.result.special;
|
||||
}
|
||||
if (player.crown) {
|
||||
result.crown_type = "x";
|
||||
} else if (player.festDragonCert === "DRAGON") {
|
||||
result.crown_type = "100x";
|
||||
} else if (player.festDragonCert === "DOUBLE_DRAGON") {
|
||||
result.crown_type = "333x";
|
||||
}
|
||||
return result;
|
||||
};
|
||||
async mapBattle(
|
||||
|
|
@ -621,16 +630,18 @@ export class StatInkExporter implements GameExporter {
|
|||
}
|
||||
isRandom(image: Image | null): boolean {
|
||||
// question mark
|
||||
const RANDOM_FILENAME =
|
||||
"473fffb2442075078d8bb7125744905abdeae651b6a5b7453ae295582e45f7d1";
|
||||
const RANDOM_FILENAME = [
|
||||
"473fffb2442075078d8bb7125744905abdeae651b6a5b7453ae295582e45f7d1",
|
||||
"dc937b59892604f5a86ac96936cd7ff09e25f18ae6b758e8014a24c7fa039e91",
|
||||
];
|
||||
// file exporter will replace url to { pathname: string } | string
|
||||
const url = image?.url as ReturnType<typeof urlSimplify> | undefined | null;
|
||||
if (typeof url === "string") {
|
||||
return url.includes(RANDOM_FILENAME);
|
||||
return RANDOM_FILENAME.some((i) => url.includes(i));
|
||||
} else if (url === undefined || url === null) {
|
||||
return false;
|
||||
} else {
|
||||
return url.pathname.includes(RANDOM_FILENAME);
|
||||
return RANDOM_FILENAME.some((i) => url.pathname.includes(i));
|
||||
}
|
||||
}
|
||||
async mapCoopWeapon(
|
||||
|
|
@ -700,6 +711,7 @@ export class StatInkExporter implements GameExporter {
|
|||
rescued: rescuedCount,
|
||||
defeat_boss: defeatEnemyCount,
|
||||
disconnected: disconnected ? "yes" : "no",
|
||||
species: player.species === "INKLING" ? "inkling" : "octoling",
|
||||
};
|
||||
}
|
||||
mapKing(id?: string) {
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ export type VsPlayer = {
|
|||
} | null;
|
||||
paint: number;
|
||||
crown: boolean;
|
||||
festDragonCert: "NONE" | "DRAGON" | "DOUBLE_DRAGON";
|
||||
|
||||
headGear: PlayerGear;
|
||||
clothingGear: PlayerGear;
|
||||
|
|
@ -279,6 +280,8 @@ export type CoopHistoryPlayerResult = {
|
|||
name: string;
|
||||
id: string;
|
||||
};
|
||||
isMyself: boolean;
|
||||
species: "INKLING" | "OCTOLING";
|
||||
};
|
||||
weapons: { name: string; image: Image | null }[];
|
||||
specialWeapon: null | {
|
||||
|
|
@ -650,7 +653,7 @@ export type StatInkWeapon = {
|
|||
}[];
|
||||
|
||||
export type StatInkGear = {
|
||||
primary_ability: string;
|
||||
primary_ability: string | null;
|
||||
secondary_abilities: (string | null)[];
|
||||
};
|
||||
|
||||
|
|
@ -676,7 +679,9 @@ export type StatInkPlayer = {
|
|||
special?: number;
|
||||
gears?: StatInkGears;
|
||||
crown?: "yes" | "no";
|
||||
crown_type?: "x" | "100x" | "333x";
|
||||
disconnected: "yes" | "no";
|
||||
species: "inkling" | "octoling";
|
||||
};
|
||||
|
||||
export type StatInkStage = {
|
||||
|
|
@ -726,6 +731,7 @@ export type StatInkCoopPlayer = {
|
|||
rescued: number;
|
||||
defeat_boss: number;
|
||||
disconnected: "yes" | "no";
|
||||
species: "inkling" | "octoling";
|
||||
};
|
||||
|
||||
export type StatInkCoopBoss = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue