|
- -- 合江跑得快
- 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<X≤9,扣2分,小关:10≤X≤12,扣4分,黑关:X=13,扣6分",
- "2、炸弹算分:炸弹分立即收取和支付。炸弹被压,被压的炸弹不算分,只算后面那个炸弹的分。颗数为1/2/4/6:不加王玩法:四个2的炸弹4分,普通炸弹2分。加王玩法:四个2的炸弹4分,普通炸弹2分。",
- }
- },--]]
- }
-
- -- 玩法
- -- 必须跟服务器保持一致,增删都需要和server及web确认
- DEF.GameTypes =
- {
- Normal = 1,
- }
-
- -- 聊天快捷语
- DEF.ChatMessages =
- {
- [1] = {oggStandard = "res/sound/faceSound/chat_man_1.ogg", oggLocal = "res/sound/faceSound/chat_man_1.ogg",txt = "不好意思俺刚接了个电话。"},
- [2] = {oggStandard = "res/sound/faceSound/chat_man_2.ogg", oggLocal = "res/sound/faceSound/chat_man_2.ogg",txt = "房间没满房主再找几个嘛!"},
- [3] = {oggStandard = "res/sound/faceSound/chat_man_3.ogg", oggLocal = "res/sound/faceSound/chat_man_3.ogg",txt = "爆发吧我的小宇宙,这把我要通吃!"},
- [4] = {oggStandard = "res/sound/faceSound/chat_man_4.ogg", oggLocal = "res/sound/faceSound/chat_man_4.ogg",txt = "哥这招一柱擎天,稳如泰山!"},
- [5] = {oggStandard = "res/sound/faceSound/chat_man_5.ogg", oggLocal = "res/sound/faceSound/chat_man_5.ogg",txt = "别磨蹭了,时间就是金钱!"},
- [6] = {oggStandard = "res/sound/faceSound/chat_man_6.ogg", oggLocal = "res/sound/faceSound/chat_man_6.ogg",txt = "哎我滴妈呀手气有点旺!"},
- [7] = {oggStandard = "res/sound/faceSound/chat_man_7.ogg", oggLocal = "res/sound/faceSound/chat_man_7.ogg",txt = "把把都是赢你咋不上天!"},
- }
-
- DEF.GameTypesStr =
- {
- [0] = "合江跑得快",
- [1] = "合江跑得快",
- }
-
- DEF.GamePlayerCount = {
- [1] = "快速成局",
- [2] = "2人玩",
- [3] = "3人玩",
- [4] = "4人玩",
- }
-
- DEF.GameWanfa = {
- [0] = "必须管",
- [1] = "可不要",
- }
-
- DEF.GameGui = {
- [0] = "无鬼",
- [2] = "两鬼",
- [3] = "三鬼",
- }
-
- DEF.GameKeShu = {
- [1] = "1/2/4/6颗",
- [2] = "2/4/7/10颗",
- [3] = "3/5/10/15颗",
- }
-
- DEF.CreateParamsMean = {
- [0x0001] = '记牌器',
- [0x0002] = '有大必打',
- }
-
- DEF.GameTieYiXian = {
- [0] = "",
- [1] = "铁一线",
- }
-
- DEF.GameSanDaiYi= {
- [0] = "三带一不可出",
- [1] = "三带一可出",
- }
-
- DEF.Language = {
- PU_TONG_HUA = 1,
- FANG_YAN = 2,
- }
-
- --获取玩法规则
- function DEF.getRuleInfo(ruleStr)
- return "hejiangpdkwanfa"
- end
-
- --获取茶馆玩法规则
- function DEF.getClubRuleInfo(ruleStr, jushu)
- if not ruleStr then
- ruleStr = app.room.roomInfo.strGameInfo
- end
- --return "luzhouclubwanfa"
- local temp = {}
-
- if jushu then
- local jushuText = string.format("%d 局", jushu);
- table.insert(temp, 1, {name = "局数", value = {jushuText}})
- end
-
- local jsonData=json.decode(ruleStr)
- if jsonData.deductRule and jsonData.deductRule >= 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
|