feat: Implement Event Deck, Monster Spawning, and AI Movement
This commit is contained in:
18
src/main.js
18
src/main.js
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user