Release Healer Man 0.1.5

This commit is contained in:
phenom
2026-08-18 16:22:19 -04:00
parent f4c9cf356c
commit 55cfd43d66
62 changed files with 3030 additions and 153 deletions
+57
View File
@@ -5,7 +5,9 @@ import { useShellStore } from "../app/shellStore";
import { abilityAtLevel, resourceProfileForClass } from "../game/abilityCatalog";
import { ACTION_CONTROLS, actionBindingId } from "../game/actionBindings";
import { useCombatStore } from "../game/combatStore";
import { respawnDefeatedPlayer } from "../game/deathRespawn";
import { requireDungeonDefinition } from "../game/dungeonRegistry";
import { resurrectManastormSession } from "../game/manastormSession";
import { resolveStagePresentation } from "../game/manastormStagePresentation";
import { useManastormStore } from "../game/manastormStore";
import { usePartyStore } from "../game/partyStore";
@@ -55,6 +57,46 @@ function LoadingOverlay() {
);
}
export function DefeatedPrompt({
gameMode,
resurrectionCharges,
onReturn,
}: {
gameMode: "dungeon" | "manastorm";
resurrectionCharges: number;
onReturn: () => void;
}) {
const canReturn = gameMode === "dungeon" || resurrectionCharges > 0;
return (
<section
className="defeated-prompt"
role="dialog"
aria-modal="false"
aria-labelledby="defeated-prompt-title"
>
<div className="defeated-prompt__panel">
<p className="eyebrow">Defeated</p>
<h2 id="defeated-prompt-title">You can still be resurrected</h2>
<p>
Stay down and wait for a party member to resurrect you, or choose to return now.
</p>
{canReturn ? (
<button type="button" className="button button--primary" onClick={onReturn}>
{gameMode === "manastorm"
? `Resurrect now · ${resurrectionCharges} remaining`
: "Respawn at entrance"}
</button>
) : (
<small>No shared resurrection charges remain. A living ally must resurrect you.</small>
)}
{gameMode === "dungeon" ? (
<small>Respawning resets the current encounter and restores the party.</small>
) : null}
</div>
</section>
);
}
export function Hud() {
const character = useShellStore((state) => state.activeCharacter);
const gameMode = useGameStore((state) => state.gameMode);
@@ -71,6 +113,7 @@ export function Hud() {
const activeDungeonId = useGameStore((state) => state.activeDungeonId);
const dungeon = requireDungeonDefinition(activeDungeonId);
const encounter = useManastormStore((state) => state.currentEncounter);
const resurrectionCharges = useManastormStore((state) => state.resurrectionCharges);
const toggleMap = useGameStore((state) => state.toggleMap);
const classId = useCombatStore((state) => state.classId);
const level = useCombatStore((state) => state.level);
@@ -210,6 +253,13 @@ export function Hud() {
mapId: dungeon.mapId,
areaName,
});
const returnFromDefeat = () => {
if (gameMode === "manastorm") {
resurrectManastormSession({ kind: "player" });
return;
}
respawnDefeatedPlayer();
};
return (
<div className="hud" style={{ "--game-ui-scale": settings.uiScale } as CSSProperties}>
@@ -329,6 +379,13 @@ export function Hud() {
</div>
)}
<LoadingOverlay />
{health <= 0 ? (
<DefeatedPrompt
gameMode={gameMode}
resurrectionCharges={resurrectionCharges}
onReturn={returnFromDefeat}
/>
) : null}
</div>
);
}