diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-05-02 14:17:41 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:42:59 +0100 |
commit | 9795d84b9c85566b6b82690e62c587bf318bc02f (patch) | |
tree | 9ced2488b9f7f2dbb467b7aec15947b5db593ab6 | |
parent | 0603eb7855933f5a8ce8e8df5415526e73f14d7e (diff) | |
download | 300-earth-and-water-9795d84b9c85566b6b82690e62c587bf318bc02f.tar.gz |
300: mines of laurion
-rw-r--r-- | rules.js | 40 |
1 files changed, 31 insertions, 9 deletions
@@ -24,6 +24,7 @@ const SPARTA = "Sparta"; const PELLA = "Pella"; // Greek event numbers +const MINES_OF_LAURION = 1; const LEONIDAS = 8; const EVANGELION = 10; const MOLON_LABE = 12; @@ -554,7 +555,9 @@ function goto_persian_preparation_draw() { function goto_greek_preparation_draw() { game.active = GREECE; game.state = 'greek_preparation_draw'; - if (game.trigger.acropolis_on_fire) + if (game.event == MINES_OF_LAURION) + game.talents = 3; + else if (game.trigger.acropolis_on_fire) game.talents = 5; else game.talents = 6; @@ -600,9 +603,10 @@ states.persian_preparation_draw = { states.greek_preparation_draw = { prompt: function (view, current) { + let name = (game.event == MINES_OF_LAURION) ? "Mines of Laurion" : "Greek Preparation Phase"; if (is_inactive_player(current)) - return view.prompt = "Greek Preparation Phase."; - view.prompt = "Greek Preparation Phase: Draw up to 6 cards. " + game.talents + " talents left."; + return view.prompt = name + "."; + view.prompt = name + ": Draw up to 6 cards. " + game.talents + " talents left."; if (game.greek.draw < 6 && game.talents >= 1 && can_draw_card(game.greek.draw)) gen_action(view, 'draw'); gen_action_undo(view); @@ -689,16 +693,18 @@ function goto_greek_preparation_build() { states.greek_preparation_build = { prompt: function (view, current) { + let name = (game.event == MINES_OF_LAURION) ? "Mines of Laurion" : "Greek Preparation Phase"; if (is_inactive_player(current)) - return view.prompt = "Greek Preparation Phase."; - view.prompt = "Greek Preparation Phase: Build fleets and armies. "; + return view.prompt = name + "."; + view.prompt = name + ": Build fleets and armies. "; view.prompt += game.talents + " talents left."; if (game.talents >= 1 && count_greek_armies(RESERVE) > 0) { for (let space of CITIES) if (is_greek_control(space)) gen_action(view, 'city', space); } - if (game.built_fleets < 2 && game.talents >= 1 && count_greek_fleets(RESERVE) > 0) { + let can_build_fleet = (game.event == MINES_OF_LAURION) || (game.built_fleets < 2); + if (can_build_fleet && game.talents >= 1 && count_greek_fleets(RESERVE) > 0) { for (let space of PORTS) if (is_greek_control(space) && count_persian_fleets(space) == 0) gen_action(view, 'port', space); @@ -723,7 +729,10 @@ states.greek_preparation_build = { clear_undo(); game.talents = 0; game.trigger.acropolis_on_fire = 0; - end_preparation_phase(); + if (game.event == MINES_OF_LAURION) + end_greek_operation(); + else + end_preparation_phase(); }, undo: pop_undo, } @@ -1718,7 +1727,7 @@ function can_play_persian_event(card) { case 1: return can_play_cavalry_of_mardonius(); case 2: return can_play_tribute_of_earth_and_water(); case 3: return can_play_tribute_of_earth_and_water(); - case 4: return true; // carneia_festival + case 4: return can_play_carneia_festival(); case 5: return false; // the_immortals case 6: return can_play_ostracism(); case 7: return can_play_the_great_king(); @@ -1792,6 +1801,10 @@ function play_cavalry_of_mardonius() { goto_persian_movement(true, false, CAVALRY_OF_MARDONIUS); } +function can_play_carneia_festival() { + return true; +} + function play_carneia_festival() { game.trigger.carneia_festival = 1; end_persian_operation(); @@ -2049,7 +2062,7 @@ function can_play_greek_event(card) { if (game.trigger.carneia_festival && SPARTA_CARDS.includes(card)) return false; switch (card) { - case 1: return true; // mines_of_laurion + case 1: return can_play_mines_of_laurion(); case 2: return can_play_ionian_revolt(); case 3: return can_play_wrath_of_poseidon(); case 4: return false; // miltiades @@ -2087,6 +2100,15 @@ function play_greek_event(card) { throw Error("unimplemented event: " + GREEK_EVENT_NAMES[card]); } +function can_play_mines_of_laurion() { + return true; +} + +function play_mines_of_laurion() { + game.event = MINES_OF_LAURION; + goto_greek_preparation_draw(); +} + function can_play_ionian_revolt() { for (let city of [ABYDOS, EPHESOS]) if (count_persian_armies(city) > 0) |