summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-06 23:13:09 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit17d0fdb97adc82cb87e898c8f26a47c89bfcdd8a (patch)
treea598ac609197f22923dc87a8f11e34ec09097142
parent17b149d409d151931b045213d3eb6dd36a2783f0 (diff)
downloadtable-battles-17d0fdb97adc82cb87e898c8f26a47c89bfcdd8a.tar.gz
Separate state for Rupert's Lifeguard.
-rw-r--r--rules.js28
1 files changed, 21 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index f94f0e3..c092664 100644
--- a/rules.js
+++ b/rules.js
@@ -3663,17 +3663,16 @@ function goto_routing() {
game.routed = [ 0, 0 ]
if (game.scenario === S2_MARSTON_MOOR) {
- // TODO: pause with separate state?
if (is_card_in_play(S2_RUPERTS_LIFEGUARD)) {
if (is_card_in_play(S2_NORTHERN_HORSE) && should_rout_card(S2_NORTHERN_HORSE)) {
- log("Rupert's Lifeguard added to Northern Horse.")
- move_all_sticks(S2_RUPERTS_LIFEGUARD, S2_NORTHERN_HORSE)
- remove_card(S2_RUPERTS_LIFEGUARD)
+ game.state = "s2_ruperts_lifeguard"
+ game.selected = S2_NORTHERN_HORSE
+ return
}
if (is_card_in_play(S2_BYRON) && should_rout_card(S2_BYRON)) {
- log("Rupert's Lifeguard added to Byron.")
- move_all_sticks(S2_RUPERTS_LIFEGUARD, S2_BYRON)
- remove_card(S2_RUPERTS_LIFEGUARD)
+ game.state = "s2_ruperts_lifeguard"
+ game.selected = S2_BYRON
+ return
}
}
}
@@ -3681,6 +3680,21 @@ function goto_routing() {
resume_routing()
}
+states.s2_ruperts_lifeguard = {
+ prompt() {
+ view.prompt = "Rupert's Lifeguard: Add the Lifeguard's Unit to " + card_name(game.selected)
+ gen_action_card(S2_RUPERTS_LIFEGUARD)
+ },
+ card(c) {
+ log(`Move\nC${S2_RUPERTS_LIFEGUARD}\nC${game.selected}\n1 stick.`)
+ move_all_sticks(S2_RUPERTS_LIFEGUARD, game.selected)
+ remove_card(S2_RUPERTS_LIFEGUARD)
+ game.selected = -1
+ resume_routing()
+ }
+
+}
+
function resume_routing() {
game.state = "routing"