From d501f674513c32aa63a31336beabacde1ea3fb58 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 27 Nov 2024 23:34:18 +0100 Subject: Log Italy, Silesia, and Emperor VP changes. --- rules.js | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 0c70793..e0eb093 100644 --- a/rules.js +++ b/rules.js @@ -2412,7 +2412,7 @@ function resume_movement() { game.selected = -1 game.state = "movement" - // alternate on flanders map (TODO: when dispute only) + // alternate on flanders map if (is_alternating_move()) game.state = "movement_flanders_next" } @@ -5198,12 +5198,31 @@ function goto_adjust_political_tracks() { game.russia = Math.max(1, Math.min(9, game.russia)) game.italy = Math.max(1, Math.min(9, game.italy)) - // TODO: log italy vp change + let old_italy_a = !!(game.flags & F_ITALY_FRANCE) + let old_italy_f = !!(game.flags & F_ITALY_FRANCE) + if (game.italy <= 2) game.flags |= F_ITALY_FRANCE if (game.italy <= 5) game.flags &= ~F_ITALY_AUSTRIA if (game.italy >= 5) game.flags &= ~F_ITALY_FRANCE if (game.italy >= 8) game.flags |= F_ITALY_AUSTRIA + let new_italy_a = !!(game.flags & F_ITALY_FRANCE) + let new_italy_f = !!(game.flags & F_ITALY_FRANCE) + + if (old_italy_a !== new_italy_a) { + if (new_italy_a) + log("Austria gained Italy VP.") + else + log("Austria lost Italy VP.") + } + + if (old_italy_f !== new_italy_f) { + if (new_italy_f) + log("France gained Italy VP.") + else + log("France lost Italy VP.") + } + // Expeditionary corps goto_expeditionary_corps() } @@ -5908,6 +5927,7 @@ states.silesia_enter_prussian_train = { space(s) { let p = PRUSSIAN_TRAIN_2 log(">P" + p + " to S" + s) + log("Prussia gained Silesia VP.") enter_piece_at(p, s) game.state = "silesia_done" }, @@ -5915,6 +5935,7 @@ states.silesia_enter_prussian_train = { let p = PRUSSIAN_TRAIN_2 let s = ELIMINATED log(">P" + p + " to S" + s) + log("Prussia gained Silesia VP.") game.pos[p] = s next_sequence_of_play() }, @@ -6088,9 +6109,11 @@ states.imperial_election = { function end_imperial_election() { if (game.count >= 5) { log("Francis Stephen of Lorraine is Emperor.") + log("Austria gained Emperor VP.") game.flags |= F_EMPEROR_AUSTRIA } else { log("Charles Albert of Bavaria is Emperor.") + log("France gained Emperor VP.") game.flags |= F_EMPEROR_FRANCE } game.flags &= ~F_IMPERIAL_ELECTION -- cgit v1.2.3