summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-03-08 18:53:17 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 12:12:42 +0100
commit979e85cfaa0f260e9468df7bacf4cbcdc0395f8e (patch)
treee08213e970a6c7f5ab35ec5c3358a0fed088258f /rules.js
parent4b1e7ed644f538145a89aa56a65dbb6ca37885d2 (diff)
downloadshores-of-tripoli-979e85cfaa0f260e9468df7bacf4cbcdc0395f8e.tar.gz
US Signal Books Overboard should be playable after Murad Reis Breaks Out.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 0042f64..fcc30f7 100644
--- a/rules.js
+++ b/rules.js
@@ -1918,7 +1918,31 @@ states.murad_reis_breaks_out = {
function end_murad_reis_breaks_out(us_dice) {
interception_roll(GIBRALTAR, us_dice);
move_all_pieces(TR_CORSAIRS, GIBRALTAR, TRIPOLI);
- end_tripolitan_play();
+ if (can_play_us_signal_books_overboard())
+ game.state = 'murad_reis_overboard';
+ else
+ end_tripolitan_play();
+}
+
+states.murad_reis_overboard = {
+ prompt(view, current) {
+ view.prompt = "Tripolitania: Murad Reis Breaks Out";
+ view.prompt += you_may_play(current, US_SIGNAL_BOOKS_OVERBOARD);
+ if (is_inactive_player(current))
+ return;
+ if (game.tr.hand.includes(US_SIGNAL_BOOKS_OVERBOARD))
+ gen_action(view, 'card_event', US_SIGNAL_BOOKS_OVERBOARD);
+ gen_action(view, 'next');
+ },
+ card_event(card) {
+ play_battle_card(game.tr, card);
+ let c = discard_random_card(game.us.hand, game.us.discard);
+ log("United States discards \u{201c}" + CARD_NAMES[c] + "\u{201d}.");
+ end_tripolitan_play();
+ },
+ next() {
+ end_tripolitan_play();
+ },
}
function can_play_constantinople_sends_aid() {