summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js35
1 files changed, 31 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index f9b6c74..9455fc0 100644
--- a/rules.js
+++ b/rules.js
@@ -124,7 +124,8 @@ exports.view = function (state, player) {
sticks: game.sticks,
cubes: game.cubes,
morale: game.morale,
- lost: game.lost,
+ tv1: get_tactical_victory_points(0),
+ tv2: get_tactical_victory_points(1),
front: game.front,
reserve: game.reserve,
selected: game.selected,
@@ -333,6 +334,10 @@ const S45_SOOR = find_scenario(45)
const S45_AUSTRIAN_GUNS = find_card(45, "Austrian Guns")
const S45_CUIRASSIERS = find_card(45, "Cuirassiers")
+const S46_ROCOUX = find_scenario(46)
+const S46_AUSTRIANS = find_card(46, "Austrians")
+const S46_THE_MOUTH_OF_HELL = find_card(46, "The Mouth of Hell")
+
// === SETUP ===
exports.setup = function (seed, scenario, options) {
@@ -620,6 +625,16 @@ function remove_card(c) {
}
function pay_for_action(c) {
+ if (game.scenario === S46_ROCOUX) {
+ if (c === S46_THE_MOUTH_OF_HELL) {
+ // icky test for second reaction...
+ if (game.state === "screen") {
+ remove_cubes(c, 2)
+ return
+ }
+ }
+ }
+
if (data.cards[c].special)
remove_cubes(c, 1)
else
@@ -730,6 +745,17 @@ function check_impossible_to_attack_victory() {
return false
}
+function get_tactical_victory_points(p) {
+ let n = game.lost[1-p]
+
+ if (game.scenario === S46_ROCOUX) {
+ if (p === 0)
+ n += get_sticks(S46_AUSTRIANS)
+ }
+
+ return n
+}
+
function check_victory() {
let info = data.scenarios[game.scenario]
@@ -750,8 +776,8 @@ function check_victory() {
if (game.morale[1] === 0)
return goto_game_over(P1, player_name(1) + " has run out of morale!")
- let tv0 = info.players[1].lost
- let tv1 = info.players[0].lost
+ let tv0 = get_tactical_victory_points(0)
+ let tv1 = get_tactical_victory_points(1)
if (info.players[0].tactical > 0 && tv0 >= info.players[0].tactical)
return goto_game_over(P1, player_name(0) + " tactical victory!")
@@ -1653,6 +1679,7 @@ function check_cube_requirement(c, req) {
return get_cubes(c) >= 3
case "Two Cubes":
return get_cubes(c) >= 2
+ case "One Cube*":
case "Voluntary":
case undefined:
return get_cubes(c) >= 1
@@ -2086,7 +2113,7 @@ states.shift_to = {
if (game.target2 < 0) {
if (is_infantry(game.selected))
for (let c of game.front[p])
- if (c !== game.selected && is_infantry(c))
+ if (c !== game.selected && is_infantry(c) && c !== S46_AUSTRIANS)
gen_action_card(c)
if (is_cavalry(game.selected))
for (let c of game.front[p])