44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { BOSS_HAZARD_VFX, bossHazardVfxProfile, bossHazardVfxSeed } from "./bossHazardVisuals";
|
|
import type { CircleHazardKind } from "./types";
|
|
|
|
const HAZARD_KINDS: readonly CircleHazardKind[] = [
|
|
"venom_pool",
|
|
"skyfall",
|
|
"quake",
|
|
"lava_pool",
|
|
"stinger_eruption",
|
|
"hourglass",
|
|
"tidal_burst",
|
|
"soul_rift",
|
|
"crownfall",
|
|
"royal_shockwave",
|
|
];
|
|
|
|
describe("boss hazard visuals", () => {
|
|
it("defines a bounded effect profile for every circular hazard kind", () => {
|
|
expect(Object.keys(BOSS_HAZARD_VFX).sort()).toEqual([...HAZARD_KINDS].sort());
|
|
for (const kind of HAZARD_KINDS) {
|
|
const profile = bossHazardVfxProfile(kind);
|
|
expect(profile.particleCount).toBeGreaterThanOrEqual(6);
|
|
expect(profile.particleCount).toBeLessThanOrEqual(9);
|
|
expect(profile.height).toBeGreaterThan(0);
|
|
expect(profile.warningColor).not.toBe(profile.highlightColor);
|
|
}
|
|
});
|
|
|
|
it("uses shape and motion, not color alone, to distinguish common attacks", () => {
|
|
expect(bossHazardVfxProfile("venom_pool")).toMatchObject({ motion: "bubble", shape: "orb" });
|
|
expect(bossHazardVfxProfile("stinger_eruption")).toMatchObject({ motion: "spike", shape: "spike" });
|
|
expect(bossHazardVfxProfile("royal_shockwave")).toMatchObject({ motion: "shockwave", shape: "crystal" });
|
|
expect(bossHazardVfxProfile("soul_rift")).toMatchObject({ motion: "orbit", shape: "orb" });
|
|
});
|
|
|
|
it("creates stable normalized seeds without runtime randomness", () => {
|
|
expect(bossHazardVfxSeed("meteor-12")).toBe(bossHazardVfxSeed("meteor-12"));
|
|
expect(bossHazardVfxSeed("meteor-12")).not.toBe(bossHazardVfxSeed("meteor-13"));
|
|
expect(bossHazardVfxSeed("meteor-12")).toBeGreaterThanOrEqual(0);
|
|
expect(bossHazardVfxSeed("meteor-12")).toBeLessThanOrEqual(1);
|
|
});
|
|
});
|