Update 3D game 2026-07-10 21:20

This commit is contained in:
Warren H
2026-07-10 21:20:17 -04:00
parent 141ec64963
commit e0be0458aa
720 changed files with 366857 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
import { describe, expect, it } from "vitest";
import { createClassInventory } from "./healers";
import { useGameStore } from "./store";
import type { BossId } from "./types";
interface BattleResult {
phase: ReturnType<typeof useGameStore.getState>["phase"];
time: number;
damageBySource: ReturnType<typeof useGameStore.getState>["partyCombat"]["combatants"];
}
function simulateControlledBattle(bossIds: readonly [BossId, BossId], maxSeconds = 200): BattleResult {
useGameStore.getState().configureHealer("priest", "Aelia", createClassInventory("priest"), bossIds);
useGameStore.getState().startEncounter();
while (useGameStore.getState().phase === "combat" && useGameStore.getState().time < maxSeconds) {
useGameStore.setState((state) => ({
party: state.party.map((member) => ({ ...member, hp: member.maxHp, absorb: 10_000 })),
}));
useGameStore.getState().tick(0.1);
}
const state = useGameStore.getState();
return { phase: state.phase, time: state.time, damageBySource: state.partyCombat.combatants };
}
describe("full-mechanics dual-boss battle simulations", () => {
const combinations: readonly (readonly [BossId, BossId])[] = [
["bulldrome", "vexa"],
["bulldrome", "cindermaw"],
["vexa", "cindermaw"],
];
it.each(combinations)("party rotations defeat %s + %s", (first, second) => {
const result = simulateControlledBattle([first, second]);
expect(result.phase).toBe("victory");
expect(result.time).toBeGreaterThan(70);
expect(result.time).toBeLessThan(110);
for (const memberId of ["brann", "nia", "orin", "vale"] as const) expect(result.damageBySource[memberId].damageDone).toBeGreaterThan(0);
});
});