feat: vampire expansion chunk 1 — type definitions

This commit is contained in:
2026-04-14 18:42:40 -07:00
committed by Naomi Carrigan
parent 91c9f52daf
commit 9548b460f2
16 changed files with 1113 additions and 0 deletions
+59
View File
@@ -176,6 +176,65 @@ export type {
GoddessZone,
GoddessZoneStatus,
} from "./interfaces/goddessZone.js";
export type {
AwakeningData,
AwakeningUpgrade,
AwakeningUpgradeCategory,
} from "./interfaces/vampireAwakening.js";
export type {
VampireAchievement,
VampireAchievementCondition,
VampireAchievementConditionType,
VampireAchievementReward,
} from "./interfaces/vampireAchievement.js";
export type {
VampireBoss,
VampireBossStatus,
} from "./interfaces/vampireBoss.js";
export type {
VampireEquipment,
VampireEquipmentBonus,
VampireEquipmentRarity,
VampireEquipmentType,
} from "./interfaces/vampireEquipment.js";
export type {
VampireEquipmentSet,
VampireEquipmentSetBonus,
} from "./interfaces/vampireEquipmentSet.js";
export { computeVampireSetBonuses } from "./interfaces/vampireEquipmentSet.js";
export type {
VampireExplorationArea,
VampireExplorationAreaState,
VampireExplorationEvent,
VampireExplorationEventEffect,
VampireExplorationEventEffectType,
VampireExplorationMaterialDrop,
VampireExplorationState,
} from "./interfaces/vampireExploration.js";
export type {
VampireQuest,
VampireQuestReward,
VampireQuestRewardType,
VampireQuestStatus,
} from "./interfaces/vampireQuest.js";
export type {
SiringData,
SiringUpgrade,
SiringUpgradeCategory,
} from "./interfaces/vampireSiring.js";
export type { VampireState } from "./interfaces/vampireState.js";
export type {
VampireThrall,
VampireThrallClass,
} from "./interfaces/vampireThrall.js";
export type {
VampireUpgrade,
VampireUpgradeTarget,
} from "./interfaces/vampireUpgrade.js";
export type {
VampireZone,
VampireZoneStatus,
} from "./interfaces/vampireZone.js";
export type { Player } from "./interfaces/player.js";
export type { PrestigeData } from "./interfaces/prestige.js";
export type {
@@ -14,6 +14,7 @@ import type { DailyChallengeState } from "./dailyChallenge.js";
import type { Equipment } from "./equipment.js";
import type { ExplorationState } from "./exploration.js";
import type { GoddessState } from "./goddessState.js";
import type { VampireState } from "./vampireState.js";
import type { Player } from "./player.js";
import type { PrestigeData } from "./prestige.js";
import type { Quest } from "./quest.js";
@@ -100,6 +101,11 @@ interface GameState {
*/
goddess?: GoddessState;
/**
* Vampire expansion state — optional for backwards compatibility with pre-vampire saves.
*/
vampire?: VampireState;
/**
* Schema version — used to detect saves from older game versions.
*/
@@ -17,6 +17,13 @@ interface Resource {
prayers?: number;
divinity?: number;
stardust?: number;
/**
* Vampire expansion currencies — optional for backwards compatibility with pre-vampire saves.
*/
blood?: number;
ichor?: number;
soulShards?: number;
}
export type { Resource };
@@ -0,0 +1,45 @@
/**
* @file Vampire expansion Achievement types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireAchievementConditionType =
| "totalBloodEarned"
| "vampireBossesDefeated"
| "vampireQuestsCompleted"
| "thrallTotal"
| "siringCount"
| "vampireEquipmentOwned";
interface VampireAchievementCondition {
type: VampireAchievementConditionType;
amount: number;
}
interface VampireAchievementReward {
ichor?: number;
soulShards?: number;
}
interface VampireAchievement {
id: string;
name: string;
description: string;
icon: string;
condition: VampireAchievementCondition;
reward?: VampireAchievementReward;
/**
* Unix timestamp when unlocked, null if not yet unlocked.
*/
unlockedAt: number | null;
}
export type {
VampireAchievement,
VampireAchievementCondition,
VampireAchievementConditionType,
VampireAchievementReward,
};
@@ -0,0 +1,79 @@
/**
* @file Vampire expansion Awakening (transcendence) types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type AwakeningUpgradeCategory =
| "blood"
| "combat"
| "siring_threshold"
| "siring_ichor"
| "soulshards_meta";
interface AwakeningUpgrade {
id: string;
name: string;
description: string;
category: AwakeningUpgradeCategory;
/**
* Soul Shards cost to purchase.
*/
cost: number;
/**
* Multiplicative effect of this upgrade.
*/
multiplier: number;
}
interface AwakeningData {
/**
* Number of times the player has achieved The Awakening.
*/
count: number;
/**
* Soul Shards accumulated across all awakenings.
*/
soulShards: number;
/**
* IDs of soul shard upgrades purchased.
*/
purchasedUpgradeIds: Array<string>;
/**
* Pre-computed: multiplier applied to all passive blood income.
*/
soulShardsBloodMultiplier: number;
/**
* Pre-computed: multiplier applied to thrall DPS in vampire boss fights.
*/
soulShardsCombatMultiplier: number;
/**
* Pre-computed: multiplier applied to the siring blood threshold (< 1 lowers requirement).
*/
soulShardsSiringThresholdMultiplier: number;
/**
* Pre-computed: multiplier applied to ichor earned per siring.
*/
soulShardsSiringIchorMultiplier: number;
/**
* Pre-computed: multiplier applied to soul shards yield on future awakenings.
*/
soulShardsMetaMultiplier: number;
}
export type {
AwakeningData,
AwakeningUpgrade,
AwakeningUpgradeCategory,
};
@@ -0,0 +1,69 @@
/**
* @file Vampire expansion Boss types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireBossStatus = "locked" | "available" | "in_progress" | "defeated";
interface VampireBoss {
id: string;
name: string;
description: string;
status: VampireBossStatus;
maxHp: number;
currentHp: number;
/**
* Damage dealt to thralls per second whilst the fight is active.
*/
damagePerSecond: number;
/**
* Blood reward on defeat.
*/
bloodReward: number;
/**
* Ichor reward on defeat.
*/
ichorReward: number;
/**
* Soul Shards reward on defeat.
*/
soulShardsReward: number;
/**
* IDs of vampire upgrades unlocked on defeat.
*/
upgradeRewards: Array<string>;
/**
* IDs of vampire equipment items granted on defeat.
*/
equipmentRewards: Array<string>;
/**
* Minimum siring level required to access this boss.
*/
siringRequirement: number;
/**
* Vampire zone this boss belongs to.
*/
zoneId: string;
/**
* One-time ichor bounty awarded on first-ever defeat.
*/
bountyIchor: number;
/**
* Whether the first-kill ichor bounty has already been claimed.
*/
bountyIchorClaimed?: boolean;
}
export type { VampireBoss, VampireBossStatus };
@@ -0,0 +1,64 @@
/**
* @file Vampire expansion Equipment types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireEquipmentType = "fang" | "shroud" | "talisman";
type VampireEquipmentRarity = "common" | "rare" | "epic" | "legendary";
interface VampireEquipmentBonus {
/**
* Multiplier applied to all blood/s income (e.g. 1.1 = +10%).
*/
bloodMultiplier?: number;
/**
* Multiplier applied to all thrall combat power (e.g. 1.25 = +25%).
*/
combatMultiplier?: number;
/**
* Multiplier applied to ichor earned per siring (e.g. 1.5 = +50%).
*/
ichorMultiplier?: number;
}
interface VampireEquipment {
id: string;
name: string;
description: string;
type: VampireEquipmentType;
rarity: VampireEquipmentRarity;
bonus: VampireEquipmentBonus;
/**
* Whether the player has acquired this item.
*/
owned: boolean;
/**
* Whether this item is currently equipped (only one per type can be equipped).
*/
equipped: boolean;
/**
* If set, this item can be purchased directly rather than obtained via vampire boss drops.
*/
cost?: { blood: number; ichor: number; soulShards: number };
/**
* Vampire equipment set this item belongs to, if any.
*/
setId?: string;
}
export type {
VampireEquipment,
VampireEquipmentBonus,
VampireEquipmentRarity,
VampireEquipmentType,
};
@@ -0,0 +1,68 @@
/**
* @file Vampire expansion Equipment Set types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
interface VampireEquipmentSetBonus {
bloodMultiplier?: number;
combatMultiplier?: number;
ichorMultiplier?: number;
}
interface VampireEquipmentSet {
id: string;
name: string;
description: string;
/**
* Vampire equipment IDs that make up this set.
*/
pieces: Array<string>;
bonuses: {
// eslint-disable-next-line @typescript-eslint/naming-convention -- numeric keys
2: VampireEquipmentSetBonus;
// eslint-disable-next-line @typescript-eslint/naming-convention -- numeric keys
3: VampireEquipmentSetBonus;
};
}
/**
* Given a list of equipped vampire item IDs and a set catalogue, returns the
* combined multiplicative bonuses granted by all active set bonuses.
* @param equippedItemIds - The IDs of vampire items currently equipped.
* @param sets - The full catalogue of vampire equipment sets to evaluate against.
* @returns The combined blood, combat, and ichor multipliers from active set bonuses.
*/
const computeVampireSetBonuses = (
equippedItemIds: Array<string>,
sets: Array<VampireEquipmentSet>,
): {
bloodMultiplier: number;
combatMultiplier: number;
ichorMultiplier: number;
} => {
let bloodMultiplier = 1;
let combatMultiplier = 1;
let ichorMultiplier = 1;
for (const set of sets) {
const count = set.pieces.filter((id) => {
return equippedItemIds.includes(id);
}).length;
for (const threshold of [ 2, 3 ] as const) {
if (count >= threshold) {
const bonus = set.bonuses[threshold];
bloodMultiplier = bloodMultiplier * (bonus.bloodMultiplier ?? 1);
combatMultiplier = combatMultiplier * (bonus.combatMultiplier ?? 1);
ichorMultiplier = ichorMultiplier * (bonus.ichorMultiplier ?? 1);
}
}
}
return { bloodMultiplier, combatMultiplier, ichorMultiplier };
};
export type { VampireEquipmentSet, VampireEquipmentSetBonus };
export { computeVampireSetBonuses };
@@ -0,0 +1,123 @@
/**
* @file Vampire expansion Exploration types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireExplorationEventEffectType =
| "blood_gain"
| "blood_loss"
| "ichor_gain"
| "dark_material_gain"
| "thrall_loss";
interface VampireExplorationEventEffect {
type: VampireExplorationEventEffectType;
/**
* Blood amount for blood_gain / blood_loss.
*/
amount?: number;
/**
* Dark material ID for dark_material_gain.
*/
materialId?: string;
/**
* Quantity for dark_material_gain.
*/
quantity?: number;
/**
* Fraction (01) of total thralls lost for thrall_loss.
*/
fraction?: number;
}
interface VampireExplorationEvent {
id: string;
text: string;
effect: VampireExplorationEventEffect;
}
interface VampireExplorationMaterialDrop {
materialId: string;
minQuantity: number;
maxQuantity: number;
/**
* Relative probability weight — higher = more likely.
*/
weight: number;
}
interface VampireExplorationArea {
id: string;
name: string;
description: string;
zoneId: string;
durationSeconds: number;
possibleMaterials: Array<VampireExplorationMaterialDrop>;
events: Array<VampireExplorationEvent>;
}
interface VampireExplorationAreaState {
id: string;
status: "locked" | "available" | "in_progress" | "completed";
/**
* Unix timestamp when exploration started (set when status becomes in_progress).
*/
startedAt?: number;
/**
* Unix timestamp when the exploration will complete.
*/
endsAt?: number;
/**
* True after the first successful collect — used for codex unlock detection.
*/
completedOnce?: boolean;
}
interface VampireExplorationState {
areas: Array<VampireExplorationAreaState>;
/**
* Current dark material inventory.
*/
materials: Array<{ materialId: string; quantity: number }>;
/**
* IDs of vampire crafting recipes that have been crafted (resets on siring).
*/
craftedRecipeIds: Array<string>;
/**
* Pre-computed blood income multiplier from all crafted vampire recipes.
*/
craftedBloodMultiplier: number;
/**
* Pre-computed ichor income multiplier from all crafted vampire recipes.
*/
craftedIchorMultiplier: number;
/**
* Pre-computed combat power multiplier from all crafted vampire recipes.
*/
craftedCombatMultiplier: number;
}
export type {
VampireExplorationArea,
VampireExplorationAreaState,
VampireExplorationEvent,
VampireExplorationEventEffect,
VampireExplorationEventEffectType,
VampireExplorationMaterialDrop,
VampireExplorationState,
};
@@ -0,0 +1,71 @@
/**
* @file Vampire expansion Quest types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireQuestStatus = "locked" | "available" | "active" | "completed";
type VampireQuestRewardType =
| "blood"
| "ichor"
| "soulShards"
| "upgrade"
| "thrall"
| "equipment";
interface VampireQuestReward {
type: VampireQuestRewardType;
amount?: number;
/**
* ID of the vampire upgrade or thrall class to unlock (if applicable).
*/
targetId?: string;
}
interface VampireQuest {
id: string;
name: string;
description: string;
status: VampireQuestStatus;
/**
* Unix timestamp when quest was started (if active).
*/
startedAt?: number;
/**
* Duration in seconds.
*/
durationSeconds: number;
rewards: Array<VampireQuestReward>;
/**
* IDs of vampire quests that must be completed before this one unlocks.
*/
prerequisiteIds: Array<string>;
/**
* Vampire zone this quest belongs to.
*/
zoneId: string;
/**
* Minimum thrall combat power required to start this quest.
*/
combatPowerRequired?: number;
/**
* Unix timestamp of the most recent failed attempt (if any).
*/
lastFailedAt?: number;
}
export type {
VampireQuest,
VampireQuestReward,
VampireQuestRewardType,
VampireQuestStatus,
};
@@ -0,0 +1,75 @@
/**
* @file Vampire expansion Siring (prestige) types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type SiringUpgradeCategory =
| "blood"
| "thralls"
| "combat"
| "ichor"
| "utility";
interface SiringUpgrade {
id: string;
name: string;
description: string;
category: SiringUpgradeCategory;
ichorCost: number;
/**
* Multiplier applied when this upgrade is purchased.
*/
multiplier: number;
}
interface SiringData {
/**
* Number of times the player has sired (vampire prestige).
*/
count: number;
/**
* Ichor carried over between sirings.
*/
ichor: number;
/**
* Multiplier applied to all blood/s production (based on siring count).
*/
productionMultiplier: number;
/**
* IDs of siring upgrades purchased with ichor.
*/
purchasedUpgradeIds: Array<string>;
/**
* Unix timestamp of last siring.
*/
lastSiredAt?: number;
/**
* Pre-computed multiplier from "blood" ichor upgrades.
*/
ichorBloodMultiplier?: number;
/**
* Pre-computed multiplier from "thralls" ichor upgrades.
*/
ichorThrallsMultiplier?: number;
/**
* Pre-computed multiplier from "combat" ichor upgrades.
*/
ichorCombatMultiplier?: number;
}
export type {
SiringData,
SiringUpgrade,
SiringUpgradeCategory,
};
@@ -0,0 +1,82 @@
/**
* @file Vampire expansion state types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import type { AwakeningData } from "./vampireAwakening.js";
import type { VampireAchievement } from "./vampireAchievement.js";
import type { VampireBoss } from "./vampireBoss.js";
import type { VampireEquipment } from "./vampireEquipment.js";
import type { VampireExplorationState } from "./vampireExploration.js";
import type { VampireQuest } from "./vampireQuest.js";
import type { SiringData } from "./vampireSiring.js";
import type { VampireThrall } from "./vampireThrall.js";
import type { VampireUpgrade } from "./vampireUpgrade.js";
import type { VampireZone } from "./vampireZone.js";
interface VampireState {
zones: Array<VampireZone>;
bosses: Array<VampireBoss>;
quests: Array<VampireQuest>;
thralls: Array<VampireThrall>;
equipment: Array<VampireEquipment>;
upgrades: Array<VampireUpgrade>;
achievements: Array<VampireAchievement>;
siring: SiringData;
awakening: AwakeningData;
exploration: VampireExplorationState;
/**
* Total blood earned in the current siring run (resets on siring).
*/
totalBloodEarned: number;
/**
* Total blood earned across all time (never resets — used for achievements and unlock thresholds).
*/
lifetimeBloodEarned: number;
/**
* Total vampire bosses defeated across all time.
*/
lifetimeBossesDefeated: number;
/**
* Total vampire quests completed across all time.
*/
lifetimeQuestsCompleted: number;
/**
* Click power for the vampire realm (blood per hunt, before upgrades).
*/
baseClickPower: number;
/**
* Unix timestamp of the last vampire-side client tick.
*/
lastTickAt: number;
/**
* When true, the tick engine automatically starts the highest-zone available vampire quest.
*/
autoQuest?: boolean;
/**
* When true, the tick engine automatically challenges the highest available vampire boss.
*/
autoBoss?: boolean;
/**
* When true, the tick engine automatically purchases the highest-tier affordable thrall.
*/
autoThrall?: boolean;
/**
* Count of Eternal Sovereignty achievements (vampire apotheosis equivalent).
* Goddess Mode unlocks once this reaches 1.
*/
eternalSovereignty: { count: number };
}
export type { VampireState };
@@ -0,0 +1,46 @@
/**
* @file Vampire expansion Thrall types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireThrallClass =
| "fledgling"
| "revenant"
| "shade"
| "bloodbound"
| "wraith"
| "ancient";
interface VampireThrall {
id: string;
name: string;
class: VampireThrallClass;
level: number;
/**
* Base cost for the first purchase of this tier (scales by 1.15× per count).
* Paid in blood.
*/
baseCost: number;
/**
* Base blood generated per second.
*/
bloodPerSecond: number;
/**
* Base ichor generated per second.
*/
ichorPerSecond: number;
/**
* Combat power per unit — used in vampire boss battle simulation.
*/
combatPower: number;
count: number;
unlocked: boolean;
}
export type { VampireThrall, VampireThrallClass };
@@ -0,0 +1,37 @@
/**
* @file Vampire expansion Upgrade types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireUpgradeTarget =
| "blood"
| "thrall"
| "global"
| "siring"
| "boss";
interface VampireUpgrade {
id: string;
name: string;
description: string;
target: VampireUpgradeTarget;
/**
* ID of the thrall class this applies to (if target is "thrall").
*/
thrallId?: string;
/**
* Multiplier applied to the target's output.
*/
multiplier: number;
costBlood: number;
costIchor: number;
costSoulShards: number;
purchased: boolean;
unlocked: boolean;
}
export type { VampireUpgrade, VampireUpgradeTarget };
@@ -0,0 +1,28 @@
/**
* @file Vampire expansion Zone types for the Elysium game.
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
type VampireZoneStatus = "locked" | "unlocked";
interface VampireZone {
id: string;
name: string;
description: string;
emoji: string;
status: VampireZoneStatus;
/**
* Vampire boss ID whose defeat is required to unlock this zone (null for the starter zone).
*/
unlockBossId: string | null;
/**
* Vampire quest ID that must be completed to unlock this zone (null for the starter zone).
*/
unlockQuestId: string | null;
}
export type { VampireZone, VampireZoneStatus };