Jester stomp sounds, not step !

This commit is contained in:
2026-11-22 11:08:36 -03:00
parent 8add5f852e
commit dfb110e0f8
11 changed files with 50 additions and 12 deletions
+14
View File
@@ -303,6 +303,20 @@ Deno.test("a clip plays from when its state started, and with walking as strongl
assertAlmostEquals(animation.pose(15)!.get("arm")!.rotation[0], 22.5);
});
Deno.test("an animator's step_sound picks each step's sound, and one without it keeps the entity's own", () => {
const { type } = animator_type("stomper", (entity) => ({
pose() {},
step_sound: () => entity.get_client_data<boolean>("angry") ? "test:stomp" : undefined,
}));
const entity = animated(type);
const animation = animation_for(entity)!;
assertEquals(animation.step_sound("test:own"), undefined);
entity.data = { client_data: { angry: true } };
assertEquals(animation.step_sound("test:own"), "test:stomp");
const { type: quiet } = animator_type("quiet", () => ({ pose() {} }));
assertEquals(animation_for(animated(quiet))!.step_sound("test:own"), "test:own");
});
Deno.test("an animator that throws is removed, and the entity is posed without it", async () => {
const { type } = animator_type("thrower", () => ({
pose(pose) {