Refactor platform UI and data flow across core pages
All checks were successful
Build Org Website / build (push) Successful in 50s
All checks were successful
Build Org Website / build (push) Successful in 50s
This commit is contained in:
24
tests/princess-lima-systems.test.cjs
Normal file → Executable file
24
tests/princess-lima-systems.test.cjs
Normal file → Executable file
@@ -16,6 +16,30 @@ test("movement is responsive and diagonal speed is normalized", () => {
|
||||
assert.deepEqual(velocity, { x: 0, y: 0 });
|
||||
});
|
||||
|
||||
test("directional attacks separate wind-up, active hit and recovery timing", () => {
|
||||
assert.equal(systems.attackPhase(0), "windup");
|
||||
assert.equal(systems.attackPhase(systems.ATTACK_TIMING.windup), "active");
|
||||
assert.equal(systems.attackPhase(systems.ATTACK_TIMING.windup + systems.ATTACK_TIMING.active), "recovery");
|
||||
assert.equal(systems.attackPhase(999), "complete");
|
||||
const origin = { x: 500, y: 400 };
|
||||
const north = systems.attackHitbox("north", origin.x, origin.y);
|
||||
const south = systems.attackHitbox("south", origin.x, origin.y);
|
||||
const east = systems.attackHitbox("east", origin.x, origin.y);
|
||||
const west = systems.attackHitbox("west", origin.x, origin.y);
|
||||
assert.ok(north.y + north.height <= origin.y);
|
||||
assert.ok(south.y >= origin.y);
|
||||
assert.ok(east.x >= origin.x);
|
||||
assert.ok(west.x + west.width <= origin.x);
|
||||
});
|
||||
|
||||
test("enemy knockback stops before walls and map boundaries", () => {
|
||||
const current = state.fresh("Ada", "azure");
|
||||
const safe = systems.wallSafeKnockback(current, "village", 430, 400, 1, 0, 60);
|
||||
assert.equal(systems.isSafePosition(current, "village", safe.x, safe.y), true);
|
||||
const edge = systems.wallSafeKnockback(current, "village", 50, 400, -1, 0, 90);
|
||||
assert.equal(systems.isSafePosition(current, "village", edge.x, edge.y), true);
|
||||
});
|
||||
|
||||
test("all named spawns are collision-safe and invalid positions recover", () => {
|
||||
const current = state.fresh("Ada", "azure");
|
||||
Object.entries(data.MAPS).forEach(([regionId, map]) => {
|
||||
|
||||
Reference in New Issue
Block a user