#!/usr/bin/env node
import { Open5eClient } from './dist/open5e-client.js';
async function showCurrentDMControls() {
const client = new Open5eClient();
console.log('š® CURRENT DM INTERACTIVITY IN ENCOUNTER BUILDER\n');
try {
// Example 1: Basic generation
console.log('1ļøā£ BASIC GENERATION (minimal DM input)');
console.log(' Input: party_size=4, party_level=3, difficulty="medium"');
const basic = await client.buildRandomEncounter({
partySize: 4,
partyLevel: 3,
difficulty: 'medium'
});
console.log(` ā Generated: ${basic.name}`);
console.log(` ā ${basic.description}`);
console.log(` ā XP: ${basic.totalXP} (adjusted: ${basic.adjustedXP})`);
console.log(` ā Duration: ${basic.estimatedDuration}\n`);
// Example 2: CR constraints
console.log('2ļøā£ CHALLENGE RATING CONTROL');
console.log(' Input: + min_cr=1, max_cr=3 (only CR 1-3 monsters)');
const crConstrained = await client.buildRandomEncounter({
partySize: 4,
partyLevel: 5,
difficulty: 'hard',
minCR: 1,
maxCR: 3
});
console.log(` ā Generated: ${crConstrained.name}`);
console.log(` ā Monsters: ${crConstrained.monsters.map(m => `${m.count}x ${m.name} (CR ${m.cr})`).join(', ')}`);
console.log(` ā All monsters are CR 1-3 as requested\n`);
// Example 3: Monster count limits
console.log('3ļøā£ MONSTER COUNT CONTROL');
console.log(' Input: + max_monsters=3 (limit to 3 monsters max)');
const limitedCount = await client.buildRandomEncounter({
partySize: 4,
partyLevel: 6,
difficulty: 'deadly',
maxMonsters: 3
});
console.log(` ā Generated: ${limitedCount.name}`);
console.log(` ā Monster count: ${limitedCount.monsters.reduce((sum, m) => sum + m.count, 0)} (⤠3)`);
console.log(` ā Monsters: ${limitedCount.monsters.map(m => `${m.count}x ${m.name}`).join(', ')}\n`);
// Example 4: Multiple difficulty levels
console.log('4ļøā£ DIFFICULTY SCALING');
const difficulties = ['easy', 'medium', 'hard', 'deadly'];
for (const diff of difficulties) {
const encounter = await client.buildRandomEncounter({
partySize: 4,
partyLevel: 4,
difficulty: diff,
minCR: 1,
maxCR: 4
});
console.log(` ${diff.toUpperCase()}: ${encounter.totalXP} XP ā ${encounter.monsters.map(m => `${m.count}x ${m.name}(${m.cr})`).join(', ')}`);
}
console.log('\nš CURRENT DM CONTROL SUMMARY:');
console.log('ā
Party composition: size (1-8) and level (1-20)');
console.log('ā
Difficulty scaling: easy/medium/hard/deadly');
console.log('ā
Challenge rating bounds: min_cr and max_cr (0-30)');
console.log('ā
Monster quantity: max_monsters (1-15)');
console.log('ā
Environment theming: environment string filter');
console.log('ā
Creature types: monster_types array filter');
console.log('ā
Automatic XP balancing with official D&D 5E rules');
console.log('ā
Tactical analysis and duration estimates');
console.log('\nšÆ WHAT DMs CAN CONTROL:');
console.log('⢠Core Parameters: Who\'s fighting and how hard should it be?');
console.log('⢠Threat Level: What CR range fits the story?');
console.log('⢠Encounter Scale: Fewer strong monsters vs many weak ones?');
console.log('⢠Thematic Filtering: What creatures fit the environment/story?');
console.log('\nš ENHANCEMENT OPPORTUNITIES:');
console.log('⢠Specific monster inclusion/exclusion');
console.log('⢠Encounter role composition (tank/DPS/support)');
console.log('⢠Terrain/environmental hazards');
console.log('⢠Story context integration');
console.log('⢠Custom monster stat adjustments');
console.log('⢠Multi-wave encounter support');
} catch (error) {
console.error('Error:', error.message);
}
}
showCurrentDMControls();