From 0806d5c2dab3f0af175a1b9d4f91f07b65ebebc6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 14 Dec 2023 11:19:12 +0100 Subject: general rule extra_hit_if_dice_on for newbury 1st and tippermuir --- rules.js | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 8c1f58d..61d7244 100644 --- a/rules.js +++ b/rules.js @@ -280,12 +280,6 @@ const S31_GERARD = find_card(31, "Gerard") const S31_STAPLETON = find_card(31, "Stapleton") const S31_LONDON_TRAINED_BANDS = find_card(31, "London Trained Bands") -const S32_NEWBURY_2ND = find_scenario(32) -const S32_MANCHESTER = find_card(32, "Manchester") - -const S34_TIPPERMUIR = find_scenario(34) -const S34_MONTROSE = find_card(34, "Montrose") - const S35_AULDEARN = find_scenario(35) const S35_MONTROSE = find_card(35, "Montrose") const S35_GORDON = find_card(35, "Gordon") @@ -1937,22 +1931,9 @@ function update_attack1() { } } - if (game.scenario === S32_NEWBURY_2ND) { - if (game.selected !== S32_MANCHESTER) { - // if dice on Manchester, all other friendly attack +1 - if (data.cards[game.selected].wing === BLUE || data.cards[game.selected].wing === DKBLUE) - if (has_any_dice_on_card(S32_MANCHESTER)) - game.hits += 1 - } - } - - if (game.scenario === S34_TIPPERMUIR) { - // if dice on Montrose, all Pink attack +1 - if (data.cards[game.selected].wing === PINK) { - if (has_any_dice_on_card(S34_MONTROSE)) - game.hits += 1 - } - } + let extra = card_has_rule(game.selected, "extra_hit_if_dice_on") + if (extra && has_any_dice_on_card(extra[0])) + game.hits += 1 if (card_has_rule(game.target, "suffer_1_less_1_max")) game.hits = clamp(game.hits - 1, 0, 1) -- cgit v1.2.3