summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-04-03 20:02:31 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-04-03 20:02:31 -0400
commit62714e7fdb4568b0d4b19dde7bafa34610071f72 (patch)
treee9ca9d88f8db9011c649e035817e9cf97de34425 /rules.js
parent4f88e1cec98483939b7017714f9d5caf55484283 (diff)
downloadvijayanagara-62714e7fdb4568b0d4b19dde7bafa34610071f72.tar.gz
Clearer return units influence
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 6a23968..b42b88a 100644
--- a/rules.js
+++ b/rules.js
@@ -1512,6 +1512,7 @@ function goto_attack_resolution() {
}
function attack_influence_shift() {
+ // TODO: Must be linked to pieces removed, not hits scored.
let up = null, down = null
if (game.cmd.a_hit > game.cmd.d_hit) {
up = game.cmd.attacker
@@ -3036,7 +3037,7 @@ function gen_place_piece(faction, type) {
function move_all_faction_piece_from(faction, type, from, to) {
for_each_piece(faction, type, p => {
if (piece_space(p) === from)
- set_piece_space(p, to)
+ place_piece(p, to)
})
}
@@ -3360,15 +3361,16 @@ function goto_return_troops(faction, n_troops, s) {
game.inf_shift.s = s
game.inf_shift.save_current = game.current
game.current = faction
+ clear_undo()
game.state = "return_troops"
}
states.return_troops = {
- inactive: "Returning Troops",
+ inactive: `Returning Units to the Influence track.`,
prompt() {
if (game.inf_shift.n > 0) {
- view.prompt = "Deccan Influence dwindles: Return Troops to the Influence track."
+ view.prompt = `Deccan Influence dwindles: Return ${game.inf_shift.n} ${PIECE_FACTION_TYPE_NAME[game.current][ELITE]}${game.inf_shift.n > 1 ? "s" : ""} to the Influence track.`
for_each_piece(game.current, ELITE, p => {
if (piece_space(p) >= 0 && piece_space(p) <= S_PUNJAB)
gen_action_piece(p)
@@ -3381,7 +3383,9 @@ states.return_troops = {
},
piece(p) {
+ push_undo()
log_summary_move_from(p)
+ to_obedient(p)
place_piece(p, game.inf_shift.s)
game.inf_shift.n -= 1
},