Files
2025-08-03 22:35:36 -07:00

43 lines
1.7 KiB
JavaScript

import { rtsUI } from '../ui/RTSUIController.js';
import { sendTurn } from '../src/LLMAdapter.js';
import GameStateManager from '../src/GameStateManager.js';
async function runNarrativeTest() {
console.log('--- Starting RTS Narrative Test ---');
// Ensure the UI is ready
if (!rtsUI.isActive()) {
await rtsUI.enterFullscreen();
}
// A sequence of commands to simulate gameplay
const testCommands = [
"Look around the main gate.",
"I hear something from the primate house, I'll move there.",
"The monkeys are acting strange. I'll check the savannah exhibit.",
"The lions are roaring. I'm going to the reptile house, it should be quiet there.",
"A snake is loose! I'm running to the aviary.",
"The birds are in a panic. I'll try the aquatic center.",
"This is bad. I need to get out of here."
];
for (const cmd of testCommands) {
console.log(`%cExecuting command: "${cmd}"`, 'color: #0ea5e9; font-weight: bold;');
// Add a small delay to make the test sequence easier to follow
await new Promise(resolve => setTimeout(resolve, 2000));
await sendTurn(cmd);
const state = GameStateManager.getState();
console.log(`%cTurn ${state.turn}: Zone - ${state.currentZone}, Threat - ${state.threatLevel}`, 'color: #f59e0b;');
console.log(`%cLast Event: ${state.lastEvent}`, 'color: #8b5cf6;');
console.log('-----------------------------------');
}
console.log('--- RTS Narrative Test Complete ---');
}
// To run the test, open the browser's developer console and type:
// runNarrativeTest();
window.runNarrativeTest = runNarrativeTest;