diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-09 17:34:25 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-09 17:34:25 -0400 |
commit | 96fb8439e60b07105d6e6f9bbc5a73d438a41d41 (patch) | |
tree | 9cfea218fc537c6a8dbeddc16a909c9c7ccab6dd /rules.js | |
parent | d8147052938607a450986064b662c42d28a37442 (diff) | |
download | vijayanagara-96fb8439e60b07105d6e6f9bbc5a73d438a41d41.tar.gz |
Event 29.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 49 |
1 files changed, 46 insertions, 3 deletions
@@ -4636,6 +4636,40 @@ states.event_25 = { } } +// VM: SHADED_29 + +function vm_shaded_29() { + push_summary() + game.cmd = { count: 3 } + game.state = "shaded_29" +} + +states.shaded_29 = { + prompt() { + if (game.cmd.count > 0) { + event_prompt(`Spend Resources to gain Cavalry token (${game.cmd.count} left).`) + gen_take_cavalry(game.current) + } else { + event_prompt("No more Cavalry token to acquire.") + } + + view.actions.next = 1 + }, + token(c) { + game.cmd.count -= 1 + add_resources(game.current, -1) + log_summary_cavalry(c) + set_cavalry_faction(c, game.current) + }, + next() { + if (game.cmd.count < 3) { + log(`${faction_name[game.current]} spent ${3-game.cmd.count} Resources.`) + upop_summary() + } + vm_next() + } +} + // === CONST === @@ -5448,13 +5482,22 @@ CODE[28 * 2 + 1] = [ // EVENT 29 CODE[29 * 2 + 0] = [ - [ vm_log, "NOT IMPLEMENTED" ], + [ vm_current, BK ], + [ vm_gain_cavalry, 3 ], + [ vm_prompt, "Execute a free Limited Attack." ], + [ vm_space, true, 1, 1, (s)=>(can_attack_in_space(s)) ], + [ vm_free_attack ], + [ vm_endspace ], [ vm_return ], ] // SHADED 29 CODE[29 * 2 + 1] = [ - [ vm_log, "NOT IMPLEMENTED" ], + [ vm_shaded_29 ], + [ vm_prompt, "Execute a free Limited Attack." ], + [ vm_space, true, 1, 1, (s)=>(can_attack_in_space(s)) ], + [ vm_free_attack ], + [ vm_endspace ], [ vm_return ], ] @@ -5473,7 +5516,7 @@ CODE[30 * 2 + 1] = [ // EVENT 31 CODE[31 * 2 + 0] = [ [ vm_current, REBEL_FACTIONS ], - [ vm_prompt, "Free Migrate in a Province adjacent to Vijayanagara" ], + [ vm_prompt, "Free Migrate in a Province adjacent to Vijayanagara." ], [ vm_space, true, 1, 1, (s)=>(is_adjacent_to_city(C_VIJAYANAGARA, s)) ], [ vm_mark_space ], [ vm_free_migrate ], |