-- 合江跑得快 local DEF = {} -- 规则文本 DEF.RuleText = { --[1] = { title = "基础规则", content = { "1、牌数:52张牌加2张大小王。", "2、游戏人数:4人,3人或2人。", "3、定庄:首局最小牌的人为庄,且必须出最小牌,之后的牌局上一局先出完牌的人为庄。", "4、王(鬼):即癞子,可代替任意一张牌。", "5、打牌规则:游戏开始后每人发牌13张,可以出任意的牌型。接牌时,有压必压,不能过牌。当自己的下家剩余一张牌时,若出单张,必须从大到小开始出。", "6、乱带:上家3带一对出牌,下家可以3带2单张出牌,反过来也一样。", }, }, --[2] = --[[{ title = "牌型介绍", content = { "1、单张:任意一张单牌,3<4<5<6<7<8<9<10<J<Q<K<A<2。", "2、对子:两张点数相同的牌。", "3、三张:3张点数相同的牌。", "4、三带二:3个点数一样的牌和2张其他牌,可为2散张,也可为1对。", "5、顺子:最少5张起,最多13张;2可以出现,A2345为最小,10JQKA最大。", "6、连对:相连2对及以上的牌,如5566、778899,接牌的玩家必须是点数更大的连对。KKAA最大,AA22最小。", "7、飞机:两个或两个以上相连的三同张牌。如555666、JJJQQQKKK;AAAKKK最大,AAA222最小。", "8、飞机带翅膀:两个或两个以上相连的三同张牌,且每个三同张牌必须带2张牌。", "9、炸弹:只能由4张相同点数的牌为炸弹。2222最大,3333最小。", } }, --[3] = { title = "特殊牌型", content = { "1、连对特殊牌型:7788王王,可当做778899,也可当做777888;当用作管上家时,需按照上家牌型,进行组合。当自己作为上家首出,下家需用炸弹才可以管。", "2、顺子的特殊牌型:789鬼鬼,可以为78910J,也可以为78999;当用做管上家时,需按照上家牌型,进行组合。当自己作为上家首出,下家需用炸弹才可以管。", } }, --[4] = { title = "算分规则", content = { "1、游戏结束剩余手牌张数为X,颗数为1/2/4/6:X=1时,扣0分。2≤X≤5,扣1分,5= 0 then local specStr =jsonData.deductRule==0 and "房主付费" or "AA付费" if specStr ~= "" then table.insert(temp, {name = "房费", value = {specStr}}) end end if jsonData.gamerule and jsonData.gamerule>0 then local specStr = DEF.GameTypesStr[jsonData.gamerule] or "" if specStr ~= "" then table.insert(temp, {name = "玩法", value = {specStr}}) end end if jsonData.jokerCount and jsonData.jokerCount>0 then local specStr = DEF.GameGui[jsonData.jokerCount] or "" if specStr ~= "" then table.insert(temp, {name = "带鬼", value = {specStr}}) end end if jsonData.keCount and jsonData.keCount>0 then local specStr = DEF.GameKeShu[jsonData.keCount] or "" if specStr ~= "" then table.insert(temp, {name = "颗数", value = {specStr}}) end end if jsonData.playnum and jsonData.playnum>=0 then local specStr = DEF.GamePlayerCount[jsonData.playnum] or "" if specStr ~= "" then table.insert(temp, {name = "人数", value = {specStr}}) end end local function getRule( rule ) local CreateParamsMean = DEF.CreateParamsMean local ruleStr = "" if getNumBand(rule, 0x0001)>0 then ruleStr = ruleStr..CreateParamsMean[0x0001].."," end if getNumBand(rule, 0x0002)>0 then ruleStr = ruleStr..CreateParamsMean[0x0002].."," end if string.len(ruleStr) > 0 then ruleStr = string.sub(ruleStr, 1, string.len(ruleStr)-1) end return ruleStr end if jsonData.specialRule and jsonData.specialRule>=0 then local specStr = getRule(jsonData.specialRule) if specStr ~= "" then table.insert(temp, {name = "可选", value = {specStr}}) end end if jsonData.tieyixian and jsonData.tieyixian>=0 then local specStr = DEF.GameTieYiXian[jsonData.tieyixian] or "" if specStr ~= "" then table.insert(temp, {name = "铁一线", value = {specStr}}) end end if jsonData.endsandaiyi and jsonData.endsandaiyi>=0 then local specStr = DEF.GameSanDaiYi[jsonData.endsandaiyi] or "" if specStr ~= "" then table.insert(temp, {name = "末手", value = {specStr}}) end end if jsonData.baseMulti and jsonData.baseMulti > 0 then table.insert(temp, {name = "积分倍数", value = {"积分倍数x" .. jsonData.baseMulti}}) end if jsonData.forbidProp and jsonData.forbidProp > 0 then table.insert(temp, {name = "其他", value = {"屏蔽聊天与互动道具"}}) end return temp end --获取桌面玩法显示 function DEF.getClubTableWanFaInfo(ruleStr) if not ruleStr then return "" end local jsonData = json.decode(ruleStr); local str = "" if jsonData.jokerCount and jsonData.jokerCount>=0 then local specStr = DEF.GameGui[jsonData.jokerCount] or "" if specStr ~= "" then str = str..specStr.." " end end if jsonData.keCount and jsonData.keCount>0 then local specStr = DEF.GameKeShu[jsonData.keCount] or "" if specStr ~= "" then str = str..specStr end end return str end --- -- 获取包间玩法信息 -- @param gameId -- @param jushu -- @param ruleStr -- @param arena -- @return -- function DEF.getRuleFromString( gameId, jushu, ruleStr,arena ) local str = DEF.getClubRuleInfo(ruleStr, jushu) return str end --- -- 获取包间多玩法桌子上显示的信息 -- @param gameId -- @param ruleStr -- @param playerNum -- @return -- function DEF.getClubTableRuleString( gameId, ruleStr, playerNum ) local str = DEF.getClubTableWanFaInfo(ruleStr) return str end return DEF