From a94c34ddce93dfe175c12581cfa6523274cd5d1e Mon Sep 17 00:00:00 2001 From: Joël Simoneau Date: Wed, 2 Apr 2025 12:31:37 -0400 Subject: attak casualties log --- rules.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 9ccf11d..aa77355 100644 --- a/rules.js +++ b/rules.js @@ -1325,6 +1325,7 @@ function next_attack_cavalry_step() { log_br() log(`${faction_flags[game.cmd.attacker]} scores ${game.cmd.a_hit} hits.`) log(`${faction_flags[game.cmd.target]} scores ${game.cmd.d_hit} hits.`) + log_br() goto_attack_casualties() } } @@ -1407,6 +1408,7 @@ function get_attack_victor() { function goto_attack_casualties() { let curr + game.dice = [0, 0, 0, 0, 0, 0] if (game.cmd.step === 2) { curr = game.cmd.target game.cmd.count = game.cmd.a_hit @@ -1422,6 +1424,7 @@ function goto_attack_casualties() { } else { game.current = curr if (game.cmd.count > 0) { + push_summary() game.state = "attack_casualties" } else end_attack_casualties() @@ -1456,6 +1459,10 @@ states.attack_casualties = { }, piece(p) { push_undo() + if (piece_space(p) === game.cmd.where) + log_summary_remove(p) + else + log_summary_remove_from(p) remove_piece(p) set_delete(game.cmd.selected, p) game.cmd.count -= 1 @@ -1466,6 +1473,8 @@ states.attack_casualties = { } function end_attack_casualties() { + if (game.summary) + upop_summary() clear_undo() if (game.cmd.step === 2) { game.cmd.step += 1 @@ -1476,7 +1485,6 @@ function end_attack_casualties() { } function goto_attack_resolution() { - game.dice = [0, 0, 0, 0, 0, 0] if (is_rebel_faction(game.cmd.target) && is_rebel_faction(game.cmd.attacker)) attack_influence_shift() else if (game.cmd.attacker === MI && !is_timurid()) { -- cgit v1.2.3