Remove duplicate code

This commit is contained in:
2026-10-13 11:57:43 -03:00
parent dfc6a6d77b
commit 5165698fe3
50 changed files with 307 additions and 812 deletions
+2 -5
View File
@@ -5,10 +5,7 @@
import { assertEquals } from "@std/assert";
import { ATTRIBUTES } from "$/server/game/entity/attributes.ts";
import { PLAYER_MENU_EXTRA } from "$/common/protocol.ts";
import { test_game } from "./helpers.ts";
// deno-lint-ignore no-explicit-any
type Msg = any;
import { container_items, test_game } from "./helpers.ts";
async function setup() {
const t = await test_game("mods");
@@ -39,7 +36,7 @@ Deno.test("the power glove and feral claws go in the hands slot, and only work w
Deno.test("worn artifacts work again after rejoining, and say what they do", async () => {
const t = await setup();
t.send(1, { type: "click", menu: 0, slot: 0, button: 0, shift: true });
const worn = t.take(1).findLast((m: Msg) => m.type === "container" && m.container === "extra").items;
const worn = container_items(t.take(1), "extra");
assertEquals(worn[t.hands - PLAYER_MENU_EXTRA].lore, "When worn:\n+4 Attack Damage");
t.game.on_disconnect(1);