summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-17 10:57:45 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-17 10:57:45 +0200
commite0f870ccebb45ab3f2ab753b5d1fdf763702fa1e (patch)
tree5df8a6c1656feda64b834c1a5f9b57938c2fa55b
parent1a19cf4334cbe2eeb17fde78028b76e20d5afdd1 (diff)
downloadplantagenet-e0f870ccebb45ab3f2ab753b5d1fdf763702fa1e.tar.gz
Fix bad use of game.count in pay_lords.
-rw-r--r--rules.js23
1 files changed, 7 insertions, 16 deletions
diff --git a/rules.js b/rules.js
index 4ce2ad6..4f0059b 100644
--- a/rules.js
+++ b/rules.js
@@ -2070,6 +2070,7 @@ function goto_pay_lords() {
}
if (has_friendly_lord_who_must_pay_troops()) {
+ game.count = 0
game.who = NOBODY
game.state = "pay_lords"
} else {
@@ -2091,35 +2092,32 @@ states.pay_lords = {
prompt() {
view.prompt = "Pay Lords in Influence or Disband them."
prompt_held_event()
- let done = true
- game.count = 0
if (game.who === NOBODY) {
+ let done = true
for (let lord = first_friendly_lord; lord <= last_friendly_lord; lord++) {
if (is_lord_on_map(lord) && is_lord_unfed(lord)) {
gen_action_lord(lord)
done = false
}
}
- if (done) {
- view.actions.done = 1
- }
if (!done)
view.actions.pay_all = 1
+ if (done)
+ view.actions.done = 1
} else {
view.actions.disband = 1
view.actions.pay = 1
- } },
+ }
+ },
lord(lord) {
push_undo()
game.who = lord
},
disband() {
- push_undo()
disband_lord(game.who)
game.who = NOBODY
},
pay() {
- push_undo()
reduce_influence(is_exile(get_lord_locale(game.who)) ? 2 : 1)
set_lord_moved(game.who, 0)
game.who = NOBODY
@@ -2128,17 +2126,10 @@ states.pay_lords = {
push_undo()
for (let lord = first_friendly_lord; lord <= last_friendly_lord; lord++) {
if (is_lord_on_map(lord) && is_lord_unfed(lord)) {
- ++game.count
+ reduce_influence(is_exile(get_lord_locale(lord)) ? 2 : 1)
set_lord_moved(lord, 0)
- if (is_exile(get_lord_locale(lord))) {
- ++game.count
- }
- reduce_influence(game.count)
- game.count = 0
}
}
- game.who = NOBODY
-
},
card: action_held_event,
done() {