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.

230 satır
8.5 KiB

  1. -- 跑得快
  2. local DEF = {}
  3. -- 规则文本
  4. DEF.RuleText =
  5. {
  6. --[1] =
  7. {
  8. title = "基础规则",
  9. content =
  10. {
  11. "1、牌数:52张牌不带王。",
  12. "2、游戏人数:4人,3人或2人。",
  13. "3、定庄:首局最小牌的人为庄,且必须出最小牌,之后的牌局上一局先出完牌的人为庄。",
  14. "4、王(鬼):即癞子,可代替任意一张牌。",
  15. "5、打牌规则:游戏开始后每人发牌13张,可以出任意的牌型。接牌时,有压必压,不能过牌。当自己的下家剩余一张牌时,若出单张,必须从大到小开始出。",
  16. },
  17. },
  18. --[[{
  19. title = "牌型介绍",
  20. content =
  21. {
  22. "1、单张:任意一张单牌,3<4<5<6<7<8<9<10<J<Q<K<A<2(王)。",
  23. "2、对子:两张点数相同的牌。",
  24. "3、三张:3张点数相同的牌。",
  25. "4、三带二:3个点数一样的牌和2张其他牌,可为2散张,也可为1对。",
  26. "5、顺子:最少5张起,最多13张;2可以出现,A2345为最小,10JQKA最大。",
  27. "6、连对:相连2对及以上的牌,如5566、778899,接牌的玩家必须是点数更大的连对。KKAA最大,AA22最小。",
  28. "7、飞机:两个或两个以上相连的三同张牌。如555666、JJJQQQKKK;AAAKKK最大,AAA222最小。",
  29. "8、飞机带翅膀:两个或两个以上相连的三同张牌,且每个三同张牌必须带2张牌,可为2散张,也可为1对,如5556663241、JJJQQQ4488等。不能出现带2散,或一对,如5556664489不允许。3334445555这种牌型也不允许出。且带对的带对压,带散的带散压。",
  30. "9、炸弹:只能由4张相同点数的牌为炸弹。2222最大,3333最小。",
  31. }
  32. },--]]
  33. {
  34. title = "特殊牌型",
  35. content =
  36. {
  37. "1、连对特殊牌型:7788王王,可当做778899,也可当做777888;当用作管上家时,需按照上家牌型,进行组合。当自己作为上家首出,下家需用炸弹才可以管。",
  38. "2、三带特殊牌型:555鬼K可当做555KK也可以当做555QK;555鬼鬼,可以当做555带1对,也可以当做555带2散张;55鬼鬼鬼,可以当做555KK、555QK、55222;注:以上牌型,当做管上家时,需按照上家牌型,进行组合。当自己作为上家首出,下家需用炸弹或者相同带鬼的牌型(如555鬼K可以用666鬼3管)",
  39. "3、飞机带翅膀的特殊牌型:555666鬼鬼JQ,可当做55566689JQ,也可以当做555666JJQQ;555666鬼鬼鬼A,可以当做555666JQKA,也可以当做555666KKAA;当用做管上家时,需按照上家牌型,进行组合。当自己作为上家首出,下家需用炸弹才可以管。",
  40. "4、顺子的特殊牌型:789鬼鬼,可以为78910J,也可以为78999;78鬼鬼鬼,可以为7 8 9 10 J,也可以为78222;当用做管上家时,需按照上家牌型,进行组合。当自己作为上家首出,下家需用炸弹才可以管。",
  41. }
  42. },
  43. --[[{
  44. title = "算分规则",
  45. content =
  46. {
  47. "1、游戏结束剩余手牌张数为X,颗数为1/2/4/6:X=1时,扣0分。2≤X≤5,扣1分,5<X≤9,扣2分,小关:10≤X≤12,扣4分,黑关:X=13,扣6分",
  48. "2、炸弹算分:炸弹分立即收取和支付。炸弹被压,被压的炸弹不算分,只算后面那个炸弹的分。颗数为1/2/4/6:不加王玩法:四个2的炸弹6分,普通炸弹4分;加王玩法:(硬炸)四个2的炸弹6分,普通炸弹4分;(软炸)四个2的炸弹4分,普通炸弹2分",
  49. }
  50. },--]]
  51. }
  52. -- 玩法
  53. -- 必须跟服务器保持一致,增删都需要和server及web确认
  54. DEF.GameTypes =
  55. {
  56. Normal = 0,
  57. }
  58. -- 聊天快捷语
  59. DEF.ChatMessages =
  60. {
  61. [1] = {oggStandard = "res/sound/faceSound/chat_man_1.ogg", oggLocal = "res/sound/faceSound/chat_man_1.ogg",txt = "不好意思俺刚接了个电话。"},
  62. [2] = {oggStandard = "res/sound/faceSound/chat_man_2.ogg", oggLocal = "res/sound/faceSound/chat_man_2.ogg",txt = "房间没满房主再找几个嘛!"},
  63. [3] = {oggStandard = "res/sound/faceSound/chat_man_3.ogg", oggLocal = "res/sound/faceSound/chat_man_3.ogg",txt = "爆发吧我的小宇宙,这把我要通吃!"},
  64. [4] = {oggStandard = "res/sound/faceSound/chat_man_4.ogg", oggLocal = "res/sound/faceSound/chat_man_4.ogg",txt = "哥这招一柱擎天,稳如泰山!"},
  65. [5] = {oggStandard = "res/sound/faceSound/chat_man_5.ogg", oggLocal = "res/sound/faceSound/chat_man_5.ogg",txt = "别磨蹭了,时间就是金钱!"},
  66. [6] = {oggStandard = "res/sound/faceSound/chat_man_6.ogg", oggLocal = "res/sound/faceSound/chat_man_6.ogg",txt = "哎我滴妈呀手气有点旺!"},
  67. [7] = {oggStandard = "res/sound/faceSound/chat_man_7.ogg", oggLocal = "res/sound/faceSound/chat_man_7.ogg",txt = "把把都是赢你咋不上天!"},
  68. }
  69. DEF.GameTypesStr =
  70. {
  71. [0] = "泸州跑得快",
  72. [1] = "泸州跑得快",
  73. }
  74. DEF.GamePlayerCount = {
  75. [1] = "快速成局",
  76. [2] = "2人玩",
  77. [3] = "3人玩",
  78. [4] = "4人玩",
  79. }
  80. DEF.GameWanfa = {
  81. [0] = "必须管",
  82. [1] = "可不要",
  83. }
  84. DEF.GameGui = {
  85. [0] = "无鬼",
  86. [2] = "两鬼",
  87. [3] = "三鬼",
  88. }
  89. DEF.GameKeShu = {
  90. [1] = "1/2/4/6颗",
  91. [2] = "2/4/6/8颗",
  92. [3] = "3/5/10/15颗",
  93. }
  94. DEF.CreateParamsMean = {
  95. [0x0001] = '记牌器',
  96. [0x0002] = '有大必打',
  97. [0x0004] = '报单可出单牌',
  98. [0x0008] = '铁二线',
  99. [0x0010] = '',
  100. [0x0020] = '',
  101. [0x0040] = '',
  102. [0x0080] = '',
  103. }
  104. DEF.Language = {
  105. PU_TONG_HUA = 1,
  106. FANG_YAN = 2,
  107. }
  108. --获取桌面玩法显示
  109. function DEF.getClubTableWanFaInfo(ruleStr)
  110. if not ruleStr then return "" end
  111. local jsonData = json.decode(ruleStr);
  112. local str = ""
  113. if jsonData.jokerCount and jsonData.jokerCount>=0 then
  114. local specStr = DEF.GameGui[jsonData.jokerCount] or ""
  115. if specStr ~= "" then
  116. str = str..specStr.." "
  117. end
  118. end
  119. if jsonData.keCount and jsonData.keCount>0 then
  120. local specStr = DEF.GameKeShu[jsonData.keCount] or ""
  121. if specStr ~= "" then
  122. str = str..specStr
  123. end
  124. end
  125. return str
  126. end
  127. ---
  128. -- 获取包间玩法信息
  129. -- @param gameId
  130. -- @param jushu
  131. -- @param ruleStr
  132. -- @param arena
  133. -- @return
  134. --
  135. function DEF.getRuleFromString( gameId, jushu, ruleStr,arena )
  136. local tt = {}
  137. local jushuText = string.format("%d 局",jushu);
  138. table.insert(tt, {name = "局数", value = {jushuText}})
  139. local jsonData = json.decode(ruleStr)
  140. if jsonData.deductRule and jsonData.deductRule >= 0 then
  141. local specStr =jsonData.deductRule==0 and "房主付费" or "AA付费"
  142. if specStr ~= "" then
  143. table.insert(tt, {name = "房费", value = {specStr}})
  144. end
  145. end
  146. if jsonData.gamerule and jsonData.gamerule>0 then
  147. local specStr = DEF.GameTypesStr[jsonData.gamerule] or ""
  148. if specStr ~= "" then
  149. table.insert(tt, {name = "玩法", value = {specStr}})
  150. end
  151. end
  152. if jsonData.jokerCount and jsonData.jokerCount>0 then
  153. local specStr = DEF.GameGui[jsonData.jokerCount] or ""
  154. if specStr ~= "" then
  155. table.insert(tt, {name = "带鬼", value = {specStr}})
  156. end
  157. end
  158. if jsonData.keCount and jsonData.keCount>0 then
  159. local specStr = DEF.GameKeShu[jsonData.keCount] or ""
  160. if specStr ~= "" then
  161. table.insert(tt, {name = "颗数", value = {specStr}})
  162. end
  163. end
  164. if jsonData.playnum and jsonData.playnum>=0 then
  165. local specStr = DEF.GamePlayerCount[jsonData.playnum] or ""
  166. if specStr ~= "" then
  167. table.insert(tt, {name = "人数", value = {specStr}})
  168. end
  169. end
  170. local function getRule( rule )
  171. local CreateParamsMean = DEF.CreateParamsMean
  172. local ruleStr = ""
  173. if getNumBand(rule, 0x0001)>0 then
  174. ruleStr = ruleStr..CreateParamsMean[0x0001]..","
  175. end
  176. if getNumBand(rule, 0x0002)>0 then
  177. ruleStr = ruleStr..CreateParamsMean[0x0002]..","
  178. end
  179. if getNumBand(rule, 0x0008)>0 then
  180. ruleStr = ruleStr..CreateParamsMean[0x0008]..","
  181. end
  182. if string.len(ruleStr) > 0 then
  183. ruleStr = string.sub(ruleStr, 1, string.len(ruleStr)-1)
  184. end
  185. return ruleStr
  186. end
  187. if jsonData.specialRule and jsonData.specialRule>=0 then
  188. local specStr = getRule(jsonData.specialRule)
  189. if specStr ~= "" then
  190. table.insert(tt, {name = "可选", value = {specStr}})
  191. end
  192. end
  193. if jsonData.baseMulti and jsonData.baseMulti > 0 then
  194. table.insert(tt, {name = "积分倍数", value = {"积分倍数x" .. jsonData.baseMulti}})
  195. end
  196. if jsonData.forbidProp and jsonData.forbidProp > 0 then
  197. table.insert(tt, {name = "其他", value = {"屏蔽聊天与互动道具"}})
  198. end
  199. return tt
  200. end
  201. ---
  202. -- 获取包间多玩法桌子上显示的信息
  203. -- @param gameId
  204. -- @param ruleStr
  205. -- @param playerNum
  206. -- @return
  207. --
  208. function DEF.getClubTableRuleString( gameId, ruleStr, playerNum )
  209. local str = DEF.getClubTableWanFaInfo(ruleStr)
  210. return str
  211. end
  212. return DEF