summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-15 12:50:36 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit7d019c80c7051b8a37d7bf9eb4b376b83a3ed8c3 (patch)
tree372419aaff80cfa5ea42e2702c895fb8a9c984a9 /rules.js
parent65dff0c518948bf6d552b92f01901320d40ba448 (diff)
downloadnevsky-7d019c80c7051b8a37d7bf9eb4b376b83a3ed8c3.tar.gz
Red locale highlight for laden march.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js32
1 files changed, 19 insertions, 13 deletions
diff --git a/rules.js b/rules.js
index 21a79b3..3855b1a 100644
--- a/rules.js
+++ b/rules.js
@@ -2228,7 +2228,7 @@ states.actions = {
else {
if (game.active === TEUTONS) {
- if (game.count === 0 && is_located_with_legate() && !has_flag(FLAG_LEGATE))
+ if (game.count === 0 && is_located_with_legate(game.who) && !has_flag(FLAG_LEGATE))
view.actions.use_legate = 1
}
@@ -2255,6 +2255,7 @@ states.actions = {
push_undo()
log(`Used Legate for +1 Command.`)
set_flag(FLAG_LEGATE)
+ set_delete(game.group, LEGATE)
game.call_to_arms.legate = LEGATE_ARRIVED
},
pass() {
@@ -2376,22 +2377,23 @@ states.march_laden = {
let prov = count_group_assets(PROV)
let loot = count_group_assets(LOOT)
- view.prompt = `March with ${loot} loot, ${prov} prov, and ${transport} usable transport.`
+ view.prompt = `March with ${loot} loot, ${prov} provender, and ${transport} transport.`
view.group = game.group
if (prov <= transport * 2) {
if (loot > 0 || prov > transport) {
let avail = get_available_actions()
- if (avail >= 2)
- view.actions.laden = 1
- view.actions.unladen = 0
+ if (avail >= 2) {
+ view.prompt += " Laden!"
+ gen_action_laden_march(to)
+ } else {
+ view.prompt += " Laden with 1 action left."
+ }
} else {
- view.actions.laden = 0
- view.actions.unladen = 1
+ gen_action_locale(to)
}
} else {
- view.actions.laden = 0
- view.actions.unladen = 0
+ view.prompt += " Carrying too much."
}
if (loot > 0 || prov > transport) {
@@ -2418,10 +2420,10 @@ states.march_laden = {
push_undo()
drop_loot(lord)
},
- laden() {
+ laden_march(to) {
march_with_group_2(true)
},
- unladen() {
+ locale(to) {
march_with_group_2(false)
},
}
@@ -2677,11 +2679,11 @@ function drop_loot(lord) {
function count_lord_ships(lord) {
let ships = get_lord_assets(lord, SHIP)
- if (lord_has_capability(AOW_TEUTONIC_COGS)) {
+ if (lord_has_capability(lord, AOW_TEUTONIC_COGS)) {
ships *= 2
}
- if (lord_has_capability(AOW_RUSSIAN_LODYA)) {
+ if (lord_has_capability(lord, AOW_RUSSIAN_LODYA)) {
// TODO: one option or the other (only matters for supply)
let boats = get_lord_assets(lord, BOAT)
if (boats > 2)
@@ -3323,6 +3325,10 @@ function gen_action_locale(locale) {
gen_action("locale", locale)
}
+function gen_action_laden_march(locale) {
+ gen_action("laden_march", locale)
+}
+
function gen_action_lord(lord) {
gen_action("lord", lord)
}