summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-13 12:20:41 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit0cfe4b26b00c3e7bc4ca19507dd96f3d7f538145 (patch)
treed21349c8e33a88ca078daeabf6535bb7ea9da851 /rules.js
parent528b625157b1471bde7df32136aebfaf32c062e2 (diff)
downloadtable-battles-0cfe4b26b00c3e7bc4ca19507dd96f3d7f538145.tar.gz
fixes
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js26
1 files changed, 23 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index dc4796a..4ba0f2a 100644
--- a/rules.js
+++ b/rules.js
@@ -235,6 +235,12 @@ const S22_GABIENE = find_scenario(22)
const S22_EUMENES_CAMP = find_card(22, "Eumenes's Camp")
const S22_SILVER_SHIELDS = find_card(22, "The Silver Shields")
+const S25_WHEATFIELD = find_scenario(25)
+const S25_STONY_HILL = find_card(25, "Stony Hill")
+const S25_WOFFORD = find_card(25, "Wofford")
+const S25_ZOOK = find_card(25, "Zook")
+const S25_KELLY = find_card(25, "Kelly")
+
// === SETUP ===
exports.setup = function (seed, scenario, options) {
@@ -578,10 +584,12 @@ const place_dice_check = {
"Any": (c) => check_range(c, 1, 6),
"1/2": (c) => check_range(c, 1, 2),
"1-3": (c) => check_range(c, 1, 3),
+ "1/2/3": (c) => check_range(c, 1, 3),
"1-4": (c) => check_range(c, 1, 4),
"1-5": (c) => check_range(c, 1, 5),
"2/3": (c) => check_range(c, 2, 2),
"2-4": (c) => check_range(c, 2, 4),
+ "2/3/4": (c) => check_range(c, 2, 4),
"2-5": (c) => check_range(c, 2, 5),
"2-6": (c) => check_range(c, 2, 6),
"3/4": (c) => check_range(c, 3, 4),
@@ -589,6 +597,7 @@ const place_dice_check = {
"3-6": (c) => check_range(c, 3, 6),
"4/5": (c) => check_range(c, 4, 5),
"4-6": (c) => check_range(c, 4, 6),
+ "4/5/6": (c) => check_range(c, 4, 6),
"5/6": (c) => check_range(c, 5, 6),
"(1)/(2)": (c) => check_range(c, 1, 2),
"(1-3)": (c) => check_range(c, 1, 3),
@@ -627,17 +636,21 @@ const place_dice_gen = {
"Any": (c) => gen_range(c, 1, 6),
"1/2": (c) => gen_range(c, 1, 2),
"1-3": (c) => gen_range(c, 1, 3),
+ "1/2/3": (c) => gen_range(c, 1, 3),
"1-4": (c) => gen_range(c, 1, 4),
"1-5": (c) => gen_range(c, 1, 5),
"2/3": (c) => gen_range(c, 2, 2),
"2-4": (c) => gen_range(c, 2, 4),
+ "2/3/4": (c) => gen_range(c, 2, 4),
"2-5": (c) => gen_range(c, 2, 5),
"2-6": (c) => gen_range(c, 2, 6),
"3/4": (c) => gen_range(c, 3, 4),
"3-5": (c) => gen_range(c, 3, 5),
+ "3/4/5": (c) => gen_range(c, 3, 5),
"3-6": (c) => gen_range(c, 3, 6),
"4/5": (c) => gen_range(c, 4, 5),
"4-6": (c) => gen_range(c, 4, 6),
+ "4/5/6": (c) => gen_range(c, 4, 6),
"5/6": (c) => gen_range(c, 5, 6),
"(1)/(2)": (c) => gen_range(c, 1, 2),
"(1-3)": (c) => gen_range(c, 1, 3),
@@ -676,17 +689,21 @@ const place_dice_take = {
"Any": (c, d) => take_single(c, d),
"1/2": (c, d) => take_single(c, d),
"1-3": (c, d) => take_single(c, d),
+ "1/2/3": (c, d) => take_single(c, d),
"1-4": (c, d) => take_single(c, d),
"1-5": (c, d) => take_single(c, d),
"2/3": (c, d) => take_single(c, d),
"2-4": (c, d) => take_single(c, d),
+ "2/3/4": (c, d) => take_single(c, d),
"2-5": (c, d) => take_single(c, d),
"2-6": (c, d) => take_single(c, d),
"3/4": (c, d) => take_single(c, d),
"3-5": (c, d) => take_single(c, d),
+ "3/4/5": (c, d) => take_single(c, d),
"3-6": (c, d) => take_single(c, d),
"4/5": (c, d) => take_single(c, d),
"4-6": (c, d) => take_single(c, d),
+ "4/5/6": (c, d) => take_single(c, d),
"5/6": (c, d) => take_single(c, d),
"(1)/(2)": (c, d) => take_single(c, d),
"(1-3)": (c, d) => take_single(c, d),
@@ -1311,12 +1328,12 @@ function goto_action_phase() {
if (game.reacted) {
game.reacted = 0
- goto_roll_phase()
+ end_action_phase()
} else {
if (can_take_any_action())
game.state = "action"
else
- goto_roll_phase()
+ end_action_phase()
}
}
@@ -1841,6 +1858,7 @@ function goto_take_reaction(c, ix) {
}
function end_reaction() {
+ clear_undo()
set_opponent_active()
resume_attack()
}
@@ -2005,6 +2023,7 @@ function get_attack_hits(c, a) {
case "1 hit per die (plus dice from E. Phalanx).":
case "1 hit per die. 1 self per action. (But see Sharpshooters.)":
case "1 hit per die. 1 self per action. (But see 4th Alabama.)":
+ case "1 hit per die. 1 self per action. (But see Semmes.)":
return count_dice_on_card(c)
case "1 hit per pair.":
case "1 hit per pair. 1 self per action.":
@@ -2035,6 +2054,7 @@ function get_attack_self(c, a) {
case "1 hit per die (but see below). 1 self per action.":
case "1 hit per die. 1 self per action. (But see Sharpshooters.)":
case "1 hit per die. 1 self per action. (But see 4th Alabama.)":
+ case "1 hit per die. 1 self per action. (But see Semmes.)":
case "1 hit per pair. 1 self per action.":
case "1 hit, PLUS 1 hit per die. 1 self per action.":
return 1
@@ -2298,7 +2318,7 @@ function should_enter_reserve(c) {
}
for (let t of reserve)
- if (!set_has(game.front[0], t) && !set_has(game.front[1], t))
+ if (!is_card_in_play(t))
return true
return false
}