From 1c8a3c93b867a60a6760b7988fd537a0285b3048 Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Wed, 2 Apr 2025 14:12:57 -0400 Subject: Fuzzing summaries --- events.txt | 3 +++ rules.js | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/events.txt b/events.txt index 9823ede..ec29a4a 100644 --- a/events.txt +++ b/events.txt @@ -685,6 +685,9 @@ EVENT 31 piece 1 (is_piece_in_event_space(p) && is_enemy_unit(p)) remove endpiece + endspace + prompt "Free Attack in selected Province." + space_opt 1 (s === game.vm.m[0] && can_attack_in_space(s)) free_attack endspace diff --git a/rules.js b/rules.js index bfd9c0c..89904f6 100644 --- a/rules.js +++ b/rules.js @@ -960,6 +960,8 @@ function can_select_cmd_space(cost) { function end_command() { if (game.summary && game.summary.length > 0) { pop_summary() + } else if (game.summary) { + game.summary = null } log_br() game.cmd = null @@ -3799,8 +3801,10 @@ function log_space(s, action) { } function push_summary() { - if (game.summary) + if (game.summary) { + console.log("SUMMARY ", game.summary) throw "TOO MANY SUMMARIES" + } game.summary = [] } @@ -5706,6 +5710,8 @@ states.shaded_29 = { if (game.cmd.count < 3) { log(`${faction_name[game.current]} spent ${3-game.cmd.count} Resources.`) upop_summary() + } else { + game.summary = null } vm_next() } @@ -6627,6 +6633,9 @@ CODE[31 * 2 + 0] = [ [ vm_piece, false, 1, 1, (p,s)=>(is_piece_in_event_space(p) && is_enemy_unit(p)) ], [ vm_remove ], [ vm_endpiece ], + [ vm_endspace ], + [ vm_prompt, "Free Attack in selected Province." ], + [ vm_space, true, 0, 1, (s)=>(s === game.vm.m[0] && can_attack_in_space(s)) ], [ vm_free_attack ], [ vm_endspace ], [ vm_return ], -- cgit v1.2.3