diff options
author | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-21 09:39:59 -0400 |
---|---|---|
committer | Joël Simoneau <simoneaujoel@gmail.com> | 2025-04-21 10:20:03 -0400 |
commit | 65bd69a07b092a67918251035e07e0d0a9c336de (patch) | |
tree | b699db17fb175f27f7a1a1b6164af03978819d98 | |
parent | 9803f79ed8776723dc7ac98108bc66879f921d23 (diff) | |
download | vijayanagara-65bd69a07b092a67918251035e07e0d0a9c336de.tar.gz |
Clean dice and logs
-rw-r--r-- | rules.js | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1464,7 +1464,10 @@ function can_use_cavalry_on_d(d) { if (game.dice[d] <= 1) return false - if (game.current === game.cmd.target && game.dice[d] === 6 && d < 4) + if (game.current === game.cmd.target && d < 4 && game.dice[d] === 6) + return false + + if (game.current === game.cmd.target && d < 4 && game.dice[d] > game.cmd.n_units[0]) return false return true @@ -1505,11 +1508,14 @@ function goto_attack_casualties() { } function remove_mi_casualties(s) { + push_summary() while ((game.cmd.count > 0) && (count_pieces(s, MI, TROOPS) > 0)) { let p = find_piece(s, MI, TROOPS) + log_summary_remove(p) remove_piece(p) game.cmd.count -= 1 } + upop_summary() } states.attack_casualties = { @@ -1519,7 +1525,7 @@ states.attack_casualties = { game.cmd.count > 0 && game.cmd.selected.filter(p => piece_faction(p) === game.current).length > 0 ) { - view.prompt = `Attack: Remove ${game.cmd.count} pieces as casualties.` + view.prompt = `Attack: Remove ${game.cmd.count} piece${game.cmd.count > 1 ? "s" : ""} as casualties.` for (let p of game.cmd.selected) if (piece_faction(p) === game.current) |