Drawing from an empty deck

The Send Hotkey when Deck empties feature is interesting:

image

However, most games I know require the re-shuffle at the moment when a card is about to be drawn and the draw deck is empty. Usually it is possible that one or more cards will be discarded in the meantime. Also, perhaps the game will allow the chance of a card being taken from the discard before that re-shuffle point.

Therefore, I wonder if it would be feasible to make a variant of this deck feature that triggers when the deck receives a command to take a card ?

I’m guessing no and that in fact the logic would have to be in the Deck portion of the Global Key Command component. So, would an addition to the GKC configurator be possible ?

e.g. following “Within a Deck”, another configuration line


If Deck is Empty, Send Hotkey: ____________ (if left blank, no hotkey is sent)

Of course, this feature would need to insert itself in the middle of a multi-number operation.
At module editor level, I do this by checking the number of cards in the deck, drawing that many and then, if there are still more to draw, doing the Hotkey to re-fill the deck and drawing the rest.

Pitfall I can anticipate is what if the Hotkey doesn’t refill the Deck enough to satisfy the “apply to” number, so another check might be “if no cards arrive after the hotkey, cease”.

Your automated draw logic should probably check the map level property >DeckName<_numCards (or whatever that property is called, it’s in the Deck docs) and see if it’s zero, in which case it can fire off whatever reshuffle-the-deck logic is appropriate for your game.

Yes, that’s what I do. In fact, to draw multiples, check how many you can draw until zero. Do that; shuffle, then draw the rest. Which is easier in v3.6, with the draw “fixed” field taking an expression.

Seeing as how “shuffle when empty” is offered, it got me wondering.
I think a “shuffle when needed” option would simplify a common element in modules, but maybe the performance benefit wouldn’t be much.

I’m running into a similar situation. I created a button to draw a card which pulls from the main deck and adds to the current deck. The button works until the the main deck is empty. I can then click on my current deck and issue a reshuffle (send cards to main deck). I was trying to figure out if I could create a trigger such that if I click the draw a card button, the trigger would fire and check to see if the main deck has zero cards, in which case, do the reshuffle. But I think the context of the trigger is not smart enough? I put the trigger on the button, but maybe it doesn’t understand that the command is for the current deck?