summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-10-23 11:18:33 +0200
committerTor Andersson <tor@ccxvii.net>2023-02-18 12:42:59 +0100
commit4f40cad7a178b8b9409883b18f75623fe9992840 (patch)
treeaf99231d435ed933c55fb1e21f64447e131396a8
parentb9c65696a4fe0046995fa1d643126dedebed786d (diff)
download300-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.js15
1 files 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) {