From 199fa6b77cfe4863a18b838c9e26a2e75952a66d Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Tue, 2 Jul 2024 11:40:08 +0200 Subject: [PATCH] Updated Patrice handling --- src/playermat/Playermat.ttslua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/playermat/Playermat.ttslua b/src/playermat/Playermat.ttslua index 4e2b61f5..9e7d5018 100644 --- a/src/playermat/Playermat.ttslua +++ b/src/playermat/Playermat.ttslua @@ -396,19 +396,17 @@ function doUpkeep(_, clickedByColor, isRightClick) end end - local j = 0 - local k = 0 - - for i = #cardsToDiscard, 1, -1 do - j = j + 1 - Wait.time(function() deckLib.placeOrMergeIntoDeck(cardsToDiscard[i], returnGlobalDiscardPosition(), self.getRotation()) end, j * 0.1) + -- perform discarding 1 by 1 + local pos = returnGlobalDiscardPosition() + local count = #cardsToDiscard + for i = count, 1, -1 do + Wait.time(function() deckLib.placeOrMergeIntoDeck(cardsToDiscard[i], pos, rot) end, (count - i + 1) * 0.1) end -- add some time if there are any cards to discard, if not, draw up to 5 immediately - if j > 0 then - k = 0.7 + (j * 0.1) - else - k = 0 + local k = 0 + if count > 0 then + k = 1 + (count * 0.1) end Wait.time(function()