Release v0.1.3 2026-07-11

This commit is contained in:
Warren H
2026-07-11 23:23:02 -04:00
parent 076f6cf97c
commit b48b3a4f8f
103 changed files with 6708 additions and 454 deletions
+41
View File
@@ -0,0 +1,41 @@
import { describe, expect, it } from "vitest";
import { useGameStore } from "./store";
describe("runtime performance budgets", () => {
it("keeps ten minutes of dual-boss simulation bounded", () => {
const store = useGameStore.getState();
store.configureHealer("priest", "Perf", [], ["cinderback-ricochet", "sandglass-scorpion"]);
store.startEncounter();
useGameStore.setState((state) => ({
boss: { ...state.boss, hp: 1_000_000_000, maxHp: 1_000_000_000 },
additionalBosses: state.additionalBosses.map((entry) => ({
...entry,
boss: { ...entry.boss, hp: 1_000_000_000, maxHp: 1_000_000_000 },
})),
party: state.party.map((member) => ({ ...member, absorb: 1_000_000_000 })),
}));
let maxHazards = 0;
let maxDamageEvents = 0;
let maxCombatLog = 0;
const startedAt = performance.now();
for (let step = 0; step < 6_000; step += 1) {
useGameStore.getState().tick(0.1);
const state = useGameStore.getState();
const hazards = state.bossMotion.hazards.length
+ state.additionalBosses.reduce((sum, entry) => sum + entry.motion.hazards.length, 0);
maxHazards = Math.max(maxHazards, hazards);
maxDamageEvents = Math.max(maxDamageEvents, state.partyDamageEvents.length);
maxCombatLog = Math.max(maxCombatLog, state.combatLog.length);
}
const elapsedMs = performance.now() - startedAt;
const result = useGameStore.getState();
expect(result.phase).toBe("combat");
expect(result.time).toBeCloseTo(600, 5);
expect(maxHazards).toBeLessThanOrEqual(64);
expect(maxDamageEvents).toBeLessThanOrEqual(24);
expect(maxCombatLog).toBeLessThanOrEqual(12);
expect(elapsedMs).toBeLessThan(3_500);
});
});