✨Feature: implement loot resolution system with gold and item tracking from defeated creatures
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user