From 2aa6362ad636012d541a6fafa4b003e8dc91ed0b Mon Sep 17 00:00:00 2001 From: Hikari Date: Sat, 7 Mar 2026 02:57:59 -0800 Subject: [PATCH] fix: always initialise transcendence and apotheosis in game state Adds INITIAL_TRANSCENDENCE and INITIAL_APOTHEOSIS constants and includes both in INITIAL_GAME_STATE so every save document contains these fields from the very first write, rather than only appearing post-transcendence or post-apotheosis. --- apps/api/src/data/initialState.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/api/src/data/initialState.ts b/apps/api/src/data/initialState.ts index 73fa901..003e6be 100644 --- a/apps/api/src/data/initialState.ts +++ b/apps/api/src/data/initialState.ts @@ -1,4 +1,4 @@ -import type { GameState, Player, PrestigeData } from "@elysium/types"; +import type { ApotheosisData, GameState, Player, PrestigeData, TranscendenceData } from "@elysium/types"; import { DEFAULT_ACHIEVEMENTS } from "./achievements.js"; import { DEFAULT_ADVENTURERS } from "./adventurers.js"; import { DEFAULT_BOSSES } from "./bosses.js"; @@ -14,6 +14,21 @@ export const INITIAL_PRESTIGE: PrestigeData = { purchasedUpgradeIds: [], }; +export const INITIAL_TRANSCENDENCE: TranscendenceData = { + count: 0, + echoes: 0, + purchasedUpgradeIds: [], + echoIncomeMultiplier: 1, + echoCombatMultiplier: 1, + echoPrestigeThresholdMultiplier: 1, + echoPrestigeRunestoneMultiplier: 1, + echoMetaMultiplier: 1, +}; + +export const INITIAL_APOTHEOSIS: ApotheosisData = { + count: 0, +}; + export const INITIAL_GAME_STATE = (player: Player, characterName: string): GameState => ({ player: { ...player, @@ -37,4 +52,6 @@ export const INITIAL_GAME_STATE = (player: Player, characterName: string): GameS zones: structuredClone(DEFAULT_ZONES), baseClickPower: 1, lastTickAt: Date.now(), + transcendence: { ...INITIAL_TRANSCENDENCE }, + apotheosis: { ...INITIAL_APOTHEOSIS }, });