generated from nhcarrigan/template
feat: vampire mode chunk 3 - sync/sanitize and initial state
Add initialVampireState() and vampireSpread validation to mirror the goddess mode pattern. Also lint-fix pre-existing style issues across all Chunk 2 vampire data and type files.
This commit is contained in:
@@ -20,9 +20,18 @@ import { defaultGoddessZones } from "./goddessZones.js";
|
||||
import { defaultQuests } from "./quests.js";
|
||||
import { currentSchemaVersion } from "./schemaVersion.js";
|
||||
import { defaultUpgrades } from "./upgrades.js";
|
||||
import { defaultVampireAchievements } from "./vampireAchievements.js";
|
||||
import { defaultVampireBosses } from "./vampireBosses.js";
|
||||
import { defaultVampireEquipment } from "./vampireEquipment.js";
|
||||
import { defaultVampireExplorationAreas } from "./vampireExplorations.js";
|
||||
import { defaultVampireQuests } from "./vampireQuests.js";
|
||||
import { defaultVampireThralls } from "./vampireThralls.js";
|
||||
import { defaultVampireUpgrades } from "./vampireUpgrades.js";
|
||||
import { defaultVampireZones } from "./vampireZones.js";
|
||||
import { defaultZones } from "./zones.js";
|
||||
import type {
|
||||
ApotheosisData,
|
||||
AwakeningData,
|
||||
ConsecrationData,
|
||||
EnlightenmentData,
|
||||
ExplorationState,
|
||||
@@ -30,7 +39,9 @@ import type {
|
||||
GoddessState,
|
||||
Player,
|
||||
PrestigeData,
|
||||
SiringData,
|
||||
TranscendenceData,
|
||||
VampireState,
|
||||
} from "@elysium/types";
|
||||
|
||||
const initialPrestige: PrestigeData = {
|
||||
@@ -91,6 +102,24 @@ const initialEnlightenment: EnlightenmentData = {
|
||||
stardustPrayersMultiplier: 1,
|
||||
};
|
||||
|
||||
const initialSiring: SiringData = {
|
||||
count: 0,
|
||||
ichor: 0,
|
||||
productionMultiplier: 1,
|
||||
purchasedUpgradeIds: [],
|
||||
};
|
||||
|
||||
const initialAwakening: AwakeningData = {
|
||||
count: 0,
|
||||
purchasedUpgradeIds: [],
|
||||
soulShards: 0,
|
||||
soulShardsBloodMultiplier: 1,
|
||||
soulShardsCombatMultiplier: 1,
|
||||
soulShardsMetaMultiplier: 1,
|
||||
soulShardsSiringIchorMultiplier: 1,
|
||||
soulShardsSiringThresholdMultiplier: 1,
|
||||
};
|
||||
|
||||
/**
|
||||
* Builds a fresh initial goddess state for a player who has just completed their
|
||||
* first Apotheosis. All goddess content is locked until progressed through the realm.
|
||||
@@ -132,6 +161,48 @@ const initialGoddessState = (): GoddessState => {
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Builds a fresh initial vampire state for a player who has just achieved their
|
||||
* first Eternal Sovereignty. All vampire content is locked until progressed through the realm.
|
||||
* @returns A clean VampireState with all default data.
|
||||
*/
|
||||
const initialVampireState = (): VampireState => {
|
||||
return {
|
||||
achievements: structuredClone(defaultVampireAchievements),
|
||||
awakening: { ...initialAwakening },
|
||||
baseClickPower: 1,
|
||||
bosses: structuredClone(defaultVampireBosses),
|
||||
equipment: structuredClone(defaultVampireEquipment),
|
||||
eternalSovereignty: { count: 0 },
|
||||
exploration: {
|
||||
areas: defaultVampireExplorationAreas.map((area) => {
|
||||
return {
|
||||
id: area.id,
|
||||
status:
|
||||
area.zoneId === "vampire_haunted_catacombs"
|
||||
? ("available" as const)
|
||||
: ("locked" as const),
|
||||
};
|
||||
}),
|
||||
craftedBloodMultiplier: 1,
|
||||
craftedCombatMultiplier: 1,
|
||||
craftedIchorMultiplier: 1,
|
||||
craftedRecipeIds: [],
|
||||
materials: [],
|
||||
},
|
||||
lastTickAt: Date.now(),
|
||||
lifetimeBloodEarned: 0,
|
||||
lifetimeBossesDefeated: 0,
|
||||
lifetimeQuestsCompleted: 0,
|
||||
quests: structuredClone(defaultVampireQuests),
|
||||
siring: { ...initialSiring },
|
||||
thralls: structuredClone(defaultVampireThralls),
|
||||
totalBloodEarned: 0,
|
||||
upgrades: structuredClone(defaultVampireUpgrades),
|
||||
zones: structuredClone(defaultVampireZones),
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Builds an initial game state for a new player.
|
||||
* @param player - The player data from Discord OAuth.
|
||||
@@ -175,4 +246,9 @@ const initialGameState = (
|
||||
};
|
||||
};
|
||||
|
||||
export { initialExploration, initialGameState, initialGoddessState };
|
||||
export {
|
||||
initialExploration,
|
||||
initialGameState,
|
||||
initialGoddessState,
|
||||
initialVampireState,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user