Update Healer Man server
This commit is contained in:
1 parent
6cc1b9217f
commit
6114a2295f
67 files changed
+6241
-347
No files matched your search
@@ -1,11 +1,45 @@
|
||||
import { existsSync, readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { Euler, Quaternion, Vector3 } from "three";
|
||||
import { CLASSES } from "../app/characterCatalog";
|
||||
import type { InventoryItem } from "../game/lootTypes";
|
||||
import { resolveRunewakerEquipment } from "./runewakerEquipment";
|
||||
import { equipmentWeaponModelRotation, equipmentWeaponSocketRotation } from "./equipmentAttachments";
|
||||
import { avatarWeaponSocketRotation } from "./starterWeapons";
|
||||
import type { AvatarManifest } from "./characterManifest";
|
||||
|
||||
describe("original RoM equipment", () => {
|
||||
it("aligns the original bow to the basic body's grip without reversing its native facing", () => {
|
||||
const native = (JSON.parse(readFileSync("public/assets/characters/runewaker-v1/manifest.json", "utf8")) as AvatarManifest).entries["rom-human:male"];
|
||||
const basic = { ...native, rendererStrategy: undefined };
|
||||
const bow = resolveRunewakerEquipment("rom-scout", []).models[0];
|
||||
expect(equipmentWeaponModelRotation(native, bow)).toEqual([0, 0, 0]);
|
||||
const axis = new Vector3(0, 1, 0)
|
||||
.applyEuler(new Euler(...equipmentWeaponModelRotation(basic, bow)))
|
||||
.applyEuler(new Euler(...equipmentWeaponSocketRotation(basic, bow)));
|
||||
expect(axis.distanceTo(new Vector3(1, 0, 0))).toBeLessThan(1e-6);
|
||||
const stringSide = new Vector3(0, 0, -1).applyEuler(new Euler(...equipmentWeaponModelRotation(basic, bow)));
|
||||
expect(stringSide.y).toBeCloseTo(1);
|
||||
for (const model of resolveRunewakerEquipment("rom-knight", []).models) {
|
||||
expect(equipmentWeaponModelRotation(native, model)).toEqual([0, 0, 0]);
|
||||
expect(equipmentWeaponModelRotation(basic, model)).toEqual([0, 0, 0]);
|
||||
}
|
||||
});
|
||||
|
||||
it("converts native props back to the basic body's socket frame when its pack is absent", () => {
|
||||
const native = (JSON.parse(readFileSync("public/assets/characters/runewaker-v1/manifest.json", "utf8")) as AvatarManifest).entries["rom-human:male"];
|
||||
const basic = { ...native, rendererStrategy: undefined };
|
||||
for (const classId of ["rom-knight", "rom-mage", "rom-scout", "rom-rogue"] as const) {
|
||||
for (const model of resolveRunewakerEquipment(classId, []).models) {
|
||||
expect(equipmentWeaponSocketRotation(native, model)).toEqual([0, 0, 0]);
|
||||
const nativeRotation = new Quaternion().setFromEuler(new Euler(...avatarWeaponSocketRotation(native, model.fallbackKind!, model.weaponStance!)));
|
||||
const fallbackRotation = new Quaternion().setFromEuler(new Euler(...equipmentWeaponSocketRotation(basic, model)));
|
||||
expect(nativeRotation.multiply(fallbackRotation).angleTo(new Quaternion())).toBeLessThan(1e-6);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("equips every RoM class with source-client props in its native socket frame", () => {
|
||||
for (const characterClass of CLASSES.filter((entry) => entry.id.startsWith("rom-"))) {
|
||||
const resolved = resolveRunewakerEquipment(characterClass.id, []);
|
||||
|
||||
Reference in new issue
Block a user