summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-04-02 12:31:37 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-04-02 12:31:37 -0400
commita94c34ddce93dfe175c12581cfa6523274cd5d1e (patch)
tree7f23d36f09474ac082fc303fb7279a94b7120d15
parent51896f8e458b7c75b53ec1d0bedf10a96c0401a8 (diff)
downloadvijayanagara-a94c34ddce93dfe175c12581cfa6523274cd5d1e.tar.gz
attak casualties log
-rw-r--r--rules.js10
1 files changed, 9 insertions, 1 deletions
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()) {