65 lines
2.4 KiB
TypeScript
65 lines
2.4 KiB
TypeScript
import type { CharacterAppearance, ClassId, GenderId, RaceId, RomClassId } from "./characterCatalog";
|
|
import type { ContentCategoryId } from "./contentCategories";
|
|
import type { InventoryItem } from "../game/lootTypes";
|
|
import type { EquipmentAssignments } from "../game/equipment";
|
|
import type { GameplaySettings } from "../game/combatStore";
|
|
import type { ManastormProgress } from "../game/manastormProgress";
|
|
import type { DungeonRunCheckpoint } from "../game/dungeonRunCheckpoint";
|
|
|
|
export type ShellPhase = "login" | "characters" | "create-character" | "main-menu" | "class-hall" | "dungeons" | "manastorms" | "arenas" | "arena-game" | "gm-admin" | "game";
|
|
export type SessionKind = "account" | "offline";
|
|
export type AccountRole = "gm";
|
|
|
|
export interface PlayerSession {
|
|
kind: SessionKind;
|
|
ownerId: string;
|
|
displayName: string;
|
|
roles?: readonly AccountRole[];
|
|
/** Present for server-backed accounts; kept in session storage only. */
|
|
accessToken?: string;
|
|
}
|
|
|
|
export interface CharacterProfile {
|
|
id: string;
|
|
ownerId: string;
|
|
name: string;
|
|
raceId: RaceId;
|
|
classId: ClassId;
|
|
/** Stable specialization registry ID. Normalized profiles always include it; optional for legacy callers. */
|
|
specializationId?: string | null;
|
|
/** Always present after repository normalization; optional for v1 callers. */
|
|
categoryId?: ContentCategoryId;
|
|
/** RoM's inactive class. The active primary remains `classId`. */
|
|
secondaryClassId?: RomClassId | null;
|
|
gender: GenderId;
|
|
appearance: CharacterAppearance;
|
|
level: number;
|
|
experience: number;
|
|
talentRanks: Record<string, number>;
|
|
actionBindings: Record<string, string | null>;
|
|
/** Bindings keyed by ordered `primary:secondary` class pair. */
|
|
actionLoadouts?: Record<string, Record<string, string | null>>;
|
|
inventory: InventoryItem[];
|
|
equipment: EquipmentAssignments;
|
|
/** Present on normalized and newly created profiles; optional for legacy callers. */
|
|
manastormProgress?: ManastormProgress;
|
|
/** Safe resume point only; active combat, timers, and temporary waves are never persisted. */
|
|
dungeonRunCheckpoint?: DungeonRunCheckpoint | null;
|
|
settings?: Partial<GameplaySettings>;
|
|
location: string;
|
|
createdAt: number;
|
|
lastPlayedAt: number;
|
|
}
|
|
|
|
export interface CharacterDraft {
|
|
name: string;
|
|
categoryId: ContentCategoryId;
|
|
raceId: RaceId;
|
|
classId: ClassId;
|
|
specializationId: string | null;
|
|
gender: GenderId;
|
|
appearance: CharacterAppearance;
|
|
rotation: number;
|
|
step: "identity" | "appearance";
|
|
}
|