diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-10-23 11:18:33 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:42:59 +0100 |
commit | 4f40cad7a178b8b9409883b18f75623fe9992840 (patch) | |
tree | af99231d435ed933c55fb1e21f64447e131396a8 | |
parent | b9c65696a4fe0046995fa1d643126dedebed786d (diff) | |
download | 300-earth-and-water-4f40cad7a178b8b9409883b18f75623fe9992840.tar.gz |
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.
-rw-r--r-- | rules.js | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -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) { |