feat: Implement Event Deck, Monster Spawning, and AI Movement

This commit is contained in:
2026-01-05 00:40:12 +01:00
parent 056217437c
commit b619e4cee4
7 changed files with 421 additions and 35 deletions

View File

@@ -36,6 +36,16 @@ generator.grid.placeTile = (instance, variant, card) => {
setTimeout(() => {
renderer.renderExits(generator.availableExits);
// Check if new tile is a ROOM to trigger events
// Note: 'room_dungeon' includes standard room card types
if (card.type === 'room' || card.id.startsWith('room')) {
const eventResult = game.onRoomRevealed(cells);
if (eventResult && eventResult.count > 0) {
// Show notification?
ui.showModal('¡Emboscada!', `Al entrar en la estancia, aparecen <b>${eventResult.count} Orcos</b>!`);
}
}
}, 50);
};
@@ -51,6 +61,14 @@ game.onEntityUpdate = (entity) => {
}
};
game.turnManager.on('phase_changed', (phase) => {
if (phase === 'monster') {
setTimeout(() => {
game.playMonsterTurn();
}, 500); // Slight delay for visual impact
}
});
game.onEntityMove = (entity, path) => {
renderer.moveEntityAlongPath(entity, path);
};