summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-02-09 10:29:47 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:40 +0100
commit01b99a18db90d77eaa5ce539dc1786d1710a80fc (patch)
treefb43a88eb66a099711fbac03b65ccb1c6e8b5e9f
parentbb57b1d7b510faca80a5a95493f992010b909d11 (diff)
downloadnevsky-01b99a18db90d77eaa5ce539dc1786d1710a80fc.tar.gz
Save and restore siege markers for Ambush.
In case a besieging force abandons the siege, it should be restored when they are Ambushed.
-rw-r--r--rules.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index e3e5ee1..59c76ef 100644
--- a/rules.js
+++ b/rules.js
@@ -4995,6 +4995,7 @@ states.avoid_battle = {
game.march.ambush_lords = []
game.march.ambush_assets = game.pieces.assets.slice()
game.march.ambush_besieged = game.pieces.besieged
+ game.march.ambush_sieges = game.pieces.sieges.slice()
}
}
@@ -5212,6 +5213,7 @@ states.march_ambush = {
// Restore assets and spoils and withdrawn lords
game.pieces.assets = game.march.ambush_assets
game.pieces.besieged = game.march.ambush_besieged
+ game.pieces.sieges = game.march.ambush_sieges
game.spoils = 0
// Restore lords who avoided battle
@@ -5224,12 +5226,14 @@ states.march_ambush = {
game.march.ambush_lords = 0
game.march.ambush_assets = 0
game.march.ambush_besieged = 0
+ game.march.ambush_sieges = 0
goto_march_withdraw()
},
pass() {
game.march.ambush_lords = 0
game.march.ambush_assets = 0
game.march.ambush_besieged = 0
+ game.march.ambush_sieges = 0
goto_spoils_after_avoid_battle()
},
}