summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteisuru <31881306+teisuru@users.noreply.github.com>2023-06-08 10:57:00 +0200
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commit03c653faf5e414613137cd5d898a7ded2b85bd1f (patch)
treea301ea9f31568a307d6e24ed6c44c12ff45158dd
parent5bfef2a980347458b76a55c234423e77f107281d (diff)
downloadplantagenet-03c653faf5e414613137cd5d898a7ded2b85bd1f.tar.gz
Fixed player order after plan
-rw-r--r--rules.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index d4c9fdf..03e570c 100644
--- a/rules.js
+++ b/rules.js
@@ -439,6 +439,8 @@ const last_york_lord = 13
const first_lancaster_lord = 14
const last_lancaster_lord = 27
+
+
let first_friendly_lord = 0
let last_friendly_lord = 13
let first_enemy_lord = 14
@@ -2318,7 +2320,7 @@ states.campaign_plan = {
}
function end_campaign_plan() {
- set_active(P1)
+ set_active(P1)
goto_command_activation()
}
@@ -2333,15 +2335,23 @@ function goto_command_activation() {
if (check_campaign_victory())
return
-
+
if (game.plan2.length > game.plan1.length) {
- set_active(P2)
+ set_active(LANCASTER)
game.command = game.plan2.shift()
- } else {
+ } else if (game.plan2.length < game.plan1.length) {
+ set_active(YORK)
+ game.command = game.plan1.shift()
+ }
+ else {
set_active(P1)
+ if (P1 === "Lancaster")
+ game.command = game.plan2.shift()
+ else
game.command = game.plan1.shift()
}
+
if (game.command === NOBODY) {
log_h2("Pass")
goto_command_activation()
@@ -2359,10 +2369,12 @@ function goto_command_activation() {
// === CAMPAIGN: ACTIONS ===
function set_active_command() {
- if (game.command >= first_york_lord && game.command <= last_york_lord)
- set_active(YORK)
+ if (game.command >= first_york_lord && game.command <= last_york_lord) {
+ set_active(YORK)
+ }
else
- set_active(LANCASTER)
+ set_active(LANCASTER)
+
}
function is_active_command() {