Advertisement
TemperedFool

Deck Split

Aug 17th, 2020
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.14 KB | None | 0 0
  1. function onLoad()
  2. self.createButton({click_function = "Shuffledeck", function_owner = self, label = "Shuffle Deck", position = {0, 0.3, 0}, rotation = {0, 0, 0}, scale = {2,2,2}, width = 800, height = 300, font_size = 100, tooltip = "Place all epidemic cards in the discard pile\nPress to shuffle"})
  3. end
  4.  
  5. function Shuffledeck()
  6.     zone_guid = getObjectFromGUID('1b1018')
  7.     objectsInZone = zone_guid.getObjects()
  8.     for a,b in pairs(objectsInZone) do
  9.         deck1=b
  10.     end
  11.     zone_guid = getObjectFromGUID('da7d70')
  12.     objectsInZone = zone_guid.getObjects()
  13.     for a,b in pairs(objectsInZone) do
  14.         deck2=b
  15.     end
  16.     deck1.shuffle()
  17. if deck2 then
  18.     splits=deck2.getQuantity()
  19.     deck1split=deck1.split(splits)
  20.     for i=1, splits do
  21.         print(i, " = ", deck1split[i].getQuantity())
  22.     end
  23.     Wait.frames(function() stage1() end,10)
  24. else
  25. print("Please place the cards in the Discard Pile.")
  26. end
  27.  
  28. end
  29.  
  30. function stage1()
  31.     for I=1, splits do
  32.         epidemic=deck2.takeObject({position={25.00, -10, -20.00}})
  33.         deck1split[i].putObject(epidemic)
  34.     end
  35.     --Wait.frames(function() stage2() end,40)
  36. end
  37.  
  38. function stage2()
  39.     for i=1, splits do
  40.         deck1split[i].shuffle()
  41.     end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement