Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Script for clearing the board after a game --]]
- function onLoad(save_state)
- local button = {index = 0, click_function = 'returnAllCubes', function_owner = self,
- label = 'Clear Board', position = {x = 0, y = 1, z = 0}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 2, y = 1, z = 2}, width = 3100, height = 500, font_size = 350,
- font_color = {r = 0, g = 0, b = 0, a = 1}}
- button.color = self.getColorTint()
- self.createButton(button)
- end
- local bigYellow = '7add2e'
- local bigRed = '9aa8c4'
- local bigBlue = '3cff2e'
- local bigBlack = 'e4fe2d'
- local bigFaded = 'd7cdee'
- function returnAllCubes()
- returnCubes(bigYellow,'yell')
- returnCubes(bigRed,'red0')
- returnCubes(bigBlue,'blue')
- returnCubes(bigBlack,'blac')
- returnCubes(bigFaded,'fade')
- end
- function returnCubes(bigCubeGUID,colour)
- bigCube = getObjectFromGUID(bigCubeGUID)
- if colour == 'fade' then
- j = 37
- else
- j = 24
- end
- for i=1,j do
- if i < 10 then
- guid = colour..'0'..i
- else
- guid = colour..i
- end
- local obj = getObjectFromGUID(guid)
- if obj != null then
- bigCube.putObject(obj)
- end
- end
- end
- --[[ Script for getting the bottom card --]]
- function onLoad(save_state)
- local button = {index = 0, click_function = 'drawBottomCard', function_owner = self,
- label = 'Draw Bottom Card', position = {x = 0, y = 1, z = 0}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 2, y = 1, z = 2}, width = 3100, height = 500, font_size = 350,
- font_color = {r = 0, g = 0, b = 0, a = 1}}
- button.color = self.getColorTint()
- self.createButton(button)
- end
- function drawBottomCard()
- deck = getObjectFromGUID('d69851')
- num = deck.getQuantity()
- deck.takeObject({
- index = num -1,
- flip = true,
- position = {35, 1.5, 22}
- })
- end
- --[[ Script for setting up the deck --]]
- function onLoad(save_state)
- local button = {index = 0, click_function = 'SetupPlayerDeck', function_owner = self,
- label = 'Setup Deck', position = {x = 0, y = 1, z = 0}, rotation = {x = 0, y = 0, z = 0},
- scale = {x = 2, y = 1, z = 2}, width = 3100, height = 500, font_size = 350,
- font_color = {r = 0, g = 0, b = 0, a = 1}}
- button.color = self.getColorTint()
- self.createButton(button)
- end
- function SetupPlayerDeck()
- playerDeckZone = getObjectFromGUID('zone02')
- for a,b in pairs(playerDeckZone.getObjects()) do
- playerDeck=b
- end
- epidemicDeckZone = getObjectFromGUID('zone03')
- for a,b in pairs(epidemicDeckZone.getObjects()) do
- epidemicDeck=b
- end
- playerDeck.shuffle()
- players = getSeatedPlayers()
- if players == 2 then
- playerDeck.deal(4)
- end
- if players == 3 then
- playerDeck.deal(3)
- end
- if players == 4 then
- playerDeck.deal(2)
- end
- if epidemicDeck then
- deck1split=playerDeck.split(5)
- Wait.frames(function() stage1() end,10)
- else
- broadcastToAll("Place all epidemic cards on the discard pile")
- end
- end
- function stage1()
- for i=1, 5 do
- deck1split[i].setPosition({-40+(8*i), -28, -20})
- deck1split[i].setRotation({0,180,180})
- end
- for i=1, 5 do
- epidemic=epidemicDeck.takeObject({position={25.00, -10, -20.00}})
- deck1split[i].putObject(epidemic)
- end
- Wait.frames(function() stage2() end,40)
- end
- function stage2()
- for i=1, 5 do
- deck1split[i].shuffle()
- end
- Wait.frames(function() stage3() end,40)
- end
- function stage3()
- for i=1, 5 do
- deck1split[i].setPosition({21.8, 2+(i*2), -20})
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment