From 0cfe618f2f71ea5ae3e337b37406b04113ac6067 Mon Sep 17 00:00:00 2001 From: imspace Date: Mon, 11 Sep 2023 18:48:17 +0800 Subject: [PATCH] feat: add species and crown_type https://github.com/fetus-hina/stat.ink/issues/1227 --- src/exporters/stat.ink.ts | 10 ++++++++++ src/types.ts | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/exporters/stat.ink.ts b/src/exporters/stat.ink.ts index de31e9c..a63baa3 100644 --- a/src/exporters/stat.ink.ts +++ b/src/exporters/stat.ink.ts @@ -393,6 +393,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) { @@ -403,6 +405,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( @@ -699,6 +708,7 @@ export class StatInkExporter implements GameExporter { rescued: rescuedCount, defeat_boss: defeatEnemyCount, disconnected: disconnected ? "yes" : "no", + species: player.species === "INKLING" ? "inkling" : "octoling", }; } mapKing(id?: string) { diff --git a/src/types.ts b/src/types.ts index ef94cdf..0fc0432 100644 --- a/src/types.ts +++ b/src/types.ts @@ -145,6 +145,7 @@ export type VsPlayer = { } | null; paint: number; crown: boolean; + festDragonCert: "NONE" | "DRAGON" | "DOUBLE_DRAGON"; headGear: PlayerGear; clothingGear: PlayerGear; @@ -270,6 +271,8 @@ export type CoopHistoryPlayerResult = { name: string; id: string; }; + isMyself: boolean; + species: "INKLING" | "OCTOLING"; }; weapons: { name: string; image: Image | null }[]; specialWeapon: null | {