generated from nhcarrigan/template
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.
This commit is contained in:
@@ -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_ACHIEVEMENTS } from "./achievements.js";
|
||||||
import { DEFAULT_ADVENTURERS } from "./adventurers.js";
|
import { DEFAULT_ADVENTURERS } from "./adventurers.js";
|
||||||
import { DEFAULT_BOSSES } from "./bosses.js";
|
import { DEFAULT_BOSSES } from "./bosses.js";
|
||||||
@@ -14,6 +14,21 @@ export const INITIAL_PRESTIGE: PrestigeData = {
|
|||||||
purchasedUpgradeIds: [],
|
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 => ({
|
export const INITIAL_GAME_STATE = (player: Player, characterName: string): GameState => ({
|
||||||
player: {
|
player: {
|
||||||
...player,
|
...player,
|
||||||
@@ -37,4 +52,6 @@ export const INITIAL_GAME_STATE = (player: Player, characterName: string): GameS
|
|||||||
zones: structuredClone(DEFAULT_ZONES),
|
zones: structuredClone(DEFAULT_ZONES),
|
||||||
baseClickPower: 1,
|
baseClickPower: 1,
|
||||||
lastTickAt: Date.now(),
|
lastTickAt: Date.now(),
|
||||||
|
transcendence: { ...INITIAL_TRANSCENDENCE },
|
||||||
|
apotheosis: { ...INITIAL_APOTHEOSIS },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user