Release Healer Man 0.1.58

This commit is contained in:
phenom committed 2026-09-20 16:46:17 -04:00
1 parent 14e105642c
commit 246b4832b0
38 files changed
+952 -93

No files matched your search

+7 -2
View File
@@ -30,7 +30,9 @@ interface OnlineGroupState {
leave: (session: PlayerSession) => Promise<boolean>;
remove: (session: PlayerSession, accountId: string) => Promise<boolean>;
updateMember: (session: PlayerSession, character: CharacterProfile, role: PartyRole) => Promise<boolean>;
startActivity: (session: PlayerSession, input: Omit<StartOnlineGroupActivityInput, "fillWithAi">) => Promise<boolean>;
startActivity: (session: PlayerSession, input: Omit<StartOnlineGroupActivityInput, "fillWithAi"> & {
readonly fillWithAi?: boolean;
}) => Promise<boolean>;
clearActivity: (session: PlayerSession) => Promise<boolean>;
setFillWithAi: (fillWithAi: boolean) => void;
consumeActivity: (activityId: string) => void;
@@ -127,7 +129,10 @@ export const useOnlineGroupStore = create<OnlineGroupState>((set, get) => ({
startActivity: async (session, input) => {
set({ busy: true, error: "" });
try {
const snapshot = await startOnlineGroupActivity(session, { ...input, fillWithAi: get().fillWithAi });
const snapshot = await startOnlineGroupActivity(session, {
...input,
fillWithAi: input.fillWithAi ?? get().fillWithAi,
});
set({ snapshot, busy: false });
return true;
} catch (error) {
+2
View File
@@ -29,6 +29,8 @@ export interface OnlineGroupActivity {
readonly contentId: string;
readonly fillWithAi: boolean;
readonly includeBetaSpecs?: boolean;
readonly companionReadinessRevision?: number;
readonly companionSpecializationIds?: readonly string[];
readonly partySize: number;
readonly startingLevel: number | null;
readonly startedAt: number;
+81
View File
@@ -0,0 +1,81 @@
import { create } from "zustand";
import { requestOnlineJson } from "./onlineAccountClient";
import type { PlayerSession } from "./types";
import type { RandomizedBiteSizedCreature, RandomizedCreatureKind } from "../game/dungeons/randomizedBiteSizedStockades";
export const CREATURE_READINESS_STATUSES = ["ready", "needs-testing", "not-ready"] as const;
export type CreatureReadinessStatus = (typeof CREATURE_READINESS_STATUSES)[number];
export const CREATURE_READINESS_LABELS: Readonly<Record<CreatureReadinessStatus, string>> = {
ready: "Ready",
"needs-testing": "Needs Tested",
"not-ready": "Not Ready",
};
export interface RandomizedCreatureReview {
readonly creatureKey: string;
readonly dungeonId: string;
readonly creatureName: string;
readonly creatureKind: RandomizedCreatureKind;
readonly status: CreatureReadinessStatus;
readonly reviewedBy: string;
readonly reviewedAt: number;
}
interface RandomizedCreatureReadinessState {
readonly reviews: Readonly<Record<string, RandomizedCreatureReview>>;
readonly loading: boolean;
readonly error: string;
refresh: () => Promise<void>;
save: (
session: PlayerSession,
creature: RandomizedBiteSizedCreature,
status: CreatureReadinessStatus,
) => Promise<boolean>;
}
export const useRandomizedCreatureReadiness = create<RandomizedCreatureReadinessState>((set, get) => ({
reviews: {},
loading: false,
error: "",
refresh: async () => {
set({ loading: true, error: "" });
try {
const payload = await requestOnlineJson<{ reviews: RandomizedCreatureReview[] }>(
"/api/randomized-creature-readiness",
);
set({ reviews: Object.fromEntries(payload.reviews.map((review) => [review.creatureKey, review])) });
} catch (error) {
set({ error: error instanceof Error ? error.message : "Unable to load creature readiness." });
} finally {
set({ loading: false });
}
},
save: async (session, creature, status) => {
if (session.kind !== "account" || !session.accessToken) return false;
set({ loading: true, error: "" });
try {
const payload = await requestOnlineJson<{ review: RandomizedCreatureReview }>(
"/api/gm/randomized-creature-readiness",
{
method: "PUT",
body: JSON.stringify({
creatureKey: creature.key,
dungeonId: "randomized-bite-sized-stormwind-stockade",
creatureName: creature.name,
creatureKind: creature.kind,
status,
}),
},
session.accessToken,
);
set({ reviews: { ...get().reviews, [payload.review.creatureKey]: payload.review } });
return true;
} catch (error) {
set({ error: error instanceof Error ? error.message : "Unable to save creature readiness." });
return false;
} finally {
set({ loading: false });
}
},
}));