Feature: implement loot resolution system with gold and item tracking from defeated creatures

This commit is contained in:
Keith Solomon
2026-03-15 14:24:39 -05:00
parent cf98636a52
commit 6c2257b032
10 changed files with 478 additions and 7 deletions

View File

@@ -4,6 +4,7 @@ import { lookupTable } from "@/rules/tables";
import {
findCreatureByName,
findItemById,
findRoomTemplateForLookup,
findTableByCode,
} from "./contentHelpers";
@@ -57,4 +58,11 @@ describe("level 1 content helpers", () => {
expect(creature.id).toBe("creature.level1.guard");
expect(creature.hp).toBeGreaterThan(0);
});
it("finds a loot item definition by id", () => {
const item = findItemById(sampleContentPack, "item.silver-clasp");
expect(item.name).toBe("Silver Clasp");
expect(item.itemType).toBe("treasure");
});
});