diff --git a/objects/MythosArea.9f334f.json b/objects/MythosArea.9f334f.json index 1eeead24..6565bb79 100644 --- a/objects/MythosArea.9f334f.json +++ b/objects/MythosArea.9f334f.json @@ -82,5 +82,5 @@ "scaleZ": 6.5 }, "Value": 0, - "XmlUI": "" + "XmlUI": "\u003cInclude src=\"MythosArea.xml\"/\u003e" } diff --git a/src/core/MythosArea.ttslua b/src/core/MythosArea.ttslua index a4f0f719..3b0cd774 100644 --- a/src/core/MythosArea.ttslua +++ b/src/core/MythosArea.ttslua @@ -201,6 +201,27 @@ function reshuffleEncounterDeck(params) Wait.time(function() isReshuffling = false end, 1) end +function discardIntoDeck() + --flag to avoid multiple calls + if isReshuffling then return end + isReshuffling = true + + -- flip deck and then shuffle + local discardPile = searchLib.atPosition(ENCOUNTER_DISCARD_POSITION, "isCardOrDeck") + if #discardPile > 0 then + local deck = discardPile[1] + if not deck.is_face_down then deck.flip() end + deck.setPositionSmooth(Vector(ENCOUNTER_DECK_POS) + Vector(0, 2, 0), false, true) + --wait until deck is in place .75 seconds, then shuffle + broadcastToAll("Shuffled encounter discard into deck.", "White") + Wait.time(function() searchLib.atPosition(ENCOUNTER_DECK_POS, "isCardOrDeck")[1].shuffle() end, .75) + else + broadcastToAll("Encounter discard pile is already empty.", "Red") + end + + -- disable flag + Wait.time(function() isReshuffling = false end, 1) +end --------------------------------------------------------- -- helper functions --------------------------------------------------------- diff --git a/xml/MythosArea.xml b/xml/MythosArea.xml new file mode 100644 index 00000000..80631181 --- /dev/null +++ b/xml/MythosArea.xml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file