Release Healer Man 0.1.14

This commit is contained in:
phenom committed 2026-09-05 11:40:50 -04:00
1 parent 67d7a8ebe7
commit 7b41b102fa
147 files changed
+169892 -1342

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
import { describe, expect, it } from "vitest";
import { enemyTelegraphContainsPosition } from "./enemyTelegraphGeometry";
const placement = {
sourcePosition: [0, 0, 0] as const,
targetPosition: [0, 0, 10] as const,
sourceYaw: 0,
};
describe("enemy telegraph gameplay geometry", () => {
it("matches source and target anchored circles", () => {
expect(enemyTelegraphContainsPosition({
shape: "circle", anchor: "source", warningMs: 1_000, radius: 4,
}, placement, [3, 0, 0])).toBe(true);
expect(enemyTelegraphContainsPosition({
shape: "circle", anchor: "target", warningMs: 1_000, radius: 3,
}, placement, [0, 0, 8])).toBe(true);
expect(enemyTelegraphContainsPosition({
shape: "circle", anchor: "target", warningMs: 1_000, radius: 3,
}, placement, [0, 0, 4])).toBe(false);
});
it("keeps cone hits in front and within the visible angle", () => {
const cone = {
shape: "cone" as const,
anchor: "source" as const,
warningMs: 1_000,
length: 10,
angleDegrees: 90,
};
expect(enemyTelegraphContainsPosition(cone, placement, [2, 0, 7])).toBe(true);
expect(enemyTelegraphContainsPosition(cone, placement, [8, 0, 2])).toBe(false);
expect(enemyTelegraphContainsPosition(cone, placement, [0, 0, -2])).toBe(false);
});
it("uses the visible line width for collision", () => {
const line = {
shape: "line" as const,
anchor: "source" as const,
warningMs: 1_000,
length: 12,
width: 4,
};
expect(enemyTelegraphContainsPosition(line, placement, [1.9, 0, 8])).toBe(true);
expect(enemyTelegraphContainsPosition(line, placement, [2.1, 0, 8])).toBe(false);
});
});