summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-13 21:27:32 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit69730a35b75f73f61d6eb350aaccbdc79cee36aa (patch)
tree8a4e43c443cc24f4391b5f40347dade618e21494 /rules.js
parenteaf0fc7b430ed0587fd02ccd91c6952daf6a4faf (diff)
downloadtable-battles-69730a35b75f73f61d6eb350aaccbdc79cee36aa.tar.gz
Newbury 1st and 2nd.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js50
1 files changed, 49 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index ca3a5f5..ce8f1b4 100644
--- a/rules.js
+++ b/rules.js
@@ -275,6 +275,9 @@ 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")
+
// === SETUP ===
exports.setup = function (seed, scenario, options) {
@@ -622,7 +625,14 @@ function is_straight_4_or_3(c) {
if (game.scenario === S28_CULPS_HILL) {
if (game.rolled >= 5)
return 4
- return 3
+ else
+ return 3
+ }
+ if (game.scenario === S31_NEWBURY_1ST) {
+ if (is_card_in_play(S31_SKIPPON))
+ return 4
+ else
+ return 3
}
throw new Error("Missing rule for Straight 3/4 choice")
}
@@ -1853,6 +1863,30 @@ function update_attack1() {
game.hits += 1
}
+ if (game.scenario === S31_NEWBURY_1ST) {
+ if (game.selected === S31_WENTWORTH) {
+ if (has_any_dice_on_card(S31_BYRON) && is_card_in_play(S31_SKIPPON)) {
+ game.hits += 1
+ }
+ }
+ if (game.target === S31_WENTWORTH) {
+ if (has_any_dice_on_card(S31_BYRON) && is_card_in_play(S31_SKIPPON)) {
+ game.hits -= 1
+ }
+ }
+ }
+
+ if (game.scenario === S32_NEWBURY_2ND) {
+ if (game.selected !== S32_MANCHESTER) {
+ if (has_any_dice_on_card(S32_MANCHESTER)) {
+ // if dice on Manchester, all other friendly attack +1
+ let w = data.cards[game.selected].wing
+ if (w === BLUE || w === DKBLUE)
+ game.hits += 1
+ }
+ }
+ }
+
if (card_has_rule(game.target, "suffer_1_less_1_max"))
game.hits = Math.max(0, Math.min(1, game.hits - 1))
if (card_has_rule(game.target, "suffer_1_less"))
@@ -2079,6 +2113,14 @@ function can_take_reaction(c, a, wild) {
}
}
+ if (game.scenario === S31_NEWBURY_1ST) {
+ if (c === S31_GERARD) {
+ // TODO: or is it while London New Bands is in play?
+ if (is_routed(S31_SKIPPON))
+ return false
+ }
+ }
+
if (data.cards[c].special)
return check_cube_requirement(c, a.requirement)
else
@@ -2242,7 +2284,11 @@ function goto_absorb(c, a) {
case "When target suffers Hits, this unit suffers 1 hit ONLY instead.":
game.hits = 1
break
+ case "When target suffers Hits, this card suffers one less Hit instead.":
+ game.hits = Math.max(0, game.hits - 1)
+ break
case "When target suffers Hits, this card suffers 1 less hit per die.":
+ case "When target suffers Hits, this unit suffers 1 less hit per die.":
game.hits = Math.max(0, game.hits - count_dice_on_card(c))
break
}
@@ -2362,6 +2408,7 @@ function get_attack_hits(c, a) {
case "1 hit per die (also take dice from 68th Pennsylvania). 1 self per action.":
case "1 hit per die. 1 self per action. (But see William Fielding.)":
case "1 hit per die (1 extra vs Essex). 1 self per action. (See W. Fielding.)":
+ case "1 hit per die. 1 self per action. You CHOOSE the target.":
return count_dice_on_card(c)
case "1 hit per pair.":
case "1 hit per pair. 1 self per action.":
@@ -2403,6 +2450,7 @@ function get_attack_self(c, a) {
case "1 hit per die (also take dice from 68th Pennsylvania). 1 self per action.":
case "1 hit per die. 1 self per action. (But see William Fielding.)":
case "1 hit per die (1 extra vs Essex). 1 self per action. (See W. Fielding.)":
+ case "1 hit per die. 1 self per action. You CHOOSE the target.":
case "1 hit per pair. 1 self per action.":
case "1 hit, PLUS 1 hit per die. 1 self per action.":
case "1 hit, PLUS 1 hit per die. 1 self per action. Fightin' Irish!":