Add choice-based events with a resolution modal

Standard/kaos events can now present 2 options instead of a fixed
effect, pausing new event triggers until the player answers. Adds
4 choice events as a first batch; resources keep accruing while a
choice is pending.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Fredrik Johansson
2026-07-12 23:17:48 +02:00
parent 0efbe9d55b
commit b9561b05a5
5 changed files with 189 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import './style.css';
import { createState, tick, buyUpgrade, visitLocation, saveState, loadState, clearSave } from './engine.ts';
import { createState, tick, buyUpgrade, visitLocation, resolveEventChoice, saveState, loadState, clearSave } from './engine.ts';
import { initUI, renderState } from './ui.ts';
import { initMap, updateMap } from './map.ts';
@@ -22,7 +22,8 @@ function start(): void {
visitCooldowns = new Map();
document.getElementById('overlay')!.classList.remove('visible');
renderState(state);
}
},
(index) => { state = resolveEventChoice(state, index); renderState(state); saveState(state); }
);
initMap('map', (locationId) => {