25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

63 satır
1.7 KiB

  1. local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
  2. local ZPSound = ZPFramework.ZPFrameworkClassImprot("zp_base.luaScript.ZPSound")
  3. local hejiangSound = class("hejiangSound", ZPSound)
  4. local path = "mj/res/sound"
  5. local luzhouPath = "luzhou/res/sound"
  6. hejiangSound.man = "c_man"
  7. hejiangSound.women = "c_women"
  8. hejiangSound.pre = "c_"
  9. hejiangSound.sound_t = 1
  10. local function dealSex(s)
  11. local sex=tonumber(s)
  12. if sex~=1 and sex~=2 then
  13. sex=1
  14. end
  15. return 2--sex
  16. end
  17. -- sound_t 1 普通话 2 方言
  18. function hejiangSound.setSoundType( sound_t )
  19. hejiangSound.sound_t = sound_t
  20. if sound_t == 1 then
  21. hejiangSound.man = "c_man"
  22. hejiangSound.women = "c_women"
  23. hejiangSound.pre = "c_"
  24. else
  25. hejiangSound.man = "man"
  26. hejiangSound.women = "women"
  27. hejiangSound.pre = ""
  28. end
  29. end
  30. function hejiangSound.PlayOperateSound(sex,opType)
  31. if hejiangSound.sound_t == 1 then--普通话
  32. hejiangSound.super.PlayOperateSound(sex,opType)
  33. else
  34. if hejiangSound.OperateSoundConfig[opType] then
  35. sex = dealSex(sex)
  36. local name = string.format("%s/%s/%sluzhou_mj_%s_%s.ogg", luzhouPath,sex ==1 and hejiangSound.man or hejiangSound.women, hejiangSound.pre, sex, hejiangSound.OperateSoundConfig[opType])
  37. playVoice(name)
  38. end
  39. end
  40. end
  41. function hejiangSound.PlayZPSound(sex,value)
  42. if hejiangSound.sound_t == 1 then--普通话
  43. hejiangSound.super.PlayZPSound(sex,value)
  44. else
  45. sex = dealSex(sex)
  46. local name = string.format("%s/%s/%sluzhou_mj_%s_%x.ogg", luzhouPath,sex ==1 and hejiangSound.man or hejiangSound.women, hejiangSound.pre, sex, value)
  47. playVoice(name)
  48. end
  49. end
  50. function hejiangSound.PlayZhaNiao()
  51. playVoice(luzhouPath.."/hz_zhuaniao.ogg")
  52. end
  53. return hejiangSound