From d4a7cc78037cb0f94b8803a7d962be93c37ed6d4 Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Fri, 21 Mar 2025 08:56:07 -0400 Subject: Fix free attack --- rules.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index ea87962..a2102ab 100644 --- a/rules.js +++ b/rules.js @@ -2900,10 +2900,8 @@ function has_unmoved_piece(space, faction) { function has_valid_attackers(s, faction) { let valid_attacker = false - console.log(game.decree) - console.log(game.cmd) for_each_movable(faction, p => { - if (piece_space(p) === s && !set_has(game.cmd.pieces, p)) + if (piece_space(p) === s && (!game.cmd || !set_has(game.cmd.pieces, p))) valid_attacker = true if (piece_space(p) === s || (has_piece(piece_space(p), faction, DISC) && SPACES[s].adjacent.includes(piece_space(p)))) if (!game.cmd.pieces || game.cmd.pieces.length === 0) @@ -6303,10 +6301,11 @@ CODE[22 * 2 + 1] = [ // EVENT 23 CODE[23 * 2 + 0] = [ [ vm_current, VE ], - [ vm_prompt, "Build and then replace a Unit with a Raja in each Province with a Temple." ], [ vm_add_influence, VE ], + [ vm_prompt, "Build and then replace a Unit with a Raja in each Province with a Temple." ], [ vm_space, true, 0, 1, (s)=>can_build_in_space(s) ], [ vm_free_build ], + [ vm_log_br ], [ vm_endspace ], [ vm_prompt, "In each Province with a Temple, replace a Unit with a Raja." ], [ vm_space, true, 0, 999, (s)=>has_temple(s) && has_units_enemy_faction(s) ], -- cgit v1.2.3