summaryrefslogtreecommitdiff
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
parenteaf0fc7b430ed0587fd02ccd91c6952daf6a4faf (diff)
downloadtable-battles-69730a35b75f73f61d6eb350aaccbdc79cee36aa.tar.gz
Newbury 1st and 2nd.
-rw-r--r--rules.js50
-rw-r--r--tools/scenarios.csv6
2 files changed, 52 insertions, 4 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!":
diff --git a/tools/scenarios.csv b/tools/scenarios.csv
index 9a17baa..1e31049 100644
--- a/tools/scenarios.csv
+++ b/tools/scenarios.csv
@@ -36,9 +36,9 @@ status,expansion,number,name,date,player1,cards1,morale1,tactical1,player2,cards
1,Gettysburg,29,2nd Day of Gettysburg,2 July 1863,Union,166B-172B,2,,Confederate,173B-177B,2,,,,"The Confederates attacked the Union line <i>en echelon</i> in a series of bloody assaults. Meade shuffled men from one part of the ""fish hook"" to the next, pushing back and plugging holes in his line. At the end of the day, the line held."
,,,,,,,,,,,,,,,
1,English Civil War,30,Edgehill,23 October 1642,Royalists,178A-185A,2,18,Parliamentarians,186A-193A,3,,,,"Initial success on the wings and a stubborn infantry contest had all the makings of a decisive Royalist victory. But the cavalier cavalry pursued the main roundhead horse, and the unsupported infantry was scattered by Parliamentarian reservee cavalry."
-s34/byron/etc,English Civil War,31,1st Newbury,20 September 1643,Parliamentarians,194A-199A,2,,Royalists,200A-206A,1,,,,"A surprise attack grabbed key terrain and threatened the Royalist flanks. Recovering from the chaos, a counterattack broke the roundhead center, splitting Essex's army. An attempt to envelop the two halves was thwarted by the London Trained Bands."
-all_extra,English Civil War,32,2nd Newbury,27 October 1644,Parliamentarians,207A-211A,1,16,Royalists,212A-216A,2,16,,,"Attacked from opposite directions and outnumbered more than two to one, the King appeared to be doomed. But the enemy just couldn't coordinate; stubborn Royalist resistance denied Essex anything more than a tactical victory."
-1,English Civil War,33,Naseby,14 June 1645,Royalists,173B-183B,2,20,Parliamentarians,184B-190B,2,,,,"The New Model Army at last achieved decisive victory at Naseby, leaving Charles without a field army. It was also a political victory, as they captured (and published) letters in which the King plotted with foreign troops against his subjects."
+1,English Civil War,31,1st Newbury,20 September 1643,Parliamentarians,194A-199A,2,,Royalists,200A-206A,1,,,,"A surprise attack grabbed key terrain and threatened the Royalist flanks. Recovering from the chaos, a counterattack broke the roundhead center, splitting Essex's army. An attempt to envelop the two halves was thwarted by the London Trained Bands."
+1,English Civil War,32,2nd Newbury,27 October 1644,Parliamentarians,207A-211A,1,16,Royalists,212A-216A,2,16,,,"Attacked from opposite directions and outnumbered more than two to one, the King appeared to be doomed. But the enemy just couldn't coordinate; stubborn Royalist resistance denied Essex anything more than a tactical victory."
+1,English Civil War,33,Naseby,14 June 1645,Royalists,178B-183B,2,20,Parliamentarians,184B-190B,2,,,,"The New Model Army at last achieved decisive victory at Naseby, leaving Charles without a field army. It was also a political victory, as they captured (and published) letters in which the King plotted with foreign troops against his subjects."
all_extra,English Civil War,34,Tippermuir,1 September 1644,Covenanters,191B-196B,4,,Royalists,197B-202B,0 - see below,,,"If any Royalist card Routs, the Covenanters win immediately.","Meanwhile, in Scotland, Montrose sought to block the intervention of the Solemn League and Covenant, and near Perth won a decisive victory &ndash; supposedly losing only one man to Elcho's two thousand dead. Yeah, sure."
montrose,English Civil War,35,Auldearn,9 May 1645,Covenanters,203B-208B,5,,Royalists,209B-216B,0 - see below,,,"If any Royalist card Routs, the Covenanters win immediately.","400 desperate men defend Auldearn from a Covenanter army nearly 2,000 strong. Their only hope is that Montrose will arrive in time to turn the tide. He better hurry it up!"
,,,,,,,,,,,,,,,