From 4f40cad7a178b8b9409883b18f75623fe9992840 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 23 Oct 2022 11:18:33 +0200 Subject: Keep Mines out of the discard pile while resolving the event. This will prevent the event from being able to draw itself. The other events that draw from the discard pile (Oracle and Pacification) explicitly say that they should be discarded before drawing, so we don't need to make a more general "hold card until resolved" mechanism. --- rules.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index b8319aa..d2ea215 100644 --- a/rules.js +++ b/rules.js @@ -843,10 +843,12 @@ states.greek_preparation_build = { clear_undo(); game.talents = 0; game.trigger.acropolis_on_fire = 0; - if (game.greek.event === MINES_OF_LAURION) + if (game.greek.event === MINES_OF_LAURION) { + game.discard.push(MINES_OF_LAURION) end_greek_operation(); - else + } else { end_preparation_phase(); + } }, undo: pop_undo, } @@ -2571,6 +2573,8 @@ function can_play_mines_of_laurion() { function play_mines_of_laurion() { game.greek.event = MINES_OF_LAURION; + // remove mines from discard pile while drawing so we can't draw it back immediately + remove_from_array(game.discard, MINES_OF_LAURION) goto_greek_preparation_draw(); } @@ -3449,7 +3453,12 @@ exports.view = function(state, current) { view.g_cards = game.greek.hand.length + game.greek.draw; view.p_cards = game.persian.hand.length + game.persian.draw; - view.discard = game.discard.length > 0 ? game.discard[game.discard.length-1] : 0; + if (game.greek.event === MINES_OF_LAURION) + view.discard = MINES_OF_LAURION; + else if (game.discard.length > 0) + view.discard = game.discard[game.discard.length-1] + else + view.discard = 0 let draw = game.greek.draw + game.persian.draw; if (draw > game.deck.length) { -- cgit v1.2.3