summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-11-27 23:34:18 +0100
committerTor Andersson <tor@ccxvii.net>2024-11-27 23:35:09 +0100
commitd501f674513c32aa63a31336beabacde1ea3fb58 (patch)
tree741862e0a9340185f6856da6449c328ddbb5fc20 /rules.js
parent06d86b6262f087a6be7edc0903bf000f29ad9828 (diff)
downloadmaria-d501f674513c32aa63a31336beabacde1ea3fb58.tar.gz
Log Italy, Silesia, and Emperor VP changes.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js27
1 files changed, 25 insertions, 2 deletions
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