CMD_GAME_21201 = new cc.Class({ //window. ctor:function () { ////////////////////////////////////////////////////////////////////////// //公共宏定义 //测试模式 this.TMP_TEST = false; this.KIND_ID = 21201; //游戏 I D this.GAME_PLAYER = 4; //游戏人数 this.MYSELF_VIEW_ID = 2; this.MAX_WEAVE = 5; //最大组合 this.MAX_INDEX = 42; //最大索引 this.MAX_COUNT = 17; //最大数目 this.CARD_COUNT = 16; this.MAX_REPERTORY = 144; //最大库存 this.HEAP_FULL_COUNT = 34; //堆立全牌 this.MAX_RIGHT_COUNT = 1; //最大权位DWORD个数 this.GAME_SCENE_FREE = 0; //等待开始 this.GAME_SCENE_PLAY = 100; //游戏进行 this.GAME_SCENE_DOUBLE = this.GAME_SCENE_PLAY+1; //加倍状态 this.cbLianZhuangCount = 0; SERVER_RULES_GENERAL =0X00000010 ; //普通激情 this.dwChiHuRightAdd = 0; ////////////////////////////////////////////////////////////////////////// //逻辑掩码 this.MASK_COLOR = 0xF0; //花色掩码 this.MASK_VALUE = 0x0F; //数值掩码 ////////////////////////////////////////////////////////////////////////// //人数 this.GAME_RULE_RENSHU_2 =0x00040000; //2人 18 this.GAME_RULE_RENSHU_0 =0x00020000; //3人 17 this.GAME_RULE_RENSHU_1 =0x00010000; //4人 16 //局数 this.GAME_RULE_JUSHU_2 =0x00080000; //局数8 this.GAME_RULE_JUSHU_3 =0x00100000; //局数12 this.GAME_RULE_JUSHU_4 =0x00200000; //局数16 ////////////////////////////////////////////////////////////////////////// // 游戏规则 this.GAME_RULE_TUOGUAN_15 =0x00000001; //60秒 0 this.GAME_RULE_TUOGUAN_30 =0x00000002; //90秒 1 this.GAME_RULE_TUOGUAN_60 =0x00000004; //120秒 2 this.GAME_RULE_TUOGUAN_NONE =0x00000008; //无托管 3 this.GAME_RULE_RENSHU_LIMIT =0x00000010; //不可少人开局 4 // this.GAME_RULE_JUSHU_1 =0x00000020; //局数4 5 // this.GAME_RULE_JUSHU_2 =0x00000040; //局数8 6 // this.GAME_RULE_JUSHU_3 =0x00000080; //局数12 7 // this.GAME_RULE_JUSHU_4 =0x00000100; //局数16 8 this.GAME_RULE_SP_6 =0x00000200; //庄家无台 9 this.GAME_RULE_SP_7 =0x00000400; //红中玩法 10 // this.GAME_RULE_RENSHU_0 =0x00000800; //3人 11 // this.GAME_RULE_RENSHU_1 =0x00001000; //4人 12 // this.GAME_RULE_RENSHU_2 =0x00002000; //2人 13 this.GAME_RULE_SP_1 =0x00004000; //点炮胡 14 this.GAME_RULE_SP_2 =0x00008000; //自摸胡 15 this.GAME_RULE_SP_3 =0x00010000; //飘123 16 this.GAME_RULE_SP_4 =0x00020000; //不下嘴 17 this.GAME_RULE_SP_5 =0x00040000; //飘135 18 this.GAME_RULE_SP_8 =0x00080000; //飘2 19 this.GAME_RULE_SP_9 =0x00100000; //飘3 20 this.GAME_RULE_SP_10 =0x00200000; //飘5 21 this.GAME_RULE_SP_11 =0x00400000; //飘8 22 this.GAME_RULE_SP_12 =0x00800000; //无红中加倍 23 this.GAME_RULE_SP_13 =0x01000000; //起手四红中可胡 24 this.GAME_RULE_SP_14 =0x02000000; //中途四红中可胡 25 this.GAME_RULE_SP_15 =0x04000000; //台湾北部麻将 26 this.GAME_RULE_SP_16 =0x08000000; //台湾南部麻将 27 this.GAME_RULE_SP_17 =0x10000000; //呖咕呖咕 28 this.GAME_RULE_SP_18 =0x20000000; //飞鸟 29 this.GAME_RULE_SP_19 =0x40000000; //不抓鸟 30 this.GAME_RULE_SP_20 =0x00000001; //服务器规则:AA付费 this.m_dwGameRule = 0; //创建规则 this.m_dwGameRuleArr = new Array(5); //创建规则 this.g_GameLogic = null; this.g_GameEngine = null; this.m_cbMagicData=0;//混牌值 this.m_AllCardItem = new Array(); ////////////////////////////////////////////////////////////////////////// //动作定义 //动作标志 this.WIK_NULL = 0x0000; //没有类型 this.WIK_LEFT = 0x0001; //左吃类型 this.WIK_CENTER = 0x0002; //中吃类型 this.WIK_RIGHT = 0x0004; //右吃类型 this.WIK_PENG = 0x0008; //碰牌类型 this.WIK_GANG = 0x0010; //杠牌类型 this.WIK_LISTEN = 0x0020; //吃牌类型 this.WIK_CHI_HU = 0x0040; //吃胡类型 this.WIK_FANG_PAO = 0x0080; //放炮类型 this.WIK_GANG_FENG = 0x0100; //旋风杠 this.WIK_CAI_ZFB = 0x0200; //旋风杠(中发白吃杠) this.WIK_ADD_ZFB = 0x0400; //旋风杠补杠 this.WIK_DNJ = 0x0800; //东南鸡 this.WIK_ADD_DNJ= 0x1000; //东南鸡补 this.WIK_ADD_FENG= 0x2000; //旋风杠补杠 this.WIK_GANG_BU = 0x4000; //杠补 //胡牌定义 this.CHR_NULL =0x00000000; //空权位 this.CHR_MENQiNG =0x00000001; //门清 this.CHR_PENG_PENG =0x00000002; //碰碰胡 this.CHR_QI_DUI =0x00000004; //八对 this.CHR_BAXIANGUOHAI =0x00000008; //八仙过海 this.CHR_GANG_KAI =0x00000010; //杠上开花 this.CHR_KUN_SI_SE =0x00000020; //混一色 this.CHR_QING_YI_SE =0x00000040; //清一色 this.CHR_QUAN_QIU_PAO =0x00000080; //全求 this.CHR_DI_TING =0x00000100; //地听 this.CHR_TIAN_TING =0x00000200; //天听 this.CHR_SHAN_YUAN =0x00000400; //三元 this.CHR_SHAN_YUAN_XIAO =0x00000800; //小三元 this.CHR_XIAO_SI_XI =0x00001000; //小四喜 this.CHR_HAI_DI =0x00002000; //海底捞 this.CHR_GANG_PAO =0x00004000; //杠后炮 this.CHR_QI_QIANG_YI =0x00008000; //七抢1 this.CHR_QIANG_GANG =0x00010000; //抢杠 this.CHR_DUN_TING =0x00020000; //独听 this.CHR_ZI_SI_SE =0x00040000; //字一色 this.CHR_SHAN_KAN =0x00080000; //三暗刻 this.CHR_SI_KAN =0x00100000 //四暗刻 this.CHR_WU_KAN =0x00200000 //五暗刻 this.CHR_HUA_GANG =0x00400000 //花杠 this.CHR_PING_HU =0x00800000 //平胡 this.CHR_WU_KAN_NO =0x01000000 //无刻 this.CHR_BANKER =0x02000000; //庄家 this.CHR_CHI_HU =0x04000000; //放炮 this.CHR_ZI_MO =0x08000000; //自摸 this.CHR_MEN_FENG =0x10000000; //门风 this.CHR_HUA_PAI =0x20000000; //hua pai this.CHR_LIAN_ZHUANG =0x40000000; //lian zhuang this.CHR_FENG_QUAN =0x80000000; //风圈 this.CHR_DA_SI_XI =0x00000001; //大四喜ADD //Y 排列方式 this.enYTop = 0; //上对齐 this.enYCenter = 1; //中对齐 this.enYBottom = 2; //下对齐 //方向枚举 this.Direction_North = 0; //北向 this.Direction_West = 1; //西向 this.Direction_South = 2; //南向 this.Direction_East = 3; //东向 this.HAND_TOP = 0; this.HAND_LEFT = 1; this.HAND_BOTTOM = 2; this.HAND_RIGHT = 3; //牌状态 this.HAND_STATE_STAND = 0;//立牌 this.HAND_STATE_SHOW = 1;//显示牌 this.HAND_STATE_SHOW_BACK = 2;//显示牌背 //普通杠牌,1张牌摞起来,全部显示 this.GANG_THREE_SHOW = 0; //普通杠牌,1张牌摞起来,暗杠全部不显示 this.GAME_THREE_BACK = 1; //普通杠牌,1张牌摞起来,暗杠自己能看到第三张牌 this.GAME_THREE_BACK_SELF = 2; this.CARD_WIGTH = 86; this.CARD_HEIGHT = 122; //游戏定时器 this.IDI_START_GAME = 200; //开始定时器 this.IDI_OPERATE_CARD = 201; //操作定时器 //游戏定时器 this.TIME_START_GAME = 30; //开始定时器 this.TIME_OPERATE_CARD = 30; //操作定时器 this.TIME_OPERATE_CARD_15 = 15; //操作定时器 this.TIME_OPERATE_CARD_30 = 30; //操作定时器 this.TIME_OPERATE_CARD_60 = 60; //操作定时器 this.ITEM_PROVIDE_DIR = 0; this.ITEM_PROVIDE_COLOR = 1; ////////////////////////////////////////////////////////////////////////// //服务器命令结构 this.SUB_S_GAME_START = 100; //游戏开始 this.SUB_S_OUT_CARD = 101; //出牌命令 this.SUB_S_SEND_CARD = 102; //发送扑克 this.SUB_S_OPERATE_NOTIFY = 104; //操作提示 this.SUB_S_OPERATE_RESULT = 105; //操作命令 this.SUB_S_GAME_END = 106; //游戏结束 this.SUB_S_TRUSTEE = 107; //用户托管 this.SUB_S_NEXT_READY = 108; //下局准备 this.SUB_S_LEAVE = 109; this.SUB_S_USER_DOUBLE =111; //用户加倍 this.SUB_S_GAME_DOUBLE =112; //开始选刚 this.SUB_S_TING =113; //听牌 this.SUB_S_BANKER_CAN_OUT =114; //庄可以出牌 this.SUB_S_REPLACE_CARD =117; //用户补牌 this.SUB_S_OPERATE_TIMER =120; //别人有提示显示时间 //刷新数据 this.SUB_S_UPDATE_CARD= 200; //刷新操作牌 ////////////////////////////////////////////////////////////////////////// //客户端命令结构 this.SUB_C_OUT_CARD = 1; //出牌命令 this.SUB_C_OPERATE_CARD = 3; //操作扑克 this.SUB_C_TRUSTEE = 4; //用户托管 this.SUB_C_NEXT_READY = 5; this.SUB_C_LEAVE = 7; this.SUB_C_USER_DOUBLE= 8; //用户加倍 this.SUB_C_REPLACE_CARD = 9; //用户补牌 }, setRule:function(dwServerRules, dwRuleArr ){ this.m_dwGameRuleArr = dwRuleArr; this.m_dwServerRules = dwServerRules; // this.GAME_PLAYER = this.GetPlayerCount(); }, IsJiPai:function(cbCardData) { return false; }, GetPlayerCount:function(dwRule){ if(dwRule) { if (dwRule & this.GAME_RULE_RENSHU_2) return 2; if (dwRule & this.GAME_RULE_RENSHU_0) return 3; else if (dwRule & this.GAME_RULE_RENSHU_1) return 4; else return 4; } else { if (this.m_dwServerRules & this.GAME_RULE_RENSHU_2) return 2; if (this.m_dwServerRules & this.GAME_RULE_RENSHU_0) return 3; else if (this.m_dwServerRules & this.GAME_RULE_RENSHU_1) return 4; else return 4; } }, //类型子项 tagKindItem:function(){ var Obj = new Object(); Obj.wWeaveKind = 0; //组合类型 Obj.cbCenterCard = 0; //中心扑克 Obj.cbValidIndex = new Array(3); //实际扑克索引 return Obj; }, //组合子项 tagWeaveItem:function(){ var Obj = new Object(); Obj.wWeaveKind = 0; //组合类型 Obj.cbCenterCard = 0; //中心扑克 Obj.cbPublicCard = 0; //公开标志 Obj.wProvideUser = 0; //供应用户 Obj.cbCardCount=0; //麻将数量 Obj.cbCardData = new Array(4); //实际扑克 Obj.cbExtraCount = new Array(4); //中发白数量 Obj.cbIndex = -1; //补杠的下标 return Obj; }, //杠牌结果 tagGangCardResult:function(){ var Obj = new Object(); Obj.cbCardCount = 0; //扑克数目 Obj.cbCardData = new Array(this.MAX_WEAVE); //扑克数据r return Obj; }, //分析子项 tagAnalyseItem:function(){ var Obj = new Object(); Obj.cbCardEye = 0; //牌眼扑克 Obj.wWeaveKind = new Array(this.MAX_WEAVE); //组合类型 Obj.cbCenterCard = new Array(this.MAX_WEAVE); //中心扑克 Obj.cbCardData = new Array(this.MAX_WEAVE); //实际扑克 for(var i=0;i0){ str+=' 連'+GameDef.cbLianZhuangCount+"拉"+GameDef.cbLianZhuangCount }else{ if (rules & this.CHR_BANKER&&GameDef.cbLianZhuangCount==0) str+=' 莊家'; } return str; }, IsNoCheat:function(rules){ if(rules & SERVER_RULES_GENERAL) { return false; } return true; }, }); GameDef = null;