From 2a9f4e4e5bab2345e12d43ae7bbca307c829091b Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 10 Oct 2023 11:29:02 +0200 Subject: Prompt for Coehorns in defense during assault. --- rules.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index b5c3f1d..53949f0 100644 --- a/rules.js +++ b/rules.js @@ -4559,6 +4559,14 @@ function can_play_coehorns_in_attack() { return false } +function can_play_coehorns_in_defense() { + // If played during siege, this will be false during assault because the card is in discard. + // There's no risk of being prompted twice. + if (is_card_available_for_defender(COEHORNS)) + return game.battle.assault && has_friendly_regulars(game.battle.where) + return false +} + function can_play_fieldworks_in_attack() { if (!game.battle.assault) { if (is_card_available_for_attacker(FIELDWORKS_1) || is_card_available_for_attacker(FIELDWORKS_2)) { @@ -4595,7 +4603,7 @@ function goto_battle_attacker_events() { function goto_battle_defender_events() { set_active(game.battle.defender) - if (can_play_ambush_in_defense() || can_play_fieldworks_in_defense()) { + if (can_play_ambush_in_defense() || can_play_coehorns_in_defense() || can_play_fieldworks_in_defense()) { game.state = 'defender_events' } else { goto_battle_roll() @@ -4704,6 +4712,14 @@ states.defender_events = { else dont_have.push('"Ambush"') } + if (can_play_coehorns_in_defense()) { + if (player.hand.includes(COEHORNS)) { + gen_action('play_event', COEHORNS) + have.push('"Coehorns"') + } else { + dont_have.push('"Coehorns"') + } + } if (can_play_fieldworks_in_defense()) { let x = false if (player.hand.includes(FIELDWORKS_1)) { @@ -4740,6 +4756,9 @@ states.defender_events = { else game.events.ambush = game.active break + case COEHORNS: + game.events.coehorns = game.active + break case FIELDWORKS_1: case FIELDWORKS_2: place_fieldworks(game.battle.where) -- cgit v1.2.3