Release Healer Man 0.1.6
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import type { OnlineSessionPlayer } from "../app/onlineSessionTypes";
|
||||
import {
|
||||
configureOnlineSessionRuntime,
|
||||
drainOnlineInteractions,
|
||||
onlinePlayerActorId,
|
||||
onlinePlayerRuntimeActor,
|
||||
onlineSessionIsActive,
|
||||
onlineSessionOwnsWorldSimulation,
|
||||
onlineSynchronizedMobTransform,
|
||||
requestOnlineInteraction,
|
||||
} from "./onlineSessionRuntime";
|
||||
|
||||
const remotePlayer: OnlineSessionPlayer = {
|
||||
accountId: "remote",
|
||||
username: "Remote",
|
||||
character: {
|
||||
id: "remote-character",
|
||||
name: "Mendara",
|
||||
classId: "priest",
|
||||
categoryId: "wow",
|
||||
raceId: "human",
|
||||
gender: "female",
|
||||
level: 20,
|
||||
},
|
||||
role: "healer",
|
||||
position: [4, 0, 6],
|
||||
yaw: 1,
|
||||
grounded: true,
|
||||
health: 800,
|
||||
maxHealth: 1_000,
|
||||
resource: 400,
|
||||
maxResource: 500,
|
||||
resourceName: "Mana",
|
||||
selectedTargetId: null,
|
||||
activeCast: null,
|
||||
animationEvent: null,
|
||||
equipment: [],
|
||||
updatedAt: 1,
|
||||
};
|
||||
|
||||
afterEach(() => configureOnlineSessionRuntime({
|
||||
active: false,
|
||||
authority: true,
|
||||
localAccountId: null,
|
||||
}));
|
||||
|
||||
describe("online session runtime", () => {
|
||||
it("exposes remote players as live combat actors", () => {
|
||||
configureOnlineSessionRuntime({
|
||||
active: true,
|
||||
authority: true,
|
||||
localAccountId: "local",
|
||||
players: [remotePlayer],
|
||||
});
|
||||
const actor = onlinePlayerRuntimeActor(onlinePlayerActorId("remote"));
|
||||
expect(actor).toMatchObject({ health: 800, maxHealth: 1_000, alive: true, kind: "companion" });
|
||||
expect(onlineSessionIsActive()).toBe(true);
|
||||
expect(onlineSessionOwnsWorldSimulation()).toBe(true);
|
||||
});
|
||||
|
||||
it("uses leader transforms and queues follower interactions", () => {
|
||||
configureOnlineSessionRuntime({
|
||||
active: true,
|
||||
authority: false,
|
||||
localAccountId: "local",
|
||||
players: [remotePlayer],
|
||||
mobTransforms: { boss: { position: [7, 0, 9], yaw: 0.75 } },
|
||||
});
|
||||
expect(onlineSessionOwnsWorldSimulation()).toBe(false);
|
||||
expect(onlineSynchronizedMobTransform("boss")?.position).toEqual([7, 0, 9]);
|
||||
expect(requestOnlineInteraction("loot", "boss")).toBe(true);
|
||||
expect(drainOnlineInteractions()).toEqual([
|
||||
expect.objectContaining({ kind: "loot", targetActorId: "boss", sourceActorId: onlinePlayerActorId("local") }),
|
||||
]);
|
||||
expect(drainOnlineInteractions()).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user