summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-01-15 21:06:26 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 11:54:52 +0100
commite6d8c13dccf780a2f2c140c84e60435759e126d1 (patch)
tree6a3c591a6cb37f97477007456b583a06185cbe46
parentc0798a4c05efad1d337356cda9fe3c92148cda89 (diff)
downloadwilderness-war-e6d8c13dccf780a2f2c140c84e60435759e126d1.tar.gz
Courier Intercepted!
-rw-r--r--rules.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 9df39cb..d62cd54 100644
--- a/rules.js
+++ b/rules.js
@@ -365,6 +365,7 @@ const SOUTHERN_COLONIAL_MILITIAS = find_space("Southern Colonial Militias");
const first_amphib_card = 17;
const last_amphib_card = 20;
+const SURRENDER = 6;
const LOUISBOURG_SQUADRONS = 21;
function has_amphibious_arrow(space) {
@@ -1761,6 +1762,8 @@ function play_card(card) {
log(`${game.active} plays ${card_name(card)}.`);
remove_from_array(player.hand, card);
game.cards.current = card;
+ if (card === SURRENDER)
+ game.events.surrender = 1;
if (cards[card].special === 'remove')
game.cards.removed.push(card);
else
@@ -1771,6 +1774,8 @@ function discard_card(card, reason) {
log(`${game.active} discards ${card_name(card)}${reason}.`);
remove_from_array(player.hand, card);
game.cards.current = card;
+ if (card === SURRENDER)
+ game.events.surrender = 1;
if (cards[card].special === 'remove')
game.cards.removed.push(card);
else
@@ -3920,6 +3925,26 @@ states.governor_vaudreuil_interferes = {
},
}
+events.courier_intercepted = {
+ can_play() {
+ return enemy_player.hand.length > 0;
+ },
+ play() {
+ let roll = roll_d6();
+ log("Roll " + roll + ".");
+ if (roll >= 3) {
+ let i = random(enemy_player.hand.length);
+ let c = enemy_player.hand[i];
+ enemy_player.hand.splice(i, 1);
+ player.hand.push(c);
+ log(`Steals ${card_name(c)}.`);
+ } else {
+ log("No effect.");
+ }
+ end_action_phase();
+ },
+}
+
function is_card_removed(card) {
return game.cards.removed.includes(card);
}