Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

128 рядки
4.4 KiB

  1. local PKDef = PKFramework.PKImport("pk_base.luaScript.PKDef")
  2. local PKSound = PKFramework.PKFrameworkClassImprot("pk_base.luaScript.PKSound")
  3. local bzpSound = class("bzpSound", PKSound)
  4. local path = "pk_banzipao/res/Sound"
  5. function bzpSound.playVoiceCardValue(sex,card,cardType)
  6. sex = PKSound.dealSex(sex)
  7. local man = (sex == 1 and "man" or "woman")
  8. local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
  9. local lanType = tonumber(loadUserInfo(cacheLan)) or 1
  10. local yuyan = (lanType == 1 and "putonghua" or "fangyan")
  11. local yuyan2 = (lanType == 1 and "1" or "2")
  12. local name = ""
  13. if PKDef.CARD_TYPE.BANZIPAO_TYPE_SINGLE == cardType then
  14. name = string.format("%s/languange/%s/%d_%s_%s.ogg",path,yuyan,card,man,yuyan2)
  15. elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_DUIZI == cardType then
  16. name = string.format("%s/languange/%s/dui%d_%s_%s.ogg",path,yuyan,card,man,yuyan2)
  17. elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SHUNZI == cardType then
  18. name = string.format("%s/languange/%s/shunzi_%s_%s.ogg",path,yuyan,man,yuyan2)
  19. elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SANZHANG == cardType then
  20. name = string.format("%s/languange/%s/zhadan_%s_%s.ogg",path,yuyan,man,yuyan2)
  21. bzpSound.PlayBombBg()
  22. elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SHUANGSHUN == cardType then
  23. name = string.format("%s/languange/%s/bzp_%s_%s.ogg",path,yuyan,man,yuyan2)
  24. elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_BOMB == cardType then
  25. -- name = string.format("%s/languange/%s/zhadan_%s_%s.ogg",path,yuyan,man,yuyan2)
  26. name = string.format("%s/languange/%s/qd%d_%s_%s.ogg",path,yuyan,card,man,yuyan2)
  27. bzpSound.PlayBombBg()
  28. elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SANSHUN == cardType then
  29. name = string.format("%s/languange/%s/guntong_%s_%s.ogg",path,yuyan,man,yuyan2)
  30. elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SISHUN == cardType then
  31. name = string.format("%s/languange/%s/gunlong_%s_%s.ogg",path,yuyan,man,yuyan2)
  32. end
  33. if name ~= "" then
  34. playVoice(name)
  35. end
  36. end
  37. function bzpSound.PlayBaoPaiSound(sex,opType)
  38. sex = PKSound.dealSex(sex)
  39. local man = (sex == 1 and "man" or "woman")
  40. local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
  41. local lanType = tonumber(loadUserInfo(cacheLan)) or 1
  42. local yuyan = (lanType == 1 and "putonghua" or "fangyan")
  43. local yuyan2 = (lanType == 1 and "1" or "2")
  44. local file = ""
  45. if opType == PKDef.BaoPai.BAOPAI then
  46. file = "baopai"
  47. elseif opType == PKDef.BaoPai.BUBAO then
  48. file = "bubao"
  49. elseif opType == PKDef.BaoPai.FANBAO then
  50. file = "fanbao"
  51. elseif opType == PKDef.BaoPai.BUFAN then
  52. file = "bufan"
  53. end
  54. local name = string.format("%s/languange/%s/%s_1_%s_%s.ogg",path,yuyan,file,man,yuyan2)
  55. playVoice(name)
  56. end
  57. function bzpSound.PlayBuYaoSound(sex)
  58. sex = PKSound.dealSex(sex)
  59. local man = (sex == 1 and "man" or "woman")
  60. local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
  61. local lanType = tonumber(loadUserInfo(cacheLan)) or 1
  62. local yuyan = (lanType == 1 and "putonghua" or "fangyan")
  63. local yuyan2 = (lanType == 1 and "1" or "2")
  64. local file = ""
  65. math.randomseed(tostring(os.time()):reverse():sub(1, 7))
  66. file = math.random(1,4)
  67. local name = string.format("%s/languange/%s/buyao_%d_%s_%s.ogg",path,yuyan,file,man,yuyan2)
  68. playVoice(name)
  69. end
  70. function bzpSound.PlayJiaoPaiSound(sex)
  71. sex = PKSound.dealSex(sex)
  72. local man = (sex == 1 and "man" or "woman")
  73. local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
  74. local lanType = tonumber(loadUserInfo(cacheLan)) or 1
  75. local yuyan = (lanType == 1 and "putonghua" or "fangyan")
  76. local yuyan2 = (lanType == 1 and "1" or "2")
  77. local name = string.format("%s/languange/%s/jiaopai_1_%s_%s.ogg",path,yuyan,man,yuyan2)
  78. playVoice(name)
  79. end
  80. --baojing
  81. function bzpSound.PlayLeftNumSound(sex,leftNum)
  82. sex = PKSound.dealSex(sex)
  83. local man = (sex == 1 and "man" or "woman")
  84. local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
  85. local lanType = tonumber(loadUserInfo(cacheLan)) or 1
  86. local yuyan = (lanType == 1 and "putonghua" or "fangyan")
  87. local yuyan2 = (lanType == 1 and "1" or "2")
  88. local name = string.format("%s/languange/%s/baojing_%d_%s_%s.ogg",path,yuyan,leftNum,man,yuyan2)
  89. playVoice(name)
  90. end
  91. -- 炸弹bgm
  92. function bzpSound.PlayBombBg()
  93. local name = 'pk_base/res/Sound/pk_Special_Bomb_New.ogg'
  94. playVoice(name)
  95. end
  96. -- 小结算胜利bgm
  97. function bzpSound.PlayWinSound()
  98. local name = 'pk_base/res/Sound/pk_MusicEx_Win.ogg'
  99. playVoice(name)
  100. end
  101. function bzpSound.PlayLoseSound()
  102. local name = 'pk_base/res/Sound/pk_MusicEx_Lose.ogg'
  103. playVoice(name)
  104. end
  105. return bzpSound