diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-28 15:41:19 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | 92286c44ed183f5fb603caa453d168772aeaba05 (patch) | |
tree | 4ce449cb555d0cc284148b8ab30dd53d17e32a33 | |
parent | 45a09488443ebf4a839a195f2f1edb4406d54fe6 (diff) | |
download | friedrich-92286c44ed183f5fb603caa453d168772aeaba05.tar.gz |
WIP one-line movement paths
-rw-r--r-- | rules.js | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -349,6 +349,11 @@ function log_selected() { log(game.selected.map(p => "P" + p).join(" and ")) } +function log_selected_move_path() { + log(game.selected.map(p => "P" + p).join(" and ")) + log(">" + game.move_path.map(s => "S" + s).join(" \u2192 ")) +} + /* OBJECTIVES */ const all_objectives = [] @@ -1363,6 +1368,7 @@ states.movement = { else game.major = 0 + game.move_path = [ here ] if (is_supply_train(p)) game.state = "move_supply_train" else @@ -1526,7 +1532,7 @@ function move_general_to(to) { } } - log(">to S" + to) + game.move_path.push(to) // eliminate supply train for (let p of all_enemy_trains[pow]) { @@ -1605,12 +1611,7 @@ states.move_supply_train = { let who = game.selected[0] let from = game.pos[who] - if (game.count === 0) { - log_selected() - log(">from S" + from) - } - - log(">to S" + to) + game.move_path.push(to) if (!set_has(data.cities.major_roads[from], to)) game.major = 0 @@ -1726,11 +1727,6 @@ states.move_general = { let who = game.selected[0] let from = game.pos[who] - if (game.count === 0) { - log_selected() - log(">from S" + from) - } - if (!set_has(data.cities.major_roads[from], to)) game.major = 0 @@ -1780,6 +1776,9 @@ states.move_give = { } function end_move_piece() { + log_selected_move_path() + + delete game.move_path game.selected = null game.state = "movement" } |