summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-19 23:58:55 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-19 23:58:55 +0200
commit8629acc5a2471a30ae29df679268437e73ebf721 (patch)
tree193b6bb50c22e7a9cd3c7a89675c9c35b901f700
parent4bc162208ab1631a9f47fa5adbe3ecab36b2e685 (diff)
downloadplantagenet-8629acc5a2471a30ae29df679268437e73ebf721.tar.gz
Fix Culverins action generation.
-rw-r--r--rules.ts27
1 files changed, 21 insertions, 6 deletions
diff --git a/rules.ts b/rules.ts
index 69ceb30..5683b24 100644
--- a/rules.ts
+++ b/rules.ts
@@ -6133,11 +6133,26 @@ states.culverins_and_falconets = {
inactive: "Culverins and Falconets",
prompt() {
view.prompt = `Use Culverins and Falconets?`
- if (game.active === LANCASTER)
- gen_action_card(AOW_LANCASTER_CULVERINS_AND_FALCONETS)
- else
- gen_action_card(AOW_YORK_CULVERINS_AND_FALCONETS)
- view.actions.done = 1
+
+ for (let p of battle_strike_positions) {
+ let lord = game.battle.array[p]
+ if (lord !== NOBODY) {
+ if (game.active === LANCASTER) {
+ if (lord_has_capability(lord, AOW_LANCASTER_CULVERINS_AND_FALCONETS[0]))
+ gen_action_card(AOW_LANCASTER_CULVERINS_AND_FALCONETS[0])
+ if (lord_has_capability(lord, AOW_LANCASTER_CULVERINS_AND_FALCONETS[1]))
+ gen_action_card(AOW_LANCASTER_CULVERINS_AND_FALCONETS[1])
+ }
+ if (game.active === YORK) {
+ if (lord_has_capability(lord, AOW_YORK_CULVERINS_AND_FALCONETS[0]))
+ gen_action_card(AOW_YORK_CULVERINS_AND_FALCONETS[0])
+ if (lord_has_capability(lord, AOW_YORK_CULVERINS_AND_FALCONETS[1]))
+ gen_action_card(AOW_YORK_CULVERINS_AND_FALCONETS[1])
+ }
+ }
+ }
+
+ view.actions.pass = 1
},
card(c) {
let lord = find_lord_with_capability_card(c)
@@ -6162,7 +6177,7 @@ states.culverins_and_falconets = {
discard_lord_capability(lord, c)
end_culverins_and_falconets()
},
- done() {
+ pass() {
end_culverins_and_falconets()
},
}