summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-14 11:19:12 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit0806d5c2dab3f0af175a1b9d4f91f07b65ebebc6 (patch)
tree01f7e006009e34d0bb995b2e4644330cdbb62100 /rules.js
parenteabedf314dfedd2ee5f641bf2e10564304d9d3f0 (diff)
downloadtable-battles-0806d5c2dab3f0af175a1b9d4f91f07b65ebebc6.tar.gz
general rule extra_hit_if_dice_on for newbury 1st and tippermuir
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js25
1 files changed, 3 insertions, 22 deletions
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)