diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-13 15:40:34 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:48 +0100 |
commit | f6855ea8426dc634844243ee46cf694dc8acf5c5 (patch) | |
tree | e9320049acb225db57b62daee8913d2c7c21e306 /rules.js | |
parent | c6637917de7e7281d947f3fd10a1dfe831c544d2 (diff) | |
download | table-battles-f6855ea8426dc634844243ee46cf694dc8acf5c5.tar.gz |
2nd gettys day
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 62 |
1 files changed, 60 insertions, 2 deletions
@@ -164,9 +164,10 @@ function goto_game_over(result, victory) { game.state = "game_over" game.active = "None" game.result = result - game.victory = victory + game.victory = result + " victory! " + victory log("") - log(game.victory) + log(result + " victory!") + log(victory) return false } @@ -248,6 +249,15 @@ const S28_CULPS_HILL = find_scenario(28) const S28_BREASTWORKS = find_card(28, "Breastworks") const S28_GEARY = find_card(28, "Geary") +const S29_GETTYS_2ND = find_scenario(29) +const S29_MCLAWS = find_card(29, "McLaws") +const S29_ANDERSON = find_card(29, "Anderson") +const S29_HOOD = find_card(29, "Hood") +const S29_EARLY = find_card(29, "Early") +const S29_JOHNSON = find_card(29, "Johnson") +const S29_MEADE = find_card(29, "Meade") +const S29_LITTLE_ROUND_TOP = find_card(29, "Little Round Top") + // === SETUP === exports.setup = function (seed, scenario, options) { @@ -836,6 +846,25 @@ function can_place_dice(c) { } } + if (game.scenario === S29_GETTYS_2ND) { + if (c === S29_MCLAWS) { + if (!has_any_dice_on_card(S29_HOOD)) + return false + } + if (c === S29_ANDERSON) { + if (!has_any_dice_on_card(S29_MCLAWS)) + return false + } + if (c === S29_EARLY || c === S29_JOHNSON) { + let red = 0 + if (has_any_dice_on_card(S29_HOOD)) ++red + if (has_any_dice_on_card(S29_MCLAWS)) ++red + if (has_any_dice_on_card(S29_ANDERSON)) ++red + if (red < 2) + return false + } + } + return pred(c) } @@ -1228,6 +1257,11 @@ function end_roll_phase() { } } + if (game.scenario === S28_CULPS_HILL) { + if (map_get(game.cubes, S28_GEARY, 0) === 5) + return goto_game_over(P2, "Geary's Division arrived.") + } + end_turn() } @@ -2144,6 +2178,13 @@ states.screen = { function goto_absorb(c, a) { game.reacted = player_index() + if (game.scenario === S29_GETTYS_2ND) { + if (c === S29_MEADE) { + game.state = "meade" + return + } + } + game.target = c update_attack1() @@ -2169,6 +2210,23 @@ function goto_absorb(c, a) { game.state = "absorb" } +states.meade = { + prompt() { + view.prompt = "Choosy any friendly Formation except Little Round Top to absorb the hits instead." + let p = player_index() + for (let c of game.front[p]) { + if (c !== S29_MEADE && c !== S29_LITTLE_ROUND_TOP && c !== game.target) + gen_action_card(c) + } + }, + card(c) { + game.target = c + update_attack1() + update_attack2() + game.state = "absorb" + } +} + states.absorb = { prompt() { view.prompt = "Absorb attack from " + card_name(game.selected) + "." |