✨Feature: add creature lookup functionality and combat state management
This commit is contained in:
@@ -2,7 +2,11 @@ import { describe, expect, it } from "vitest";
|
||||
|
||||
import { lookupTable } from "@/rules/tables";
|
||||
|
||||
import { findRoomTemplateForLookup, findTableByCode } from "./contentHelpers";
|
||||
import {
|
||||
findCreatureByName,
|
||||
findRoomTemplateForLookup,
|
||||
findTableByCode,
|
||||
} from "./contentHelpers";
|
||||
import { sampleContentPack } from "./sampleContentPack";
|
||||
|
||||
function createSequenceRoller(values: number[]) {
|
||||
@@ -46,4 +50,11 @@ describe("level 1 content helpers", () => {
|
||||
expect(roomTemplate.title).toBe("Slate Shrine");
|
||||
expect(roomTemplate.roomClass).toBe("large");
|
||||
});
|
||||
|
||||
it("finds a creature definition by display name", () => {
|
||||
const creature = findCreatureByName(sampleContentPack, "Guard");
|
||||
|
||||
expect(creature.id).toBe("creature.level1.guard");
|
||||
expect(creature.hp).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user