|
- local PKDef = PKFramework.PKImport("pk_base.luaScript.PKDef")
- local PKSound = PKFramework.PKFrameworkClassImprot("pk_base.luaScript.PKSound")
-
- local bzpSound = class("bzpSound", PKSound)
-
- local path = "pk_banzipao/res/Sound"
-
- function bzpSound.playVoiceCardValue(sex,card,cardType)
- sex = PKSound.dealSex(sex)
- local man = (sex == 1 and "man" or "woman")
- local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
- local lanType = tonumber(loadUserInfo(cacheLan)) or 1
- local yuyan = (lanType == 1 and "putonghua" or "fangyan")
- local yuyan2 = (lanType == 1 and "1" or "2")
- local name = ""
-
- if PKDef.CARD_TYPE.BANZIPAO_TYPE_SINGLE == cardType then
- name = string.format("%s/languange/%s/%d_%s_%s.ogg",path,yuyan,card,man,yuyan2)
- elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_DUIZI == cardType then
- name = string.format("%s/languange/%s/dui%d_%s_%s.ogg",path,yuyan,card,man,yuyan2)
- elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SHUNZI == cardType then
- name = string.format("%s/languange/%s/shunzi_%s_%s.ogg",path,yuyan,man,yuyan2)
- elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SANZHANG == cardType then
- name = string.format("%s/languange/%s/zhadan_%s_%s.ogg",path,yuyan,man,yuyan2)
- bzpSound.PlayBombBg()
- elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SHUANGSHUN == cardType then
- name = string.format("%s/languange/%s/bzp_%s_%s.ogg",path,yuyan,man,yuyan2)
- elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_BOMB == cardType then
- -- name = string.format("%s/languange/%s/zhadan_%s_%s.ogg",path,yuyan,man,yuyan2)
- name = string.format("%s/languange/%s/qd%d_%s_%s.ogg",path,yuyan,card,man,yuyan2)
- bzpSound.PlayBombBg()
- elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SANSHUN == cardType then
- name = string.format("%s/languange/%s/guntong_%s_%s.ogg",path,yuyan,man,yuyan2)
- elseif PKDef.CARD_TYPE.BANZIPAO_TYPE_SISHUN == cardType then
- name = string.format("%s/languange/%s/gunlong_%s_%s.ogg",path,yuyan,man,yuyan2)
- end
-
- if name ~= "" then
- playVoice(name)
- end
- end
-
- function bzpSound.PlayBaoPaiSound(sex,opType)
- sex = PKSound.dealSex(sex)
- local man = (sex == 1 and "man" or "woman")
- local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
- local lanType = tonumber(loadUserInfo(cacheLan)) or 1
- local yuyan = (lanType == 1 and "putonghua" or "fangyan")
- local yuyan2 = (lanType == 1 and "1" or "2")
-
- local file = ""
- if opType == PKDef.BaoPai.BAOPAI then
- file = "baopai"
- elseif opType == PKDef.BaoPai.BUBAO then
- file = "bubao"
- elseif opType == PKDef.BaoPai.FANBAO then
- file = "fanbao"
- elseif opType == PKDef.BaoPai.BUFAN then
- file = "bufan"
- end
-
- local name = string.format("%s/languange/%s/%s_1_%s_%s.ogg",path,yuyan,file,man,yuyan2)
-
- playVoice(name)
- end
-
- function bzpSound.PlayBuYaoSound(sex)
- sex = PKSound.dealSex(sex)
- local man = (sex == 1 and "man" or "woman")
- local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
- local lanType = tonumber(loadUserInfo(cacheLan)) or 1
- local yuyan = (lanType == 1 and "putonghua" or "fangyan")
- local yuyan2 = (lanType == 1 and "1" or "2")
-
- local file = ""
- math.randomseed(tostring(os.time()):reverse():sub(1, 7))
- file = math.random(1,4)
-
- local name = string.format("%s/languange/%s/buyao_%d_%s_%s.ogg",path,yuyan,file,man,yuyan2)
-
- playVoice(name)
- end
-
- function bzpSound.PlayJiaoPaiSound(sex)
- sex = PKSound.dealSex(sex)
- local man = (sex == 1 and "man" or "woman")
- local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
- local lanType = tonumber(loadUserInfo(cacheLan)) or 1
- local yuyan = (lanType == 1 and "putonghua" or "fangyan")
- local yuyan2 = (lanType == 1 and "1" or "2")
-
- local name = string.format("%s/languange/%s/jiaopai_1_%s_%s.ogg",path,yuyan,man,yuyan2)
-
- playVoice(name)
- end
-
- --baojing
- function bzpSound.PlayLeftNumSound(sex,leftNum)
- sex = PKSound.dealSex(sex)
- local man = (sex == 1 and "man" or "woman")
- local cacheLan = "LanguageType"..(PKDef.GameID or app.gameId)
- local lanType = tonumber(loadUserInfo(cacheLan)) or 1
- local yuyan = (lanType == 1 and "putonghua" or "fangyan")
- local yuyan2 = (lanType == 1 and "1" or "2")
-
- local name = string.format("%s/languange/%s/baojing_%d_%s_%s.ogg",path,yuyan,leftNum,man,yuyan2)
-
- playVoice(name)
- end
-
- -- 炸弹bgm
- function bzpSound.PlayBombBg()
- local name = 'pk_base/res/Sound/pk_Special_Bomb_New.ogg'
- playVoice(name)
- end
-
- -- 小结算胜利bgm
- function bzpSound.PlayWinSound()
- local name = 'pk_base/res/Sound/pk_MusicEx_Win.ogg'
- playVoice(name)
- end
-
- function bzpSound.PlayLoseSound()
- local name = 'pk_base/res/Sound/pk_MusicEx_Lose.ogg'
- playVoice(name)
- end
-
- return bzpSound
|