diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-05-11 12:40:52 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 12:42:59 +0100 |
commit | 305837ab0f083dd7f9f054db26ce3db10c80921a (patch) | |
tree | b9c57b93955aac07436245da8b1924f986e7d6f5 | |
parent | 90fa6f8ec7ef16640316eb0f6af933f44c41315c (diff) | |
download | 300-earth-and-water-305837ab0f083dd7f9f054db26ce3db10c80921a.tar.gz |
300 fix draw/discard display when more cards in draw queue than deck
-rw-r--r-- | rules.js | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -3251,8 +3251,6 @@ exports.view = function(state, current) { active: game.active, campaign: game.campaign, vp: game.vp, - deck_size: game.deck.length - game.greek.draw - game.persian.draw, - discard_size: game.discard.length, trigger: game.trigger, units: game.units, }; @@ -3261,6 +3259,15 @@ exports.view = function(state, current) { view.p_cards = game.persian.hand.length + game.persian.draw; view.discard = game.discard.length > 0 ? game.discard[game.discard.length-1] : 0; + let draw = game.greek.draw + game.persian.draw; + if (draw > game.deck.length) { + view.deck_size = game.deck.length + game.discard.length - draw; + view.discard_size = 0; + } else { + view.deck_size = game.deck.length - draw; + view.discard_size = game.discard.length; + } + states[game.state].prompt(view, current); view.prompt = $(view.prompt); |