summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-12-13 11:20:03 +0100
committerTor Andersson <tor@ccxvii.net>2024-12-13 11:20:03 +0100
commit567d674893d1d5935e93ab87338dab41ae1fb415 (patch)
tree8e8f4848ed8cc9f742d033beed49f34b9c1952e7
parente333776a3177c7bdaec2deedcda79234554d8819 (diff)
downloadmaria-567d674893d1d5935e93ab87338dab41ae1fb415.tar.gz
Retroactive markers in silesia and bavaria/saxony with attacker color.
-rw-r--r--play.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/play.js b/play.js
index 9969032..836effe 100644
--- a/play.js
+++ b/play.js
@@ -1438,10 +1438,23 @@ function update_political() {
}
}
-function actual_retro_power(s, current) {
+function actual_retro_power(s, attacker) {
// conquest retroactive markers have color of new conquering power
// re-conquest retroactive markers have color of old conquest marker
- return map_get(view.victory, s, current)
+ let previous = map_get(view.victory, s, -1)
+ // no previous marker
+ if (previous < 0)
+ return attacker
+ // attacker's marker in silesia which always has a marker
+ if (set_has(data.country.Silesia, s))
+ return attacker
+ // attacker's marker when reconquering minor power fortresses
+ if (set_has(data.country.Bavaria, s))
+ return attacker
+ if (set_has(data.country.Saxony, s))
+ return attacker
+ // previous marker to be removed
+ return previous
}
function on_update() {