1
0

deckShuffle.qsrc 628 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # deckShuffle
  2. killvar 'deckFace'
  3. killvar '$deckImg'
  4. i = 0
  5. :loop1
  6. if i < 4:
  7. i += 1
  8. if i = 1: $text = 'Spades'
  9. if i = 2: $text = 'Hearts'
  10. if i = 3: $text = 'Clubs'
  11. if i = 4: $text = 'Diamonds'
  12. j = 0
  13. :loop2
  14. if j < 13:
  15. j += 1
  16. deckFace[] = j
  17. $deckImg[] = 'images/locations/city/industrial/casino/cards/<<$text>>/<<j>>.jpg'
  18. jump 'loop2'
  19. end
  20. jump 'loop1'
  21. end
  22. i = 0
  23. :loop3
  24. if i < 52:
  25. j = rand(0, 51)
  26. temp = deckFace[i]
  27. deckFace[i] = deckFace[j]
  28. deckFace[j] = temp
  29. $text = $deckImg[i]
  30. $deckImg[i] = $deckImg[j]
  31. $deckImg[j] = $text
  32. i += 1
  33. jump 'loop3'
  34. end
  35. --- deckShuffle ---------------------------------