Update Healer Man server

This commit is contained in:
phenom committed 2026-09-23 16:14:19 -04:00
1 parent f90ba7d989
commit 189b94d6b7
51 files changed
+3448 -154

No files matched your search

+20
View File
@@ -5,6 +5,7 @@ import { installDungeonShellRuntime } from "./dungeonShellRuntime";
import { installManastormShellRuntime } from "./manastormShellRuntime";
import { SHELVED_MODES_ENABLED } from "./releaseFeatures";
import { DUNGEON_MANIFEST } from "../game/dungeonManifest";
import { dungeonById } from "../game/dungeonCatalog";
import { useGameStore } from "../game/store";
import { useManastormStore } from "../game/manastormStore";
import { createEmptyManastormProgress, recordManastormCheckpoint } from "../game/manastormProgress";
@@ -94,6 +95,7 @@ describe("shell store", () => {
selectedCharacterId: null,
activeCharacter: null,
activeDungeonRole: "healer",
dungeonSelectionId: null,
notice: "",
});
useGameStore.getState().resetAtEntrance();
@@ -135,6 +137,24 @@ describe("shell store", () => {
expect(useGameStore.getState().distanceTravelled).toBe(42);
});
it("opens random full and authored Bite-Sized dungeons in the existing selector", () => {
prepareSelectedCharacter();
useShellStore.getState().openMainMenu();
expect(useShellStore.getState().openDungeons("random")).toBe(true);
const fullDungeon = dungeonById(useShellStore.getState().dungeonSelectionId ?? "");
expect(fullDungeon?.available).toBe(true);
expect(["wow", "rom"]).toContain(fullDungeon?.category);
useShellStore.getState().returnToMainMenu();
expect(useShellStore.getState().openDungeons("random-bite-sized")).toBe(true);
expect(useShellStore.getState().dungeonSelectionId).toBe("bite-sized-stormwind-stockade");
useShellStore.getState().returnToMainMenu();
expect(useShellStore.getState().openDungeons()).toBe(true);
expect(useShellStore.getState().dungeonSelectionId).toBeNull();
});
it("mounts the game and resets it only after choosing the available dungeon", () => {
prepareSelectedCharacter();
useShellStore.getState().openMainMenu();
+16 -3
View File
@@ -38,6 +38,7 @@ import {
import type { ContentCategoryId } from "./contentCategories";
import type { CharacterDraft, CharacterProfile, PlayerSession, ShellPhase } from "./types";
import type { DungeonId } from "../game/dungeonRegistry";
import { randomDungeonByCategory, randomRegularDungeon } from "../game/dungeonCatalog";
import { DEFAULT_DUNGEON_ID } from "../game/dungeonDefaults";
import type { InventoryItem } from "../game/lootTypes";
import { emptyBossCardCollection, type BossCardCollection } from "../game/bossCards";
@@ -77,6 +78,7 @@ export interface ShellState {
draft: CharacterDraft;
notice: string;
activeDungeonId: DungeonId;
dungeonSelectionId: DungeonId | null;
activeDungeonRole: PartyRole;
combatPresentationSettings: CombatPresentationSettings;
beginSession: (session: PlayerSession) => void;
@@ -90,7 +92,7 @@ export interface ShellState {
createDraftCharacter: () => boolean;
deleteSelectedCharacter: () => void;
openMainMenu: () => boolean;
openDungeons: () => boolean;
openDungeons: (selection?: "random" | "random-bite-sized") => boolean;
openManastorms: () => boolean;
openArenas: () => boolean;
openGmAdmin: () => boolean;
@@ -166,6 +168,7 @@ const restored = restoredState();
export const useShellStore = create<ShellState>((set, get) => ({
...restored,
activeDungeonId: DEFAULT_DUNGEON_ID,
dungeonSelectionId: null,
activeDungeonRole: "healer",
activeCharacter: null,
draft: defaultDraft(),
@@ -319,7 +322,7 @@ export const useShellStore = create<ShellState>((set, get) => ({
set({ phase: "main-menu", activeCharacter: null, notice: "" });
return true;
},
openDungeons: () => {
openDungeons: (selection) => {
const { session, selectedCharacterId, characters } = get();
if (!session || !selectedCharacterId || !characters.some((character) => character.id === selectedCharacterId)) {
set({ phase: session ? "characters" : "login", notice: "Select or create a character first." });
@@ -330,7 +333,17 @@ export const useShellStore = create<ShellState>((set, get) => ({
set({ phase: "class-hall", activeCharacter: null, notice: "Choose a specialization before entering activities." });
return false;
}
set({ phase: "dungeons", activeCharacter: null, notice: "" });
const dungeon = selection === "random" ? randomRegularDungeon()
: selection === "random-bite-sized" ? randomDungeonByCategory("bite-sized")
: null;
if (selection && !dungeon) {
set({ notice: selection === "random"
? "No regular dungeon is ready to enter."
: "No regular Bite-Sized dungeon is ready to enter." });
return false;
}
set({ phase: "dungeons", activeCharacter: null, dungeonSelectionId: dungeon?.id ?? null,
notice: dungeon ? `Randomly selected ${dungeon.title}.` : "" });
return true;
},
openManastorms: () => {