From 3adbb5a988aea0fc5ab2d09d50a4d6d9a5933a5e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 3 Dec 2023 13:50:39 +0100 Subject: Version 2.0 rules. Tournament rule is standard. Jupiter event picks a random block. Cleopatra is not eliminated by Vulcan. Fix card manifest. --- create.html | 7 ------- data.js | 10 +++++++++- play.js | 6 ++---- rules.js | 40 ++++++++++++---------------------------- 4 files changed, 23 insertions(+), 40 deletions(-) diff --git a/create.html b/create.html index a8eabf1..6caab35 100644 --- a/create.html +++ b/create.html @@ -10,13 +10,6 @@ Players may swap any blocks on the map as long as the original number of deployed blocks in each city is maintained. -
-
- -
-Julius Caesar goes first on the first turn regardless of the cards played. -
-

House rules:
diff --git a/data.js b/data.js index 143618f..c1bd8fb 100644 --- a/data.js +++ b/data.js @@ -8,25 +8,33 @@ const CARDS = { 5: { name: "Neptune", event: "Neptune", image: "neptune" }, 6: { name: "Pluto", event: "Pluto", image: "pluto" }, 7: { name: "Vulcan", event: "Vulcan", image: "vulcan" }, + 8: { name: "4/1", move: 4, levy: 1, image: "41" }, + 9: { name: "3/2", move: 3, levy: 2, image: "32" }, 10: { name: "3/2", move: 3, levy: 2, image: "32" }, + 11: { name: "3/1", move: 3, levy: 1, image: "31" }, 12: { name: "3/1", move: 3, levy: 1, image: "31" }, 13: { name: "3/1", move: 3, levy: 1, image: "31" }, + 14: { name: "2/3", move: 2, levy: 3, image: "23" }, 15: { name: "2/3", move: 2, levy: 3, image: "23" }, 16: { name: "2/3", move: 2, levy: 3, image: "23" }, 17: { name: "2/3", move: 2, levy: 3, image: "23" }, + 18: { name: "2/2", move: 2, levy: 2, image: "22" }, 19: { name: "2/2", move: 2, levy: 2, image: "22" }, 20: { name: "2/2", move: 2, levy: 2, image: "22" }, 21: { name: "2/2", move: 2, levy: 2, image: "22" }, + 22: { name: "2/1", move: 2, levy: 1, image: "21" }, 23: { name: "2/1", move: 2, levy: 1, image: "21" }, 24: { name: "2/1", move: 2, levy: 1, image: "21" }, + 25: { name: "1/3", move: 1, levy: 3, image: "13" }, - 26: { name: "1/2", move: 1, levy: 2, image: "12" }, + 26: { name: "1/3", move: 1, levy: 3, image: "13" }, + 27: { name: "1/2", move: 1, levy: 2, image: "12" }, } diff --git a/play.js b/play.js index 6e734ac..6380b7b 100644 --- a/play.js +++ b/play.js @@ -208,7 +208,7 @@ function block_description(b) { let c = BLOCKS[b].initiative + BLOCKS[b].firepower let levy = BLOCKS[b].levy if (levy) - return BLOCKS[b].name + " (" + levy + ") " + STEPS[s] + "-" + c + return BLOCKS[b].name + " (" + SPACES[levy].name + ") " + STEPS[s] + "-" + c return BLOCKS[b].name + " " + STEPS[s] + "-" + c } return block_owner(b) @@ -303,9 +303,7 @@ function on_click_battle_pass(evt) { function on_click_map_block(evt) { let b = evt.target.block let s = view.location[b] - if (view.actions && view.actions.secret && view.actions.secret.includes(s)) - send_action('secret', [s, block_color(b)]) - else if (!view.battle) + if (!view.battle) send_action('block', b) } diff --git a/rules.js b/rules.js index bac424f..2760993 100644 --- a/rules.js +++ b/rules.js @@ -1137,8 +1137,8 @@ function reveal_cards() { game.p2 = POMPEIUS } - // Tournament rule: Caesar always goes first on the first turn of the game. - if (game.year === 705 && game.turn === 1 && game.tournament) { + // Caesar always goes first on the first turn of the game. + if (game.year === 705 && game.turn === 1) { if (game.p1 !== CAESAR) { game.p1 = CAESAR game.p2 = POMPEIUS @@ -1227,12 +1227,12 @@ states.jupiter = { prompt: function (view, current) { if (is_inactive_player(current)) return view.prompt = "Waiting for " + game.active + "..." - view.prompt = "Jupiter: Choose one enemy army adjacent to a friendly city." + view.prompt = "Jupiter: Choose an enemy city adjacent to a friendly city." for (let s = first_map_space; s < space_count; ++s) { if (is_friendly_city(s)) { for (let to of SPACES[s].exits) if (is_enemy_city(to) || is_contested_city(to)) - gen_action(view, 'secret', to) + gen_action_space(view, to) } } gen_action_pass(view, "Pass") @@ -1246,20 +1246,6 @@ states.jupiter = { let i = random(list.length) jupiter_block(list[i]) }, - secret: function (args) { - let [where, color] = args - /* pick a random block of the same color as the selected block */ - if (color === "Cleopatra") { - jupiter_block(B_CLEOPATRA) - } else { - let list = [] - for (let b = 0; b < block_count; ++b) - if (game.location[b] === where && block_original_owner(b) === color) - list.push(b) - let i = random(list.length) - jupiter_block(list[i]) - } - }, pass: function () { end_player_turn() }, @@ -1297,9 +1283,14 @@ states.vulcan = { log("Vulcan struck #" + city + "!") game.where = city game.vulcan = [] - for (let b = 0; b < block_count; ++b) - if (game.location[b] === city) + for (let b = 0; b < block_count; ++b) { + if (game.location[b] === city) { + // Exception: Cleopatra at strength 1 is not affected. + if (b === B_CLEOPATRA && game.steps[b] === 1) + continue game.vulcan.push(b) + } + } game.active = enemy(game.active) game.state = 'apply_vulcan' }, @@ -1315,9 +1306,7 @@ states.apply_vulcan = { }, block: function (who) { reduce_block(who) - // uh-oh! cleopatra switched sides! - if (is_contested_city(game.where)) - set_attacker(game.where, game.active) + // NOTE: Cleopatra cannot switch sides in 2nd edition remove_from_array(game.vulcan, who) if (game.vulcan.length === 0) { delete game.vulcan @@ -2643,11 +2632,6 @@ exports.setup = function (seed, scenario, options) { log(".h1 " + scenario) logbr() - if (options.tournament) { - log("Tournament rule: Caesar is the first player on the very first turn of the game.") - game.tournament = 1 - } - if (options.max_2_events) { log("At most 2 events per hand.") game.max_2_events = 1 -- cgit v1.2.3