summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-04-02 14:12:57 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-04-02 14:12:57 -0400
commit1c8a3c93b867a60a6760b7988fd537a0285b3048 (patch)
tree4c6fc56c8d56202c5728070dbcd46d92e11bca36
parentd01adec15a2b90c33b5aecf62af858732910ff51 (diff)
downloadvijayanagara-1c8a3c93b867a60a6760b7988fd537a0285b3048.tar.gz
Fuzzing summaries
-rw-r--r--events.txt3
-rw-r--r--rules.js11
2 files changed, 13 insertions, 1 deletions
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 ],