Feature: add level 1 content including room templates, encounter tables, and room generation logic

- Introduced contentHelpers for table and room template lookups.
- Created level1Rooms.ts with various room templates for level 1.
- Added level1Tables.ts containing encounter tables for animals, martial, dogs, people, fungal, guards, workers, and room types.
- Implemented room generation functions in rooms.ts to create rooms based on templates and tables.
- Added tests for room generation logic in rooms.test.ts to ensure correct functionality.
This commit is contained in:
Keith Solomon
2026-03-15 12:54:46 -05:00
parent 6bf48df74c
commit 120e144b3f
10 changed files with 1263 additions and 0 deletions

View File

@@ -159,11 +159,15 @@ export const exitTemplateSchema = z.object({
export const roomTemplateSchema = z.object({
id: z.string().min(1),
level: z.number().int().positive(),
sourcePage: z.number().int().positive().optional(),
roomClass: z.enum(["normal", "small", "large", "special", "start", "stairs"]),
tableCode: z.string().min(1),
tableEntryKey: z.string().min(1),
title: z.string().min(1),
text: z.string().optional(),
encounterText: z.string().optional(),
exitHint: z.string().optional(),
unique: z.boolean().optional(),
dimensions: z
.object({
width: z.number().int().positive(),