diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-09 17:37:39 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:47 +0100 |
commit | c5f35f99aa9605a7baf43d6c407b126a51e878f8 (patch) | |
tree | 66762195b50767f4083148aff704b2d720430717 | |
parent | 005a221f87a6b1a24ee9ea38c2e57798401146fe (diff) | |
download | table-battles-c5f35f99aa9605a7baf43d6c407b126a51e878f8.tar.gz |
Gaines's Mill.
-rw-r--r-- | rules.js | 27 |
1 files changed, 23 insertions, 4 deletions
@@ -204,6 +204,12 @@ const S37_FRENCH_TROOPS = find_card(37, "French Troops") const S37_SOIMONOFF = find_card(37, "Soimonoff") const S37_THE_FOG = find_card(37, "The Fog") +const S3201_GAINES_MILL = find_scenario(3201) +const S3201_JACKSON = find_card(3201, "Jackson") +const S3201_DH_HILL = find_card(3201, "D.H. Hill") +const S3201_AP_HILL = find_card(3201, "A.P. Hill") +const S3201_LONGSTREET = find_card(3201, "Longstreet") + // === SETUP === exports.setup = function (seed, scenario, options) { @@ -668,7 +674,12 @@ function can_place_dice(c) { } } - // TODO: 91A Jackson - may only place dice if D.H. Hill has dice + if (game.scenario === S3201_GAINES_MILL) { + if (c === S3201_JACKSON) { + if (!has_any_dice_on_card(S3201_DH_HILL)) + return false + } + } return pred(c) } @@ -1140,13 +1151,21 @@ function can_take_action(c, a) { if (game.scenario === S8_BROOKLYN_HEIGHTS) { if (c === S8_CLINTON) { - // Clinton can only attack if both Grant and Hessians have dice on them. - if (!(has_any_dice_on_card(S8_GRANT) && has_any_dice_on_card(S8_HESSIANS))) + // Clinton - may only attack if both Grant and Hessians have dice on them. + if (!has_any_dice_on_card(S8_GRANT) || !has_any_dice_on_card(S8_HESSIANS)) return false } } - // TODO: 91A Jackson - may only attack if D.H. Hill and one other formation have dice + if (game.scenario === S3201_GAINES_MILL) { + if (c === S3201_JACKSON) { + // Jackson - may only attack if D.H. Hill and one other formation have dice + if (!has_any_dice_on_card(S3201_DH_HILL)) + return false + if (!has_any_dice_on_card(S3201_AP_HILL) && !has_any_dice_on_card(S3201_LONGSTREET)) + return false + } + } if (a.type === "Bombard" || a.type === "Attack" || a.type === "Command") { if (data.cards[c].special) |