You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
3.0 KiB

  1. function musicController(orders, toggling)
  2. if (orders == 'norm' and not mute) then
  3. if (globalState == 'menu') then
  4. sounds['gayTheme']:stop()
  5. sounds['gayTheme2']:stop()
  6. sounds['gayTheme3']:stop()
  7. sounds['gayTheme4']:stop()
  8. sounds['updateMusic']:play()
  9. elseif (areanuclear == 1) then
  10. sounds['gayTheme']:setVolume(0)
  11. sounds['gayTheme2']:setVolume(0)
  12. elseif ((gameState == 'play' or gameState == '1serve' or gameState == '2serve') and (player1score <= ptw*0.5 and player2score <= ptw*0.5 and areanuclear == 0) and not freePlay) then
  13. sounds['updateMusic']:stop()
  14. sounds['gayTheme2']:stop()
  15. sounds['gayTheme3']:stop()
  16. sounds['gayTheme4']:stop()
  17. sounds['gayTheme']:setPitch(1)
  18. sounds['gayTheme']:setLooping(true)
  19. sounds['gayTheme']:setVolume(0.5)
  20. sounds['gayTheme']:play()
  21. elseif gameState == 'play' and areanuclear == 0 and ((AGAINST_AI == 1 and player1score >= ptw*0.8 and player2score < ptw*0.8) or (globalState == "nettest" and player1score > ptw*0.8 and player2score <= ptw*0.8) or (globalState == "clienttest" and player2score > ptw*0.8 and player1score <= ptw*0.8) and not freePlay) then
  22. --print(ptw*0.8)
  23. sounds['gayTheme']:stop()
  24. sounds['gayTheme2']:stop()
  25. sounds['gayTheme3']:stop()
  26. sounds['updateMusic']:stop()
  27. sounds['gayTheme4']:setPitch(1)
  28. sounds['gayTheme4']:setLooping(true)
  29. sounds['gayTheme4']:setVolume(0.5)
  30. sounds['gayTheme4']:play()
  31. elseif gameState == 'play' and (player1score >= ptw*0.8 or player2score > ptw*0.8) and areanuclear == 0 and not freePlay then
  32. --print(ptw*0.8)
  33. sounds['gayTheme']:stop()
  34. sounds['gayTheme4']:stop()
  35. sounds['gayTheme3']:stop()
  36. sounds['updateMusic']:stop()
  37. sounds['gayTheme2']:setPitch(1)
  38. sounds['gayTheme2']:setLooping(true)
  39. sounds['gayTheme2']:setVolume(0.5)
  40. sounds['gayTheme2']:play()
  41. elseif gameState == 'play' and (player1score > ptw*0.5 or player2score > ptw*0.5 or freePlay) and areanuclear == 0 then
  42. --print(ptw-4)
  43. sounds['gayTheme']:stop()
  44. sounds['gayTheme2']:stop()
  45. sounds['gayTheme4']:stop()
  46. sounds['updateMusic']:stop()
  47. sounds['gayTheme3']:setPitch(1)
  48. sounds['gayTheme3']:setLooping(true)
  49. sounds['gayTheme3']:setVolume(0.5)
  50. sounds['gayTheme3']:play()
  51. end
  52. elseif orders == "mute" then
  53. if toggling == 1 then
  54. sounds['gayTheme']:stop()
  55. sounds['gayTheme3']:stop()
  56. sounds['gayTheme2']:stop()
  57. sounds['gayTheme4']:stop()
  58. sounds['updateMusic']:stop()
  59. mute = true
  60. else
  61. mute = false
  62. end
  63. end
  64. end