diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-24 15:42:15 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-03-24 15:42:15 -0400 |
commit | 207250e175faf0914293407e170f426b46df9b05 (patch) | |
tree | fb6efc8d374c0e9b87dd2033f1bc7a82d51bb866 | |
parent | 9667b7b1c311f6ffba5e2d6ef4fbe34a11099ec6 (diff) | |
download | vijayanagara-207250e175faf0914293407e170f426b46df9b05.tar.gz |
Fix compel
-rw-r--r-- | events.txt | 2 | ||||
-rw-r--r-- | rules.js | 28 |
2 files changed, 22 insertions, 8 deletions
@@ -170,7 +170,7 @@ EVENT 9 current VE prompt "Compel in a Province adjacent to Warangal that you do not control and then Build there." add_influence VE - space 1 (is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current)) + space 1 (is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current) && can_compel_in_space(s)) free_compel mark_space endspace @@ -499,20 +499,23 @@ function goto_cavalry(n, next) { } function end_cavalry() { + if (game.vm && is_succession()) + pop_summary() + else if (game.vm) + upop_summary() + else if (game.decree && game.decree.type === "Compel") + pop_summary() + else + upop_summary() + if (game.vm) { - if (is_succession()) - pop_summary() - else - upop_summary() vm_next() } else if (game.cav.next) { - upop_summary() if (game.cav.next === "end_card") end_card() else game.state = game.cav.next } else { - upop_summary() goto_eligible() } } @@ -2296,6 +2299,8 @@ states.compel_space = { } else if (game.inf[VE] < 2) { view.prompt = "Compel: Done." view.actions.end_compel = 1 + } else { + view.prompt = "Compel: Exercice your influence over other kingdoms." } if (game.inf[VE] >= 2 && game.decree.count < 2) { @@ -2306,6 +2311,7 @@ states.compel_space = { }, piece(p) { + push_undo() set_add(game.decree.pieces, p) if (piece_space(p) === AVAILABLE) log_summary_place(p) @@ -2329,6 +2335,11 @@ states.compel_space_influencial = { gen_piece_in_space(game.decree.where, DS, TROOPS) gen_piece_in_space(game.decree.where, DS, ELITE) gen_piece_in_space(game.decree.where, BK, ELITE) + + if (count_faction_units(game.decree.where, DS) + count_faction_units(game.decree.where, BK) === 0) { + view.prompt = "Compel: No enemy unit in the selected Province" + view.actions.skip = 1 + } }, piece(p) { logi("Removed " + piece_name(p) + " from S" + piece_space(p)) @@ -2340,6 +2351,9 @@ states.compel_space_influencial = { to_rebel(r) goto_cavalry(1, end_decree) + }, + skip() { + goto_cavalry(1, end_decree) } } @@ -5888,7 +5902,7 @@ CODE[9 * 2 + 0] = [ [ vm_current, VE ], [ vm_prompt, "Compel in a Province adjacent to Warangal that you do not control and then Build there." ], [ vm_add_influence, VE ], - [ vm_space, true, 1, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current)) ], + [ vm_space, true, 1, 1, (s)=>(is_adjacent_to_city(C_WARANGAL, s) && !is_faction_control(s, game.current) && can_compel_in_space(s)) ], [ vm_free_compel ], [ vm_mark_space ], [ vm_endspace ], |