generated from nhcarrigan/template
7f43dc725e
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.
255 lines
8.4 KiB
TypeScript
255 lines
8.4 KiB
TypeScript
/**
|
|
* @file Initial game state data.
|
|
* @copyright nhcarrigan
|
|
* @license Naomi's Public License
|
|
* @author Naomi Carrigan
|
|
*/
|
|
import { defaultAchievements } from "./achievements.js";
|
|
import { defaultAdventurers } from "./adventurers.js";
|
|
import { defaultBosses } from "./bosses.js";
|
|
import { defaultEquipment } from "./equipment.js";
|
|
import { defaultExplorations } from "./explorations.js";
|
|
import { defaultGoddessAchievements } from "./goddessAchievements.js";
|
|
import { defaultGoddessBosses } from "./goddessBosses.js";
|
|
import { defaultGoddessDisciples } from "./goddessDisciples.js";
|
|
import { defaultGoddessEquipment } from "./goddessEquipment.js";
|
|
import { defaultGoddessExplorationAreas } from "./goddessExplorations.js";
|
|
import { defaultGoddessQuests } from "./goddessQuests.js";
|
|
import { defaultGoddessUpgrades } from "./goddessUpgrades.js";
|
|
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,
|
|
GameState,
|
|
GoddessState,
|
|
Player,
|
|
PrestigeData,
|
|
SiringData,
|
|
TranscendenceData,
|
|
VampireState,
|
|
} from "@elysium/types";
|
|
|
|
const initialPrestige: PrestigeData = {
|
|
count: 0,
|
|
productionMultiplier: 1,
|
|
purchasedUpgradeIds: [],
|
|
runestones: 0,
|
|
};
|
|
|
|
const initialTranscendence: TranscendenceData = {
|
|
count: 0,
|
|
echoCombatMultiplier: 1,
|
|
echoIncomeMultiplier: 1,
|
|
echoMetaMultiplier: 1,
|
|
echoPrestigeRunestoneMultiplier: 1,
|
|
echoPrestigeThresholdMultiplier: 1,
|
|
echoes: 0,
|
|
purchasedUpgradeIds: [],
|
|
};
|
|
|
|
const initialApotheosis: ApotheosisData = {
|
|
count: 0,
|
|
};
|
|
|
|
const initialExploration: ExplorationState = {
|
|
areas: defaultExplorations.map((area) => {
|
|
return {
|
|
id: area.id,
|
|
status:
|
|
area.zoneId === "verdant_vale"
|
|
? ("available" as const)
|
|
: ("locked" as const),
|
|
};
|
|
}),
|
|
craftedClickMultiplier: 1,
|
|
craftedCombatMultiplier: 1,
|
|
craftedEssenceMultiplier: 1,
|
|
craftedGoldMultiplier: 1,
|
|
craftedRecipeIds: [],
|
|
materials: [],
|
|
};
|
|
|
|
const initialConsecration: ConsecrationData = {
|
|
count: 0,
|
|
divinity: 0,
|
|
productionMultiplier: 1,
|
|
purchasedUpgradeIds: [],
|
|
};
|
|
|
|
const initialEnlightenment: EnlightenmentData = {
|
|
count: 0,
|
|
purchasedUpgradeIds: [],
|
|
stardust: 0,
|
|
stardustCombatMultiplier: 1,
|
|
stardustConsecrationDivinityMultiplier: 1,
|
|
stardustConsecrationThresholdMultiplier: 1,
|
|
stardustMetaMultiplier: 1,
|
|
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.
|
|
* @returns A clean GoddessState with all default data.
|
|
*/
|
|
const initialGoddessState = (): GoddessState => {
|
|
return {
|
|
achievements: structuredClone(defaultGoddessAchievements),
|
|
baseClickPower: 1,
|
|
bosses: structuredClone(defaultGoddessBosses),
|
|
consecration: { ...initialConsecration },
|
|
disciples: structuredClone(defaultGoddessDisciples),
|
|
enlightenment: { ...initialEnlightenment },
|
|
equipment: structuredClone(defaultGoddessEquipment),
|
|
exploration: {
|
|
areas: defaultGoddessExplorationAreas.map((area) => {
|
|
return {
|
|
id: area.id,
|
|
status:
|
|
area.zoneId === "goddess_celestial_garden"
|
|
? ("available" as const)
|
|
: ("locked" as const),
|
|
};
|
|
}),
|
|
craftedCombatMultiplier: 1,
|
|
craftedDivinityMultiplier: 1,
|
|
craftedPrayersMultiplier: 1,
|
|
craftedRecipeIds: [],
|
|
materials: [],
|
|
},
|
|
lastTickAt: Date.now(),
|
|
lifetimeBossesDefeated: 0,
|
|
lifetimePrayersEarned: 0,
|
|
lifetimeQuestsCompleted: 0,
|
|
quests: structuredClone(defaultGoddessQuests),
|
|
totalPrayersEarned: 0,
|
|
upgrades: structuredClone(defaultGoddessUpgrades),
|
|
zones: structuredClone(defaultGoddessZones),
|
|
};
|
|
};
|
|
|
|
/**
|
|
* 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.
|
|
* @param characterName - The character name chosen by the player.
|
|
* @returns A fresh GameState object.
|
|
*/
|
|
const initialGameState = (
|
|
player: Player,
|
|
characterName: string,
|
|
): GameState => {
|
|
return {
|
|
achievements: structuredClone(defaultAchievements),
|
|
adventurers: structuredClone(defaultAdventurers),
|
|
apotheosis: { ...initialApotheosis },
|
|
autoBoss: false,
|
|
autoQuest: false,
|
|
baseClickPower: 1,
|
|
bosses: structuredClone(defaultBosses),
|
|
companions: { activeCompanionId: null, unlockedCompanionIds: [] },
|
|
equipment: structuredClone(defaultEquipment),
|
|
exploration: structuredClone(initialExploration),
|
|
lastTickAt: Date.now(),
|
|
player: {
|
|
...player,
|
|
characterName: characterName,
|
|
totalClicks: 0,
|
|
totalGoldEarned: 0,
|
|
},
|
|
prestige: initialPrestige,
|
|
quests: structuredClone(defaultQuests),
|
|
resources: {
|
|
crystals: 0,
|
|
essence: 0,
|
|
gold: 0,
|
|
runestones: 0,
|
|
},
|
|
schemaVersion: currentSchemaVersion,
|
|
transcendence: { ...initialTranscendence },
|
|
upgrades: structuredClone(defaultUpgrades),
|
|
zones: structuredClone(defaultZones),
|
|
};
|
|
};
|
|
|
|
export {
|
|
initialExploration,
|
|
initialGameState,
|
|
initialGoddessState,
|
|
initialVampireState,
|
|
};
|