summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-24 12:28:28 +0200
committerTor Andersson <tor@ccxvii.net>2024-10-24 12:28:28 +0200
commit72dfc6a21cfbb6904d671ab51da10981a4784d6f (patch)
tree0cd53d26590a469b9bb7b9ca75751656377ed646
parent04c68c2668de902246630b658c799c406f4187fa (diff)
downloadmaria-72dfc6a21cfbb6904d671ab51da10981a4784d6f.tar.gz
cancel contracts when saxony defects
-rw-r--r--rules.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 94db101..8ebf3cc 100644
--- a/rules.js
+++ b/rules.js
@@ -4328,6 +4328,10 @@ function goto_saxony_becomes_neutral() {
log_br()
log("Saxony becomes neutral!")
+ // invalidate contracts with former allies
+ map_delete(game.contracts[P_FRANCE], P_SAXONY)
+ map_delete(game.contracts[P_PRUSSIA], P_SAXONY)
+
// Return all victory markers
log(">Removed victory markers")
for (let s of all_home_country_fortresses[P_SAXONY]) {
@@ -4429,6 +4433,10 @@ function goto_saxony_becomes_austrian_ally() {
log_br()
log("Saxony becomes Austrian ally!")
+ // invalidate contracts with former allies
+ map_delete(game.contracts[P_FRANCE], P_SAXONY)
+ map_delete(game.contracts[P_PRUSSIA], P_SAXONY)
+
game.selected = SAXONY_GENERAL
if (game.pos[SAXONY_GENERAL] === ELIMINATED) {