| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230 |
- var CGameLogic = require("GameLogic_21201");
- cc.Class({
- extends: cc.GameEngine,
- properties:
- {
- m_ViewNode: cc.Node,
- m_BtDissolve: cc.Node,
- m_BtExit: cc.Node,
- },
- // use this for initialization
- start: function () {
- this.Init();
- },
- Init: function () {
- if (this.m_bInit == true) return;
- this.m_bInit = true;
- //this.SInit();
- this.m_UserLocation = new Array();
- this.m_GameLogic = new CGameLogic(); //游戏逻辑
- GameDef.g_GameLogic = this.m_GameLogic;
- GameDef.g_GameEngine = this;
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- for (var j = 0; j < GameDef.MAX_WEAVE; ++j) {
- this.m_WeaveItemArray[i][j] = GameDef.tagWeaveItem();
- }
- }
- // this.m_LeaveControl = this.node.getChildByName('LeaveCtrl').getComponent('LeaveControl');
- // this.m_LeaveControl.SetClientEngine(this);
- // this.m_LeaveControl.ShowView(false);
- },
- ctor: function () {
- //游戏变量
- this.m_wBankerUser = 0;
- this.m_wCurrentUser = 0;
- this.m_wActionMask = 0;
- this.m_bStustee = false;
- this.m_wTimeOutCount = 0;
- this.m_cbLeftCardCount = 0; //发牌数目
- this.m_GameLogic = null; //游戏逻辑
- this.m_WeaveItemArray = new Array();
- this.m_cbWeaveCount = new Array();
- this.m_bListen = new Array();
- for (var i = 0; i < 4; i++) {
- this.m_bListen[i] = false;
- this.m_cbWeaveCount[i] = 0;
- this.m_WeaveItemArray[i] = new Array();
- }
- this.m_cbCardIndex = new Array();
- for (var i = 0; i < 42; ++i) {//GameDef.MAX_INDEX
- this.m_cbCardIndex[i] = 0;
- }
- //玩家变量
- this.m_wCurrentUser = INVALID_CHAIR;
- this.m_SoundArr = new Array(
- ['BGM', 'BGM'],//.mp3
- ['GAME_START', 'GAME_START'],
- ['GAME_END', 'GAME_END'],
- ['GAME_WARN', 'GAME_WARN'],
- ['SEND_CARD', 'SEND_CARD'],
- ['CHUPAI', 'CHUPAI'],
- ['TIPAI', 'TIPAI'],
- // //女
- // ['W_CHI', 'w/CHI'],
- // ['W_HU', 'w/CHI_HU'],
- // ['W_ZIMO', 'w/ZIMO'],
- // ['W_GANG', 'w/GANG'],
- // ['W_PENG', 'w/PENG'],
- // ['W_TING', 'w/TING'],
- // ['W_ZHUNBEI', 'w/zhunbei'],
- // //男
- // ['M_CHI', 'm/CHI'],
- // ['M_HU', 'm/CHI_HU'],
- // ['M_ZIMO', 'm/ZIMO'],
- // ['M_GANG', 'm/GANG'],
- // ['M_PENG', 'm/PENG'],
- // ['M_TING', 'm/TING'],
- // ['M_ZHUNBEI', 'm/zhunbei'],
- );
- //出牌声音
- for (var j = 0; j < 4; j++) {
- //女
- this.m_SoundArr[this.m_SoundArr.length] = ["W_CHIL" + j, 'w/CHIL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["W_HUL" + j, 'w/CHI_HUL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["W_ZIMOL" + j, 'w/ZIMOL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["W_GANGL" + j, 'w/GANGL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["W_PENGL" + j, 'w/PENGL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["W_TINGL" + j, 'w/TINGL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["W_ZHUNBEIL" + j, 'w/zhunbeiL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["W_BUHUAL" + j, 'w/BUHUAL' + j];
- //男
- this.m_SoundArr[this.m_SoundArr.length] = ["M_CHIL" + j, 'm/CHIL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_HUL" + j, 'm/CHI_HUL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_ZIMOL" + j, 'm/ZIMOL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_GANGL" + j, 'm/GANGL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_PENGL" + j, 'm/PENGL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_TINGL" + j, 'm/TINGL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_ZHUNBEIL" + j, 'm/zhunbeiL' + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_BUHUAL" + j, 'm/BUHUAL' + j];
- for (var i = 1; i < 10; ++i) {
- this.m_SoundArr[this.m_SoundArr.length] = ["M_W_" + i + "L" + j, 'm/W_' + i + "L" + j];
- this.m_SoundArr[this.m_SoundArr.length] = ['W_W_' + i + "L" + j, 'w/W_' + i + "L" + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_S_" + i + "L" + j, 'm/S_' + i + "L" + j];
- this.m_SoundArr[this.m_SoundArr.length] = ['W_S_' + i + "L" + j, 'w/S_' + i + "L" + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_T_" + i + "L" + j, 'm/T_' + i + "L" + j];
- this.m_SoundArr[this.m_SoundArr.length] = ['W_T_' + i + "L" + j, 'w/T_' + i + "L" + j];
- this.m_SoundArr[this.m_SoundArr.length] = ["M_F_" + i + "L" + j, 'm/F_' + i + "L" + j];
- this.m_SoundArr[this.m_SoundArr.length] = ['W_F_' + i + "L" + j, 'w/F_' + i + "L" + j];
- }
- for (var i = 0; i < 12; ++i) {
- var num = "w_" + i;
- this.m_SoundArr[this.m_SoundArr.length] = ["Phrase_w" + (i + 1), 'ShortcutPhrase/' + num];
- num = "m_" + i;
- this.m_SoundArr[this.m_SoundArr.length] = ["Phrase_m" + (i + 1), 'ShortcutPhrase/' + num];
- }
- // for (var i = 0; i < 12; ++i) {
- // var num = "w_" + i+"L"+j;
- // this.m_SoundArr[this.m_SoundArr.length] = ["Phrase_w" + (i + 1)+"L"+j, 'ShortcutPhrase/' + num];
- // num = "m_" + i+"L"+j;
- // this.m_SoundArr[this.m_SoundArr.length] = ["Phrase_m" + (i + 1)+"L"+j, 'ShortcutPhrase/' + num];
- // }
- }
- // //出牌声音
- // for(var i=1;i<10;++i){
- // this.m_SoundArr[this.m_SoundArr.length] = ["M_W_"+i,'m/W_'+i];
- // this.m_SoundArr[this.m_SoundArr.length] = ['W_W_'+i,'w/W_'+i];
- // this.m_SoundArr[this.m_SoundArr.length] = ["M_S_"+i,'m/S_'+i];
- // this.m_SoundArr[this.m_SoundArr.length] = ['W_S_'+i,'w/S_'+i];
- // this.m_SoundArr[this.m_SoundArr.length] = ["M_T_"+i,'m/T_'+i];
- // this.m_SoundArr[this.m_SoundArr.length] = ['W_T_'+i,'w/T_'+i];
- // this.m_SoundArr[this.m_SoundArr.length] = ["M_F_"+i,'m/F_'+i];
- // this.m_SoundArr[this.m_SoundArr.length] = ['W_F_'+i,'w/F_'+i];
- // }
- // for (var i = 0; i < 12; ++i) {
- // var num = "w_" + i;
- // this.m_SoundArr[this.m_SoundArr.length] = ["Phrase_w" + (i + 1), 'ShortcutPhrase/' + num];
- // num = "m_" + i;
- // this.m_SoundArr[this.m_SoundArr.length] = ["Phrase_m" + (i + 1), 'ShortcutPhrase/' + num];
- // }
- this.m_szText = new Array(
- '快點動手!你是來打牌還是來當雕像?',
- '哇靠~盯這麼緊?打張牌來吃吃吧!',
- '拖什麼拖!我還得趕去談生意咧!',
- '等等,我接個電話,別偷牌啊!',
- '想這麼久幹嘛?出張二筒吧!',
- '不是阿大哥,在忙啥,動作這麼慢?',
- '有種再打同一張!這把我要胡到你哭!',
- '又是我放槍?這牌桌有毒吧!',
- ' 你家網路是撥接的喔?卡成這樣!',
- '老子回來了!看你急得跟什麼一樣!',
- ' 又胡!?這人是不是開外掛啦!',
- // '這咋又胡了呢,腦瓜子嗡一下子',
- );
- this.m_cbGameStatus = 0;
- this.m_bCanShowBigEnd = false;
- this.m_bEnd = false;
- this.m_bInit = false;
- this.m_bFirstCard = false;
- },
- //网络消息
- OnEventGameMessage: function (wSubCmdID, pData, wDataSize) {
- switch (wSubCmdID) {
- case GameDef.SUB_S_GAME_START: //游戏开始
- {
- return this.OnSubGameStart(pData, wDataSize);
- }
- case GameDef.SUB_S_OUT_CARD: //用户出牌
- {
- return this.OnSubOutCard(pData, wDataSize);
- }
- case GameDef.SUB_S_SEND_CARD: //发牌消息
- {
- return this.OnSubSendCard(pData, wDataSize);
- }
- case GameDef.SUB_S_OPERATE_NOTIFY: //操作提示
- {
- return this.OnSubOperateNotify(pData, wDataSize);
- }
- case GameDef.SUB_S_OPERATE_TIMER://别人有提示显示时间
- {
- return this.OnSubOperateTimer(pData, wDataSize);
- }
- case GameDef.SUB_S_OPERATE_RESULT: //操作结果
- {
- return this.OnSubOperateResult(pData, wDataSize);
- }
- case GameDef.SUB_S_GAME_END: //游戏结束
- {
- return this.OnSubGameEnd(pData, wDataSize);
- }
- case GameDef.SUB_S_TRUSTEE: //用户托管
- {
- return this.OnSubTrustee(pData, wDataSize);
- }
- case GameDef.SUB_S_LEAVE: //用户托管
- {
- return this.OnSubLeave(pData, wDataSize);
- }
- case GameDef.SUB_S_NEXT_READY: //下局准备
- {
- return this.OnSubNextReady(pData, wDataSize);
- }
- case GameDef.SUB_S_USER_DOUBLE: //用户加刚
- {
- return this.OnSubPlayerDouble(pData, wDataSize);
- }
- case GameDef.SUB_S_GAME_DOUBLE: //开始选刚
- {
- return this.OnSubStartDouble(pData, wDataSize);
- }
- case GameDef.SUB_S_UPDATE_CARD: //刷新
- {
- return this.OnUpdateCardData(pData, wDataSize);
- }
- case GameDef.SUB_S_TING:
- {
- return this.OnTing(pData, wDataSize);
- }
- case GameDef.SUB_S_REPLACE_CARD: //用户补牌
- {
- return this.OnSubReplaceCard(pData, wDataSize);
- }
- case GameDef.SUB_S_BANKER_CAN_OUT:
- {
- this.m_wCurrentUser = this.m_wBankerUser;
- this.m_bFirstCard = false;
- this.m_GameClientView.m_CardView.m_HandCard[2].SetCanTouch(true);
- }
- }
- return true;
- },
- //游戏场景
- OnEventSceneMessage: function (cbGameStatus, bLookonUser, pData, wDataSize) {
- if (GameDef.TMP_TEST) {
- this.__test();
- return true;
- }
- //this.m_GameClientView.m_BtFriend.active = (this.m_dwRoomID != 0 && this.m_wGameProgress == 0);
- this.m_cbGameStatus = cbGameStatus;
- switch (cbGameStatus) {
- case GameDef.GAME_SCENE_FREE: //空闲状态
- {
- var pStatusFree = GameDef.CMD_S_StatusFree();
- if (wDataSize != gCByte.Bytes2Str(pStatusFree, pData)) return false;
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].SetScore(OtherViewID, pStatusFree.lSumGameScore[i])
- }
- return true;
- }
- case GameDef.GAME_SCENE_DOUBLE: //加倍状态
- {
- // function binaryData(ev) {
- // return JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(ev.data)))
- // }
- var pStatusFree = GameDef.CMD_S_StatusFree();
- if (wDataSize != gCByte.Bytes2Str(pStatusFree, pData)) return false;
- console.log("pStatusFree--", pStatusFree)
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- this.m_GameClientView.SetTrustee(i, pStatusFree.bTrustee[i]);
- }
- var wMeChairID = this.GetMeChairID();
- this.m_bStustee = pStatusFree.bTrustee[wMeChairID];
- if (this.m_wGameProgress == 0) {
- var kernel = gClientKernel.get();
- if (this.m_dwCreater != 0 && this.m_dwCreater == kernel.mMeUserItem.GetUserID()) {
- this.m_BtExit.active = false;
- this.m_BtDissolve.active = true;
- }
- else {
- this.m_BtExit.active = true;
- this.m_BtDissolve.active = false;
- }
- }
- else {
- this.m_BtExit.active = false;
- this.m_BtDissolve.active = true;
- // 没开始不用计时
- if (this.m_bStustee) {
- this.checkTotalEnd(true);
- }
- // else
- // {
- // //计算时间
- // var wTimeCount=this.GetOperateTime() - pStatusFree.dwOperateTime;
- // this.SetGameClock(this.m_wCurrentUser,GameDef.IDI_OPERATE_CARD,wTimeCount);
- // }
- }
- //this.m_GameClientView.m_BtStart.active = !this.m_bStustee;
- this.m_GameClientView.m_CardView.SetDiscardTip(INVALID_CHAIR);
- // this.m_GameClientView.SetHuangZhuang(pStatusFree.wHuangZhuangCount);
- var kernel = gClientKernel.get();
- if (GameDef.GAME_SCENE_DOUBLE == cbGameStatus && !kernel.IsLookonMode()) {
- this.m_GameClientView.m_BtStart.active = false;
- var cbDoubleT = pStatusFree.cbDouble[this.GetMeChairID()];
- if (cbDoubleT == 0) {
- this.m_GameClientView.SetGangOperator(1);
- }
- else {
- //计算时间
- var wTimeCount = this.GetOperateTime() - pStatusFree.dwOperateTime;
- this.SetGameClock(this.m_wCurrentUser, GameDef.IDI_OPERATE_CARD, wTimeCount);
- this.m_GameClientView.SetGangOperator(2);
- }
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- var viewId = this.SwitchViewChairID(i);
- var cbDouble = pStatusFree.cbDouble[i];
- this.m_GameClientView.m_UserInfo[viewId].SetGang(cbDouble);
- }
- }
- return true;
- }
- case GameDef.GAME_SCENE_PLAY: //游戏状态
- {
- var BankViewID = this.SwitchViewChairID(0);
- this.m_GameClientView.m_BtFriend.active = false;
- //效验数据
- var pStatusPlay = GameDef.CMD_S_StatusPlay();
- pStatusPlay.weaveItem = this.m_WeaveItemArray;
- pStatusPlay.cbWeaveCount = this.m_cbWeaveCount;
- if (wDataSize != gCByte.Bytes2Str(pStatusPlay, pData)) return false;
- console.log("pStatusPlay--", pStatusPlay)
- var displayF = true;
- var displayC = true;
- if (GameDef.GAME_RULE_SP_16 & GameDef.m_dwGameRuleArr[0]) displayF = false;
- if (this.m_cbGameStatus & GameDef.GAME_SCENE_PLAY) displayC = false;
- this.m_wGameProgress = pStatusPlay.cbQuan + 1;
- this.m_GameClientView.UpdateRoomProgress();
- //风局
- this.m_GameClientView.Fengju(pStatusPlay.cbQuan, pStatusPlay.cbFeng, displayF);
- //骰子
- this.m_GameClientView.DiceNum(pStatusPlay.cbSick)
- //风位
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].SetFeng(pStatusPlay.cbQuan, pStatusPlay.cbUserDNXB[i], displayF);
- }
- //花牌数据
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].SetFlower(OtherViewID, pStatusPlay.cbFlowerCount[i], pStatusPlay.cbCardDataFlower[i], displayF, displayC);
- this.m_GameClientView.showGotFlowers(OtherViewID, displayC);
- }
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- this.m_GameClientView.m_CardView.ResetView();
- //设置刚状态
- var wViewChairID = new Array();
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- wViewChairID[i] = this.SwitchViewChairID(i);
- this.m_bListen[i] = pStatusPlay.bListen[i];
- // cbDouble= pStatusPlay.cbDouble[i];
- this.m_GameClientView.SetTrustee(i, pStatusPlay.bTrustee[i]);
- this.m_GameClientView.m_UserInfo[wViewChairID[i]].SetTing(this.m_bListen[i]);
- var cbDouble = pStatusPlay.cbDouble[i];
- this.m_GameClientView.m_UserInfo[wViewChairID[i]].SetGang(cbDouble);
- }
- var wMeChairID = this.GetMeChairID();
- this.m_bStustee = pStatusPlay.bTrustee[wMeChairID];
- //会牌
- this.m_GameClientView.m_CardView.SetMakeMagicIndex(pStatusPlay.cbMakeMagicIndex);
- //this.m_HuiCardDate = this.m_GameLogic.GetNextCardIndex( pStatusPlay.cbMakeMagicIndex);
- // this.m_GameClientView.m_CardView.SetMagicIndex(this.m_HuiCardDate);
- //this.m_HuiCardDate = this.m_GameLogic.SwitchToCardData(this.m_HuiCardDate);
- this.m_DingHuiCardDate = this.m_GameLogic.SwitchToCardData(pStatusPlay.cbMakeMagicIndex);
- //this.m_GameClientView.SetHuiPai(this.m_DingHuiCardDate,this.m_HuiCardDate);
- //GameDef.m_cbMagicData = this.m_HuiCardDate;
- this.m_wBankerUser = pStatusPlay.wBankerUser;
- this.m_wCurrentUser = pStatusPlay.wCurrentUser;
- this.m_cbLeftCardCount = pStatusPlay.cbLeftCardCount;
- // this.m_GameClientView.SetHuangZhuang(pStatusPlay.wHuangZhuangCount);
- //玩家变量
- //for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- //用户名字
- // var kernel = gClientKernel.get();
- // var pIClientUserItem = kernel.GetTableUserItem(i);
- // if (pIClientUserItem == null) continue;
- // this.m_GameClientView.SetScoreInfo(this.SwitchViewChairID(i), pIClientUserItem.GetUserScore() + pStatusPlay.lGangScore[i]);
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].SetScore(OtherViewID, pStatusPlay.lSumGameScore[i])
- }
- this.m_GameClientView.SetLeftCardCount(this.m_cbLeftCardCount);
- this.m_GameLogic.SwitchToCardIndex3(pStatusPlay.cbCardData, pStatusPlay.cbCardCount, this.m_cbCardIndex);
- //界面设置
- this.m_GameClientView.SetCellScore(pStatusPlay.lCellScore);
- this.m_GameClientView.SetBankerUser(wViewChairID[this.m_wBankerUser]);
- //组合扑克
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- // var wOperateViewID = this.SwitchViewChairID(i);
- for (var j = 0; j < this.m_cbWeaveCount[i]; j++) {
- this.m_GameClientView.m_CardView.SetWeaveData(wViewChairID[i], j, this.m_WeaveItemArray[i][j].cbCardData, this.m_WeaveItemArray[i][j].cbCardCount);
- this.m_GameClientView.m_CardView.SetWeaveState(wViewChairID[i], j, this.m_WeaveItemArray[i][j]);
- }
- }
- //用户扑克
- if (this.m_wCurrentUser == wMeChairID &&
- this.m_cbCardIndex[this.m_GameLogic.SwitchToCardIndex(pStatusPlay.cbSendCardData)] > 0) {
- this.m_GameClientView.m_CardView.SetSelfCardIndex(this.m_cbCardIndex, pStatusPlay.cbSendCardData, this.m_bListen[wMeChairID], pStatusPlay.cbCantOutCard);
- } else {
- this.m_GameClientView.m_CardView.SetSelfCardIndex(this.m_cbCardIndex, 0, this.m_bListen[wMeChairID], pStatusPlay.cbCantOutCard);
- }
- //扑克设置
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- //用户扑克
- var cbCardCount = GameDef.MAX_COUNT - this.m_cbWeaveCount[i] * 3 - 1;
- if (i != wMeChairID) {
- if (pStatusPlay.wCurrentUser == i) {
- cbCardCount++;
- }
- var wUserCardIndex = wViewChairID[i];
- this.m_GameClientView.m_CardView.SetCardData(wUserCardIndex, null, cbCardCount);
- }
- //丢弃扑克
- this.m_GameClientView.m_CardView.SetDiscardCardDate(wViewChairID[i], pStatusPlay.cbDiscardCard[i], pStatusPlay.cbDiscardCount[i]);
- }
- //丢弃效果
- if (pStatusPlay.wOutCardUser != INVALID_CHAIR) {
- this.m_GameClientView.m_CardView.AddDiscard(wViewChairID[pStatusPlay.wOutCardUser], pStatusPlay.cbOutCardData);
- this.m_GameClientView.m_CardView.SetDiscardTip(this.SwitchViewChairID(pStatusPlay.wOutCardUser));
- }
- //控制设置
- this.m_GameClientView.m_CardView.SetPositively(true);
-
- //操作界面
- if (pStatusPlay.wActionMask != GameDef.WIK_NULL) {
- //获取变量
- this.m_wActionMask = pStatusPlay.wActionMask;
- }
- this.m_GameClientView.SetCurrentUser(this.m_wCurrentUser);
- //设置时间
- if (this.m_wCurrentUser != INVALID_CHAIR) {
- //计算时间
- var wTimeCount = this.GetOperateTime() - pStatusPlay.dwOperateTime;
- //设置时间
- if (pStatusPlay.bLeave[this.m_wCurrentUser]) {
- this.m_GameClientView.SetUserTimer(this.SwitchViewChairID(this.m_wCurrentUser), 0);
- } else {
- this.SetGameClock(this.m_wCurrentUser, GameDef.IDI_OPERATE_CARD, wTimeCount);
- }
- }
- this.m_GameClientView.m_CardView.m_HandCard[2].SetCanTouch(pStatusPlay.bCanOutCard);
- this.m_BtExit.active = false;
- this.m_BtDissolve.active = true;
- return true;
- // }
- }
- return false;
- }
- },
- SetGameClock: function (wChairID, nTimerID, nElapse) {
- this.m_GameClientView.SetUserTimer(wChairID, nElapse, 1);
- if (this.m_ReplayMode) return
- g_TimerEngine.SetGameTimer(wChairID, nTimerID, nElapse * 1000, null, this, 'OnTimerMessage');
- },
- //删除定时器
- KillGameClock: function (nTimerID) {
- this.m_GameClientView.SetUserTimer(INVALID_CHAIR, 0);
- g_TimerEngine.KillGameTimer();
- return true;
- },
- //时间消息
- OnTimerMessage: function (wChairID, CountDown, nTimerID, Progress) {
- var nElapse = parseInt(CountDown / 1000) + 1;
- if (CountDown == 0) nElapse = 0;
- this.m_GameClientView.SetUserTimer(wChairID, nElapse);
- return true;
- },
- StusteeOperateCard: function (wChairID) {
- if (this.m_bStustee == false) {
- this.ListenAutoOutCard(wChairID);
- return false;
- }
- // if (this.m_bStustee){
- // if(this.m_wActionMask & GameDef.WIK_CHI_HU){
- // this.OnCardOperate(GameDef.WIK_CHI_HU, 0);
- // return true;
- // }
- // }
- //获取位置
- var wMeChairID = this.GetMeChairID();
- //动作处理
- if (wChairID == wMeChairID) {
- // //玩家未听牌,且未托管,则累加超时次数
- // if( this.m_bStustee==false && ++this.m_wTimeOutCount>=3 )
- // {
- // this.m_wTimeOutCount = 0;
- // this.OnStusteeControl(0,TRUE);
- // }
- if (this.m_wCurrentUser == wMeChairID) {
- //获取扑克
- var wViewID = this.SwitchViewChairID(wChairID);
- var cbCardData = this.m_GameClientView.m_CardView.GetHandCurrentCard(wViewID);
- //出牌效验
- if (this.VerdictOutCard(cbCardData) == false) {
- for (var i = 0; i < 42; i++)//GameDef.MAX_INDEX
- {
- //出牌效验
- if (this.m_cbCardIndex[i] == 0) continue;
- if (this.VerdictOutCard(this.m_GameLogic.SwitchToCardData(i)) == false)
- continue;
- //设置变量
- cbCardData = this.m_GameLogic.SwitchToCardData(i);
- }
- }
- //出牌动作
- var sequence = cc.sequence(
- cc.callFunc(function () {
- // this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetCanTouch(false);
- if (this.m_wCurrentUser != wChairID) {
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetCanTouch(false);
- return;
- }
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetCanTouch(true);
- }, this),
- cc.delayTime(1),
- cc.callFunc(function () {
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetOutCard(cbCardData);
- // this.OnOutCard(0, 0, cbCardData);
- }, this
- ));
- this.node.runAction(sequence);
- } else {
- this.OnCardOperate(0, 0);
- if (this.m_cbGameStatus == GameDef.GAME_SCENE_PLAY) {
- //过
- var sequence = cc.sequence(
- cc.delayTime(1),
- cc.callFunc(function () {
- this.OnCardOperate(0, 0);
- }, this
- ));
- this.node.runAction(sequence);
- }
- else if (this.m_cbGameStatus == GameDef.GAME_SCENE_DOUBLE) {
- //不下
- this.OnDoubleOperate(1);
- this.m_GameClientView.SetGangOperator(2);
- }
- }
- }
- return true;
- },
- ListenAutoOutCard: function (wChairID) {
- if (this.m_bStustee == true) return; //托管不走这
- var wMeChairID = this.GetMeChairID();
- if (wMeChairID != wChairID) return;
- if (this.m_wCurrentUser != wMeChairID) return;
- if (this.m_bListen[wChairID] == false) return;
- //可以杠
- if (this.m_wActionMask & (GameDef.WIK_GANG | GameDef.WIK_CHI_HU)) {
- return;
- }
- //获取扑克
- var wViewID = this.SwitchViewChairID(wChairID);
- var cbCardData = this.m_GameClientView.m_CardView.GetHandCurrentCard(wViewID);
- //出牌效验
- if (this.VerdictOutCard(cbCardData) == false) {
- for (var i = 0; i < 42; i++)//GameDef.MAX_INDEX
- {
- //出牌效验
- if (this.m_cbCardIndex[i] == 0) continue;
- if (this.VerdictOutCard(this.m_GameLogic.SwitchToCardData(i)) == false)
- continue;
- //设置变量
- cbCardData = this.m_GameLogic.SwitchToCardData(i);
- }
- }
- //出牌动作
- var sequence = cc.sequence(
- cc.callFunc(function () {
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetCanTouch(false);
- }, this),
- cc.delayTime(1),
- cc.callFunc(function () {
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetOutCard(cbCardData);
- this.OnOutCard(0, 0, cbCardData);
- }, this
- ));
- this.node.runAction(sequence);
- },
- //出牌判断
- VerdictOutCard: function (cbCardData) {
- return this.m_GameLogic.IsValidCard(cbCardData);
- },
- //游戏开始
- OnSubGameStart: function (pBuffer, wDataSize) {
- this.m_pGameStart = GameDef.CMD_S_GameStart();
- //效验
- if (wDataSize != gCByte.Bytes2Str(this.m_pGameStart, pBuffer)) return false;
- this.CleanView();
- if (this.m_EndLittleView) {
- this.m_EndLittleView.HideView();
- }
- this.m_GameClientView.SetGangOperator(0);
- this.m_cbGameStatus = GameDef.GAME_SCENE_PLAY;
- var pGameStart = this.m_pGameStart;
- console.log("pGameStart--", pGameStart);
- this.m_GameClientView.m_BtFriend.active = false;
- this.m_wGameProgress = this.m_pGameStart.cbQuan + 1;
- this.m_GameClientView.UpdateRoomProgress();
- //郑骰子
- this.m_GameClientView.OnRollDice(this.m_pGameStart.cbSick);
- setTimeout(() => {
- this.starts();
- }, 1500);
- this.m_bEnd = false;
- return true;
- },
- starts: function () {
- var display = true;
- if (GameDef.m_dwGameRuleArr[0] & GameDef.GAME_RULE_SP_16) display = false;
- //骰子
- this.m_GameClientView.DiceNum(this.m_pGameStart.cbSick);
- //风局
- this.m_GameClientView.Fengju(this.m_pGameStart.cbQuan, this.m_pGameStart.cbFeng, display);
- //风位
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].SetFeng(this.m_pGameStart.cbQuan, this.m_pGameStart.cbUserDNXB[i], display);
- }
- //初始花牌显示
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].ClearFlower(display);
- }
- //会牌
- this.m_GameClientView.m_CardView.SetMakeMagicIndex(this.m_pGameStart.cbMakeMagicIndex);
- //this.m_HuiCardDate = this.m_GameLogic.GetNextCardIndex( pGameStart.cbMakeMagicIndex );
- // this.m_GameClientView.m_CardView.SetMagicIndex(this.m_HuiCardDate);
- if (!this.m_bRollBack)
- this.m_GameClientView.SetMakeMagicIndex(this.m_pGameStart.cbMakeMagicIndex);
- //this.m_HuiCardDate = this.m_GameLogic.SwitchToCardData(this.m_HuiCardDate);
- // GameDef.m_cbMagicData = this.m_HuiCardDate;
- var BankViewID = this.SwitchViewChairID(this.m_pGameStart.wBankerUser);
- this.m_GameClientView.m_CardView.SetPositively(false);
- var wMeChairID = this.GetMeChairID();
- this.m_bStustee = this.m_pGameStart.bTrustee[wMeChairID];
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var viewId = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[viewId].SetTing(false);
- var cbDouble = this.m_pGameStart.cbDouble[i];
- this.m_GameClientView.m_UserInfo[viewId].SetGang(cbDouble);
- this.m_GameClientView.SetTrustee(i, this.m_pGameStart.bTrustee[i]);
- }
- // this.m_GameClientView.SetHuangZhuang(pGameStart.wHuangZhuangCount);
- if (!this.m_bRollBack)
- cc.gSoundRes.PlayGameSound("GAME_START");
- //保存数据
- this.m_wBankerUser = this.m_pGameStart.wBankerUser;
- this.m_wCurrentUser = this.m_pGameStart.wCurrentUser;
- this.m_cbLeftCardCount = this.m_pGameStart.cbLastCardCount;
- this.m_wActionMask = this.m_pGameStart.wUserAction;
- this.m_GameClientView.SetLeftCardCount(this.m_cbLeftCardCount);
- //设置扑克
- var cbCardCount = (wMeChairID == this.m_wBankerUser) ? GameDef.MAX_COUNT : (GameDef.MAX_COUNT - 1);
- this.m_GameLogic.SwitchToCardIndex3(this.m_pGameStart.cbCardData, cbCardCount, this.m_cbCardIndex);
- //设置界面
- this.m_GameClientView.SetBankerUser(this.SwitchViewChairID(this.m_wBankerUser));
- this.m_GameClientView.m_CardView.SetPositively(true);
- this.m_GameClientView.m_BtStart.active = false;
- this.m_BtExit.active = false;
- this.m_BtDissolve.active = true;
- //扑克设置
- for (var i = 0; i < GameDef.GAME_PLAYER; ++i) {
- //听
- this.m_bListen[i] = false;
- //变量定义
- var wViewChairID = this.SwitchViewChairID(i);
- if (this.m_GameClientView.m_pIClientUserItem[wViewChairID] == null) continue;
- //用户扑克
- if (wViewChairID != GameDef.MYSELF_VIEW_ID) {
- this.m_GameClientView.m_CardView.SetCardData(wViewChairID, null, GameDef.MAX_COUNT - 1, null);
- } else {
- var cbCardData = new Array();
- this.m_GameLogic.SwitchToCardData2(this.m_cbCardIndex, cbCardData);
- var cbBankerCard = (i == this.m_wBankerUser ? cbCardData[GameDef.MAX_COUNT - 1] : null);
- this.m_GameClientView.m_CardView.SetSelfCardData(cbCardData, GameDef.MAX_COUNT - 1, cbBankerCard);
- }
- this.m_GameClientView.m_CardView.m_HandCard[wViewChairID].SetCanTouch(false);
- }
- //出牌提示
- // if (this.m_wCurrentUser != INVALID_CHAIR) {
- // this.m_GameClientView.SetCurrentUser(this.m_wCurrentUser);
- // this.SetGameClock(this.m_wCurrentUser, GameDef.IDI_OPERATE_CARD, this.GetOperateTime());
- // }
- },
- //补
- OnSubReplaceCard: function (pData, wDataSize) {
- var pSendCard = GameDef.CMD_S_ReplaceCard();
- //效验
- if (wDataSize != gCByte.Bytes2Str(pSendCard, pData)) return false;
- var wCurrentUser = pSendCard.wReplaceUser;
- console.log("补OnSubReplaceCard--", pSendCard)
- var displayF = true;
- var displayC = true;
- if (GameDef.m_dwGameRuleArr[0] & GameDef.GAME_RULE_SP_16) displayF = false;
- // if(this.m_cbGameStatus & GameDef.GAME_SCENE_PLAY)displayC = true;
- if (this.GetClientUserItem(wCurrentUser) != null) {
- var OtherViewID = this.SwitchViewChairID(wCurrentUser);
- this.PlayActionSound(wCurrentUser, "BUHUA");
- this.m_GameClientView.m_UserInfo[OtherViewID].SetFlower(OtherViewID, pSendCard.cbFlowerCount[wCurrentUser], pSendCard.cbCardDataFlower[wCurrentUser], displayF, displayC);
- this.m_GameClientView.showGotFlowers(OtherViewID, displayC);
- }
- return true;
- },
- //发牌
- OnSubSendCard: function (pData, wDataSize) {
- var pSendCard = GameDef.CMD_S_SendCard();
- //效验
- if (wDataSize != gCByte.Bytes2Str(pSendCard, pData)) return false;
- console.log("发牌--", pSendCard, pSendCard.wActionMask)
- //清空听牌提示
- this.m_GameClientView.m_CardView.ShowTingData();
- this.m_GameClientView.m_CardView.ShowTingTip(0);
- this.m_bFirstCard = pSendCard.bFirstCard;
- var wMeChairID = this.GetMeChairID();
- var wViewChairID = this.SwitchViewChairID(pSendCard.wSendCardUser);
- var wChairId = pSendCard.wSendCardUser;
- var cbSendCardData = pSendCard.cbCardData;
- this.m_wCurrentUser = pSendCard.wCurrentUser;
- this.m_cbLeftCardCount = pSendCard.cbLeftCardCount;
- this.m_GameClientView.SetLeftCardCount(this.m_cbLeftCardCount);
- //取牌界面
- if (wViewChairID != GameDef.MYSELF_VIEW_ID) {
- if (this.m_ReplayMode) {
- this.m_GameClientView.m_CardView.SetCurrentCard(wViewChairID, cbSendCardData, this.m_bListen[wChairId]);
- } else {
- this.m_GameClientView.m_CardView.SetCurrentCard(wViewChairID, 0, this.m_bListen[wChairId]);
- }
- } else {
- this.m_GameClientView.m_CardView.SetCurrentCard(wViewChairID, cbSendCardData, this.m_bListen[wChairId]);
- //插入扑克
- this.m_cbCardIndex[this.m_GameLogic.SwitchToCardIndex(cbSendCardData)]++;
- }
- //当前用户
- if (this.m_wCurrentUser == wMeChairID) {
- this.m_wActionMask = pSendCard.wActionMask;
- this.StusteeOperateCard(this.m_wCurrentUser);
- var wViewID = this.SwitchViewChairID(wMeChairID);
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetCanTouch(pSendCard.bCanOut);
- }
- this.m_GameClientView.SetCurrentUser(this.m_wCurrentUser);
- this.SetGameClock(this.m_wCurrentUser, GameDef.IDI_OPERATE_CARD, this.GetOperateTime());
- cc.gSoundRes.PlayGameSound("SEND_CARD");
- console.log("cbSendCardData--", cbSendCardData)
- if (this.m_wCurrentUser == wMeChairID && cbSendCardData > 55) {
- // this.OnReplaceCard(cbSendCardData)
- }
- return true;
- },
- //出牌
- OnSubOutCard: function (pData, wDataSize) {
- // 创建一个CMD_S_OutCard对象,用于存储出牌信息
- var pOutCard = GameDef.CMD_S_OutCard();
- // 效验数据大小是否与出牌数据结构一致,不一致则返回false
- if (wDataSize != gCByte.Bytes2Str(pOutCard, pData)) return false;
- this.m_GameClientView.m_CardView.SetControlInfo(false);//关闭操作面板?
- // 将出牌用户的椅子ID转换为视角ID
- var wOutUserViewId = this.SwitchViewChairID(pOutCard.wOutCardUser);
- // 更新出牌数据
- this.m_cbOutCardData = pOutCard.cbOutCardData;
- // 清空听牌提示
- this.m_GameClientView.m_CardView.ShowTingData();
- // 隐藏听牌提示标志
- this.m_GameClientView.m_CardView.ShowTingTip(0);
- // 删除游戏计时器
- this.KillGameClock();
- // 播放出牌动作声音
- this.PlayActionSound(pOutCard.wOutCardUser, this.GetCardStr(this.m_cbOutCardData));
- // 设置扑克
- if (wOutUserViewId == GameDef.MYSELF_VIEW_ID) {
- // 从玩家的手牌中移除出的牌,失败则返回false
- if (!this.m_GameLogic.RemoveCard2(this.m_cbCardIndex, this.m_cbOutCardData)) return false;
- // 创建一个新的数组来存储手牌数据
- var cbHandCardData = new Array();
- // 获取更新后手牌的数量
- var cbCardCount = this.m_GameLogic.SwitchToCardData2(this.m_cbCardIndex, cbHandCardData);
- // 获取客户端内核实例
- var kernel = gClientKernel.get();
- // 如果是回放模式
- if (this.m_ReplayMode) {
- // 在回放中添加出的牌到弃牌堆
- this.m_GameClientView.m_CardView.AddDiscard(wOutUserViewId, this.m_cbOutCardData, true);
- // 更新手牌显示
- this.m_GameClientView.m_CardView.SetCardData(wOutUserViewId, cbHandCardData, cbCardCount);
- } else if (kernel.IsLookonMode()) {
- // 找到出牌在手牌中的索引位置
- var CardCtrl = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId];
- var OutIndex = 0;
- for (var i = 0; i < CardCtrl.m_CardItemArray.length; i++) {
- if (CardCtrl.m_CardItemArray[i].node.active == true && this.m_cbOutCardData == CardCtrl.m_CardItemArray[i].GetCardData()) {
- OutIndex = i;
- break;
- }
- }
- // 使用requestAnimationFrame来播放出牌动画
- requestAnimationFrame(() => {
- this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData, cbHandCardData, cbCardCount);
- });
- } else {
- // 获取玩家选择的手牌数据和索引
- var selCardData = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].GetDoubleCardData();
- var OutIndex = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].GetDoubleCardIndex();
- selCardData = this.m_cbOutCardData
- if (selCardData == 0 || this.m_bStustee == true) {
- selCardData = this.m_cbOutCardData
- this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].SetOutCard(this.m_cbOutCardData)
- }
- //如果选择的牌与出的牌相同,则播放出牌动画
- if (selCardData == this.m_cbOutCardData) {
- requestAnimationFrame(() => {
- this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData, cbHandCardData, cbCardCount);
- });
- }
- // if (this.m_bStustee == true) {
- // if (selCardData == 0) {
- // selCardData = this.m_cbOutCardData
- // this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].SetOutCard(this.m_cbOutCardData)
- // }
- // requestAnimationFrame(() => {
- // this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData, cbHandCardData, cbCardCount);
- // });
- // } else {
- // //如果选择的牌与出的牌相同,则播放出牌动画
- // if (selCardData == this.m_cbOutCardData) {
- // requestAnimationFrame(() => {
- // this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData, cbHandCardData, cbCardCount);
- // });
- // }
- // }
- }
- } else {
- if (this.m_ReplayMode) {
- // 获取对手的手牌数据和数量
- var cbHandCardData = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].m_cbCardData;
- var cbCardCount = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].m_wCardCount;
- // 创建一个数组来存储移除的牌
- var cbRemoveCard = new Array();
- cbRemoveCard[0] = this.m_cbOutCardData;
- // 从对手的手牌中移除出的牌,失败则返回false
- if (!this.m_GameLogic.RemoveCard4(cbHandCardData, cbCardCount, cbRemoveCard, 1)) {
- return false;
- }
- // 对手手牌重新排序
- this.m_GameLogic.SortCardList(cbHandCardData, cbCardCount - 1);
- // 更新对手手牌显示
- this.m_GameClientView.m_CardView.SetCardData(wOutUserViewId, cbHandCardData, cbCardCount - 1);
- // 在回放中添加出的牌到弃牌堆
- this.m_GameClientView.m_CardView.AddDiscard(wOutUserViewId, this.m_cbOutCardData, true);
- } else {
- // 设置当前玩家的出牌状态
- this.m_GameClientView.m_CardView.SetCurrentCard(wOutUserViewId, null, this.m_bListen[pOutCard.wOutCardUser]);
- // 播放对手出牌动画
- requestAnimationFrame(() => {
- this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData);
- });
- }
- }
- // 如果出牌用户不是当前玩家
- if (pOutCard.wOutCardUser != this.GetMeChairID()) {
- // 设置当前操作用户为无效
- this.m_wCurrentUser = INVALID_CHAIR;
- // 清空操作掩码
- this.m_wActionMask = 0;
- // 设置界面显示的当前操作用户为无效
- this.m_GameClientView.SetCurrentUser(INVALID_CHAIR);
- // 设置用户操作界面为无效
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- }
- // 出牌处理完成,返回true
- return true;
- },
- // //出牌
- // OnSubOutCard: function (pData, wDataSize) {
- // var pOutCard = GameDef.CMD_S_OutCard();
- // //效验
- // if (wDataSize != gCByte.Bytes2Str(pOutCard, pData)) return false;
- // var wOutUserViewId = this.SwitchViewChairID(pOutCard.wOutCardUser);
- // this.m_cbOutCardData = pOutCard.cbOutCardData;
- // //清空听牌提示
- // this.m_GameClientView.m_CardView.ShowTingData();
- // this.m_GameClientView.m_CardView.ShowTingTip(0);
- // //删除定时器
- // this.KillGameClock();
- // //播放声音
- // this.PlayActionSound(pOutCard.wOutCardUser, this.GetCardStr(this.m_cbOutCardData));
- // //设置扑克
- // if (wOutUserViewId == GameDef.MYSELF_VIEW_ID) {
- // //删除扑克
- // if (!this.m_GameLogic.RemoveCard2(this.m_cbCardIndex, this.m_cbOutCardData)) return false;
- // var cbHandCardData = new Array();//[GameDef.MAX_COUNT];
- // var cbCardCount = this.m_GameLogic.SwitchToCardData2(this.m_cbCardIndex, cbHandCardData);
- // var kernel = gClientKernel.get();
- // if (this.m_ReplayMode) {
- // this.m_GameClientView.m_CardView.AddDiscard(wOutUserViewId, this.m_cbOutCardData, true);
- // this.m_GameClientView.m_CardView.SetCardData(wOutUserViewId, cbHandCardData, cbCardCount);
- // }
- // else if (kernel.IsLookonMode()) {
- // var CardCtrl = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId];
- // var OutIndex = 0;
- // for (var i = 0; i < CardCtrl.m_CardItemArray.length; i++) {
- // if (CardCtrl.m_CardItemArray[i].node.active == true && this.m_cbOutCardData == CardCtrl.m_CardItemArray[i].GetCardData()) {
- // OutIndex = i;
- // break;
- // }
- // }
- // this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData, cbHandCardData, cbCardCount);
- // }
- // else {
- // var selCardData = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].GetDoubleCardData();
- // var OutIndex = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].GetDoubleCardIndex();
- // if (selCardData == this.m_cbOutCardData) {
- // this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData, cbHandCardData, cbCardCount);
- // }
- // }
- // } else {
- // if (this.m_ReplayMode) {
- // var cbHandCardData = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].m_cbCardData;//[GameDef.MAX_COUNT];
- // var cbCardCount = this.m_GameClientView.m_CardView.m_HandCard[wOutUserViewId].m_wCardCount;
- // var cbRemoveCard = new Array();
- // cbRemoveCard[0] = this.m_cbOutCardData;
- // //删除扑克
- // if (!this.m_GameLogic.RemoveCard4(cbHandCardData, cbCardCount, cbRemoveCard, 1)) {
- // return false;
- // }
- // this.m_GameLogic.SortCardList(cbHandCardData, cbCardCount - 1);
- // this.m_GameClientView.m_CardView.SetCardData(wOutUserViewId, cbHandCardData, cbCardCount - 1);
- // this.m_GameClientView.m_CardView.AddDiscard(wOutUserViewId, this.m_cbOutCardData, true);
- // } else {
- // this.m_GameClientView.m_CardView.SetCurrentCard(wOutUserViewId, null, this.m_bListen[pOutCard.wOutCardUser]);
- // this.m_GameClientView.m_CardView.PlayDiscard(wOutUserViewId, OutIndex, this.m_cbOutCardData);
- // }
- // }
- // if (pOutCard.wOutCardUser != this.GetMeChairID()) {
- // //设置变量
- // this.m_wCurrentUser = INVALID_CHAIR;
- // this.m_wActionMask = 0;
- // //设置界面
- // this.m_GameClientView.SetCurrentUser(INVALID_CHAIR);
- // this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- // }
- // return true;
- // },
- huAuto: function(){
- var OperateCard = GameDef.CMD_C_OperateCard();
- OperateCard.wOperateCode = GameDef.WIK_CHI_HU;
- this.SendGameData(GameDef.SUB_C_OPERATE_CARD, OperateCard);
- },
- //操作提示
- OnSubOperateNotify: function (pData, wDataSize) {
- var pOperateNotify = GameDef.CMD_S_OperateNotify();
- var size = gCByte.Bytes2Str(pOperateNotify, pData);
- var pObj = new Object()
- pObj.pItem = new Array(pOperateNotify.wCount);
- for (var i = 0; i < pOperateNotify.wCount; i++) {
- pObj.pItem[i] = GameDef.CMD_WeaveItem();
- }
- //效验
- if (wDataSize != gCByte.Bytes2Str(pObj, pData, size) + size) return false;
- //回放、观战不显示选飘界面
- var kernel = gClientKernel.get();
- if (this.m_ReplayMode || kernel.IsLookonMode()) return true;
- console.log("操作提示--", pOperateNotify, pObj)
- //用户界面
- if (pOperateNotify.wActionMask != GameDef.WIK_NULL) {
- if (pOperateNotify.wActionMask & GameDef.WIK_CHI_HU) {
- console.log("操作提示-胡")
- this.scheduleOnce(() => {
- this.huAuto();
- // var OperateCard = GameDef.CMD_C_OperateCard();
- // OperateCard.wOperateCode = GameDef.WIK_CHI_HU;
- // OperateCard.cbOperateCard[0] = pOperateNotify.cbActionCard;
- // OperateCard.cbOperateCount = 1;
- // OperateCard.cbIndex = 0;
- // this.SendGameData(GameDef.SUB_C_OPERATE_CARD, OperateCard);
- }, 0.3);
-
- }
-
- // if (pOperateNotify.wActionMask & GameDef.WIK_GANG) {
- // console.log("操作提示-杠")
- // }
- // if (pOperateNotify.wActionMask & GameDef.WIK_PENG) {
- // console.log("操作提示-碰")
- // }
- // if (pOperateNotify.wActionMask & GameDef.WIK_LEFT) {
- // console.log("操作提示-左吃")
- // }
- // if (pOperateNotify.wActionMask & GameDef.WIK_CENTER) {
- // console.log("操作提示-中吃")
- // }
- // if (pOperateNotify.wActionMask & GameDef.WIK_RIGHT) {
- // console.log("操作提示-右吃")
- // }
- //this.m_GameClientView.m_CardView.m_HandCard[2].SetCanTouch(false);
- //获取变量
- var wMeChairID = this.GetMeChairID();
- this.m_wActionMask = pOperateNotify.wActionMask;
- //设置界面
- cc.error("OnSubOperateNotify ", pObj.pItem);
- this.m_GameClientView.m_CardView.SetControlInfo(true, pObj.pItem, pObj.pItem.length);
- //设置时间
- this.m_GameClientView.SetCurrentUser(pOperateNotify.wResumeUser);
- this.SetGameClock(wMeChairID, GameDef.IDI_OPERATE_CARD, this.GetOperateTime());
- this.StusteeOperateCard(wMeChairID);
- }
- return true;
- },
- OnSubOperateTimer: function (pData, wDataSize) {
- this.SetGameClock(INVALID_CHAIR, GameDef.IDI_OPERATE_CARD, this.GetOperateTime());
- return true;
- },
- //操作提示
- OnSubOperateResult: function (pData, wDataSize) {
- var pOperateResult = GameDef.CMD_S_OperateResult();
- //效验
- if (wDataSize != gCByte.Bytes2Str(pOperateResult, pData)) return false;
- console.log("pOperateResult--", pOperateResult)
- var wOperateViewID = this.SwitchViewChairID(pOperateResult.wOperateUser);
- if (pOperateResult.wOperateUser != pOperateResult.wProvideUser && pOperateResult.bQiangGang == false) {
- var PrivideViewID = this.SwitchViewChairID(pOperateResult.wProvideUser);
- this.m_GameClientView.m_CardView.StopDiscard(PrivideViewID, pOperateResult.cbCenterCard);
- }
- var wOperateUser = pOperateResult.wOperateUser;
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- this.m_GameClientView.SetUserAction(wOperateViewID, pOperateResult.wOperateCode);
- //环境设置
- if (pOperateResult.wOperateCode & (GameDef.WIK_GANG)) {
- this.PlayActionSound(wOperateUser, "GANG");
- // if (pOperateResult.dwGangScore > 0) {
- // if (pOperateResult.wProvideUser == wOperateUser) {
- // //暗杠,补杠
- // var AddScore = 0;
- // for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- // if (this.GetClientUserItem(i) == null) continue;
- // if (i == wOperateUser) continue;
- // var OtherViewID = this.SwitchViewChairID(i);
- // this.m_GameClientView.m_UserInfo[OtherViewID].SetScore(OtherViewID, -pOperateResult.dwGangScore);// -
- // AddScore += pOperateResult.dwGangScore;
- // }
- // // this.m_GameClientView.m_UserInfo[wOperateViewID].SetScore(OtherViewID, AddScore);//+ AddScore
- // }
- // else {
- // //叉杠
- // var PrivideViewID = this.SwitchViewChairID(pOperateResult.wProvideUser);
- // this.m_GameClientView.m_UserInfo[PrivideViewID].SetScore(PrivideViewID, -pOperateResult.dwGangScore);;//-
- // this.m_GameClientView.m_UserInfo[wOperateViewID].SetScore(wOperateViewID, pOperateResult.dwGangScore);;//+
- // }
- // }
- }
- else if (pOperateResult.wOperateCode & (GameDef.WIK_LEFT | GameDef.WIK_CENTER | GameDef.WIK_RIGHT))
- this.PlayActionSound(wOperateUser, "CHI");
- else if (pOperateResult.wOperateCode & GameDef.WIK_PENG)
- this.PlayActionSound(wOperateUser, "PENG");
- else if (pOperateResult.wOperateCode & GameDef.WIK_CHI_HU)
- this.PlayActionSound(wOperateUser, "HU");
- else if (pOperateResult.wOperateCode & GameDef.WIK_LISTEN) {
- this.PlayActionSound(wOperateUser, "TING");
- this.m_bListen[wOperateUser] = true;
- var viewID = this.SwitchViewChairID(wOperateUser);
- this.m_GameClientView.m_UserInfo[viewID].SetTing(true);
- }
- else if (pOperateResult.wOperateCode & GameDef.WIK_GANG_FENG) {
- this.PlayActionSound(wOperateUser, "FENG");
- }
- else if (pOperateResult.wOperateCode & GameDef.WIK_DNJ) {
- this.PlayActionSound(wOperateUser, "DNJ");
- }
- else if (pOperateResult.wOperateCode & GameDef.WIK_CAI_ZFB) {
- this.PlayActionSound(wOperateUser, "ZFB");
- }
- //设置时间
- if (pOperateResult.bBeiQiangGang) {
- this.m_wCurrentUser = INVALID_CHAIR;
- }
- else {
- this.m_wCurrentUser = wOperateUser;
- }
- var wMeChairID = this.GetMeChairID();
- if (wOperateUser == wMeChairID) {
- var wViewID = this.SwitchViewChairID(wMeChairID);
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetCanTouch(true);
- }
- this.m_GameClientView.SetCurrentUser(wOperateUser);
- this.SetGameClock(wOperateUser, GameDef.IDI_OPERATE_CARD, this.GetOperateTime());
- return true;
- },
- OnSubGameEnd: function (pData, wDataSize) {
- this.m_GameEnd = GameDef.CMD_S_GameEnd();
- if (wDataSize != gCByte.Bytes2Str(this.m_GameEnd, pData)) return false;
- GameDef.cbLianZhuangCount = this.m_GameEnd.cbLianZhuangCount;
- console.log("連莊cbLianZhuangCount", GameDef.cbLianZhuangCount);
- this.m_cbGameStatus = GameDef.GAME_SCENE_FREE;
- console.log("this.m_GameEnd--", this.m_GameEnd);
- this.m_bCanShowBigEnd = false;
- //清空听牌提示
- this.m_GameClientView.m_CardView.ShowTingData();
- this.m_GameClientView.m_CardView.ShowTingTip(0);
- //删除定时器
- this.KillGameClock();
- GameDef.dwChiHuRightAdd = this.m_GameEnd.dwChiHuRightAdd;
- this.m_wGameProgress = this.m_GameEnd.cbQuan + 1;
- // this.m_GameClientView.UpdateRoomProgress();
- this.MyChairID = this.GetMeChairID()
- let isZimo = false;
- //赢家
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- if (this.m_GameEnd.dwChiHuKind[i] == GameDef.WIK_CHI_HU) {
- var viewID = this.SwitchViewChairID(i);
- if (this.m_GameEnd.dwChiHuRight[i] & GameDef.CHR_ZI_MO) {
- //自摸
- this.m_GameClientView.SetUserAction(viewID, GameDef.WIK_CHI_HU, GameDef.CHR_ZI_MO);
- isZimo = true;
- } else {
- //胡牌
- this.m_GameClientView.SetUserAction(viewID, GameDef.WIK_CHI_HU);
- }
- }
- }
- //输家
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.m_GameEnd.lGameScore[i] >= 0) {
- continue;
- }
- if (this.GetClientUserItem(i) == null) continue;
- var viewID = this.SwitchViewChairID(i);
- this.m_GameClientView.SetUserAction(viewID, GameDef.WIK_FANG_PAO, isZimo ? GameDef.CHR_ZI_MO : 0);
- }
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].SetScore(OtherViewID, this.m_GameEnd.lSumGameScore[i])
- }
- //设置控件
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- this.m_GameClientView.m_CardView.SetPositively(false);
- this.m_GameClientView.SetCurrentUser(INVALID_CHAIR);
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- for (var j = 0; j < this.m_GameEnd.cbWeaveCount[i]; ++j) {
- var cbCenterCard = this.m_GameEnd.weaveItem[i][j].cbCenterCard;
- var wWeaveKind = this.m_GameEnd.weaveItem[i][j].wWeaveKind;
- var cbCardData = this.m_GameEnd.weaveItem[i][j].cbCardData;
- var cbWeaveCardCount = this.m_GameEnd.weaveItem[i][j].cbCardCount;
- var cbPublicCard = this.m_GameEnd.weaveItem[i][j].cbPublicCard;
- var viewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_CardView.SetWeaveData(viewID, j, cbCardData, cbWeaveCardCount, cbPublicCard);
- this.m_GameClientView.m_CardView.SetWeaveState(viewID, j, this.m_GameEnd.weaveItem[i][j]);
- if (cbWeaveCardCount == 4 && !cbPublicCard) {
- this.m_GameClientView.m_CardView.SetWeaveState(viewID, j, GameDef.GAME_THREE_BACK_SELF);
- }
- }
- }
- //设置扑克
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var cbCardData = this.m_GameEnd.cbCardData;
- var wCardCount = this.m_GameEnd.cbCardCount[i];
- var viewID = this.SwitchViewChairID(i);
- if ((wCardCount + 1) % 3 == 0) {
- var tmpCardData = new Array();
- for (var j = 0; j < wCardCount; j++) {
- tmpCardData[j] = cbCardData[i][j];
- }
- var cbRemoveCard = new Array();
- if (this.m_GameEnd.cbProvideCard != 0) {
- cbRemoveCard[0] = this.m_GameEnd.cbProvideCard;
- } else {
- cbRemoveCard[0] = tmpCardData[wCardCount - 1];
- }
- if (this.m_GameEnd.cbLastCardData[i]) {
- cbRemoveCard[0] = this.m_GameEnd.cbLastCardData[i];
- }
- if (this.m_GameLogic.RemoveCard4(tmpCardData, wCardCount, cbRemoveCard, 1)) {
- this.m_GameClientView.m_CardView.SetCardData(viewID, tmpCardData, wCardCount - 1);
- this.m_GameClientView.m_CardView.SetCurrentCard(viewID, cbRemoveCard[0]);
- }
- } else {
- this.m_GameClientView.m_CardView.SetCardData(viewID, cbCardData[i], wCardCount);
- }
- this.m_GameClientView.m_CardView.SetCardItemState(viewID, GameDef.HAND_STATE_SHOW);
- }
- //播放声音
- if (this.m_GameEnd.wProvideUser != INVALID_CHAIR) {
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.m_GameEnd.dwChiHuKind[i] != GameDef.WIK_NULL) {
- if (this.m_GameEnd.dwChiHuRight[i] & GameDef.CHR_ZI_MO) {
- this.PlayActionSound(i, "ZIMO");
- }
- else {
- this.PlayActionSound(i, "HU");
- }
- }
- }
- } else {
- cc.gSoundRes.PlayGameSound("GAME_END");
- }
- var WaitTime = 3;
- // if(this.m_GameEnd.cbBirdCardCount > 0)
- // {
- // this.m_GameClientView.ShowBird(this.m_GameEnd.cbBirdCard, this.m_GameEnd.cbBirdCardCount);
- // WaitTime = 4;
- // }
- //设置定时
- this.schedule(this.OnTimeIDI_PERFORM_END, WaitTime);
- // this.OnTimeIDI_PERFORM_END();
- return true;
- },
- //用户托管
- OnSubTrustee: function (pData, wDataSize) {
- var pTrustee = GameDef.CMD_S_Trustee();
- if (wDataSize != gCByte.Bytes2Str(pTrustee, pData)) return false;
- this.m_GameClientView.SetTrustee(pTrustee.wChairID, pTrustee.bTrustee);
- var wMeChairID = this.GetMeChairID();
- if (wMeChairID == pTrustee.wChairID) {
- this.m_bStustee = pTrustee.bTrustee;
- if (pTrustee.bTrustee) {
- if (this.m_bEnd) {
- if (this.m_EndLittleView) {
- this.m_EndLittleView.HideView();
- }
- this.checkTotalEnd(true);
- }
- else {
- this.StusteeOperateCard(pTrustee.wChairID);
- }
- }
- }
- console.log("是否托管---", this.m_bStustee)
- return true;
- },
- OnSubLeave: function (pData, wDataSize) {
- var pLeave = GameDef.CMD_S_Leave();
- if (wDataSize != gCByte.Bytes2Str(pLeave, pData)) return false;
- this.m_GameClientView.SetUserTimer(this.SwitchViewChairID(this.m_wCurrentUser), 0);
- // for(var i = 0; i < GameDef.GAME_PLAYER; ++ i)
- // this.m_GameClientView.SetLeave(this.SwitchViewChairID(i), pLeave.bLeave[i]);
- return true;
- },
- OnSubPlayerDouble: function (pData, wDataSize) {
- var pDouble = GameDef.CMD_S_Double();
- if (wDataSize != gCByte.Bytes2Str(pDouble, pData)) return false;
- var viewID = this.SwitchViewChairID(pDouble.wCallUser);
- this.m_GameClientView.m_UserInfo[viewID].SetGang(pDouble.cbDouble);
- return true;
- },
- UpdateHandActionCard: function () {
- },
- OnTing: function (pData, wDataSize) {
- var pTing = new Object();
- pTing.wCount = 0;
- var size = gCByte.Bytes2Str(pTing, pData);
- var pObj = new Object()
- pObj.pItem = new Array(pTing.wCount);
- for (var i = 0; i < pTing.wCount; i++) {
- pObj.pItem[i] = GameDef.CMD_TingTip();
- }
- console.log("听--", pObj)
- //效验
- if (wDataSize != gCByte.Bytes2Str(pObj, pData, size) + size) return false;
- var wMeChairID = this.GetMeChairID();
- this.m_GameClientView.m_CardView.ShowTingData(pObj.pItem, this.m_bListen[wMeChairID]);
- return true;
- },
- OnUpdateCardData: function (pData, wDataSize) {
- var pHandCardData = GameDef.CMD_S_HandCardData();
- if (wDataSize != gCByte.Bytes2Str(pHandCardData, pData)) return false;
- console.log("刷新pHandCardData--", pHandCardData);
- var wMeChairID = this.GetMeChairID();
- if (pHandCardData.wChairID == wMeChairID) {
- this.m_cbCardIndex = new Array();
- this.m_GameLogic.SwitchToCardIndex3(pHandCardData.cbCardData, pHandCardData.wCardCount, this.m_cbCardIndex);
- this.m_GameClientView.m_CardView.SetSelfCardIndex(this.m_cbCardIndex, pHandCardData.cbSendCardData, this.m_bListen[wMeChairID], pHandCardData.cbCantOutCard);
- } else {
- var viewID = this.SwitchViewChairID(pHandCardData.wChairID);
- if (this.m_ReplayMode) {
- if (pHandCardData.cbCardData[0] != 0) {
- if ((pHandCardData.wCardCount + 1) % 3 == 0) {
- var curCardData = pHandCardData.cbSendCardData;
- if (curCardData == 0) curCardData = pHandCardData.cbCardData[0]
- this.m_GameClientView.m_CardView.SetCardData(viewID, pHandCardData.cbCardData, pHandCardData.wCardCount, curCardData);
- } else {
- this.m_GameClientView.m_CardView.SetCardData(viewID, pHandCardData.cbCardData, pHandCardData.wCardCount);
- }
- }
- } else {
- // if((pHandCardData.wCardCount+1)%3==0){
- // this.m_GameClientView.m_CardView.SetCardData(viewID,null,pHandCardData.wCardCount-1,0);
- // }else{
- // this.m_GameClientView.m_CardView.SetCardData(viewID,null,pHandCardData.wCardCount);
- // }
- this.m_GameClientView.m_CardView.SetCardData(viewID, null, pHandCardData.wCardCount);
- }
- }
- var i = pHandCardData.wChairID;
- this.m_cbWeaveCount[i] = pHandCardData.dwWeaveCount;
- for (var j = 0; j < GameDef.MAX_WEAVE; ++j) {
- this.m_WeaveItemArray[i][j].wWeaveKind = pHandCardData.WeaveItem[j].wWeaveKind;
- this.m_WeaveItemArray[i][j].cbCenterCard = pHandCardData.WeaveItem[j].cbCenterCard;
- this.m_WeaveItemArray[i][j].cbPublicCard = pHandCardData.WeaveItem[j].cbPublicCard;
- this.m_WeaveItemArray[i][j].wProvideUser = pHandCardData.WeaveItem[j].wProvideUser;
- this.m_WeaveItemArray[i][j].cbCardCount = pHandCardData.WeaveItem[j].cbCardCount;
- for (var k = 0; k < 4; ++k) {
- this.m_WeaveItemArray[i][j].cbCardData[k] = pHandCardData.WeaveItem[j].cbCardData[k];
- this.m_WeaveItemArray[i][j].cbExtraCount[k] = pHandCardData.WeaveItem[j].cbExtraCount[k];
- }
- }
- var ViewID = this.SwitchViewChairID(i);
- for (var j = 0; j < this.m_cbWeaveCount[i]; j++) {
- this.m_GameClientView.m_CardView.SetWeaveData(ViewID, j, this.m_WeaveItemArray[i][j].cbCardData, this.m_WeaveItemArray[i][j].cbCardCount);
- this.m_GameClientView.m_CardView.SetWeaveState(ViewID, j, this.m_WeaveItemArray[i][j]);
- }
- return true;
- },
- //开始选刚
- OnSubStartDouble: function (pData, wDataSize) {
- var pGameDouble = GameDef.CMD_S_Game_Double();
- if (wDataSize != gCByte.Bytes2Str(pGameDouble, pData)) return false;
- this.m_bStustee = false;
- this.m_wBankerUser = pGameDouble.wBankerUser;
- var bankerViewID = this.SwitchViewChairID(this.m_wBankerUser);
- this.m_GameClientView.SetBankerUser(bankerViewID);
- this.m_cbGameStatus = GameDef.GAME_SCENE_DOUBLE;
- this.SetGameClock(INVALID_CHAIR, GameDef.IDI_OPERATE_CARD, this.GetOperateTime());
- this.m_GameClientView.m_BtStart.active = false;
- this.m_GameClientView.m_BtFriend.active = false;
- this.m_BtExit.active = false;
- this.m_BtDissolve.active = true;
- //回放、观战不显示选飘界面
- var kernel = gClientKernel.get();
- if (this.m_ReplayMode || kernel.IsLookonMode()) return true;
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var viewId = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[viewId].SetTing(false);
- this.m_GameClientView.m_UserInfo[viewId].SetGang(0);
- this.m_GameClientView.SetTrustee(i, false);
- }
- this.m_GameClientView.SetGangOperator(1);
- return true;
- },
- OnMessageStart: function () {
- //this.ShowHead(true);
- this.KillGameClock();
- //隐藏按钮
- this.m_GameClientView.m_BtStart.active = false;
- //this.m_GameClientView.m_BtFriend.active = false;
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- this.m_GameClientView.SetCurrentUser(INVALID_CHAIR);
- //设置界面
- this.m_GameClientView.m_CardView.SetDiscardTip(INVALID_CHAIR);
- this.m_GameClientView.SetBankerUser(INVALID_CHAIR);
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- //关闭显示花,风位
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- if (this.GetClientUserItem(i) == null) continue;
- var OtherViewID = this.SwitchViewChairID(i);
- this.m_GameClientView.m_UserInfo[OtherViewID].SetShowFenganFlower();
- }
- //隐藏骰子
- this.m_GameClientView.ShowDice(false);
- this.m_GameClientView.m_CardView.ResetView();
- //扑克设置
- //游戏变量
- this.m_wCurrentUser = INVALID_CHAIR;
- this.m_wActionMask = 0;
- for (var i = 0; i < GameDef.GAME_PLAYER; ++i) {
- this.m_cbWeaveCount[i] = 0;
- for (var j = 0; j < GameDef.MAX_WEAVE; ++j) {
- this.m_WeaveItemArray[i][j] = GameDef.tagWeaveItem();
- }
- }
- //扑克变量
- this.m_cbLeftCardCount = 0;
- for (var i = 0; i < 42; ++i)//GameDef.MAX_INDEX
- {
- this.m_cbCardIndex[i] = 0;
- }
- //if (this.m_dwRulesArr[0] & GameDef.GAME_RULE_SP_7)
- //{
- // this.m_GameClientView.SetLeftCardCount(112);
- //}
- //else
- //{
- // this.m_GameClientView.SetLeftCardCount(108);
- //}
- this.m_GameClientView.SetLeftCardCount(GameDef.MAX_REPERTORY);
- //设置用户动作
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- var kernel = gClientKernel.get();
- if (kernel.IsLookonMode() == false) {
- //发送准备
- this.SendUserReady(null, 0);
- }
- },
- CleanView: function (bOffLineBack) {
- this.Init();
- this.waitOperate = false;
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- this.m_GameClientView.SetCurrentUser(INVALID_CHAIR);
- //设置界面
- this.m_GameClientView.m_CardView.SetDiscardTip(INVALID_CHAIR);
- this.m_GameClientView.SetBankerUser(INVALID_CHAIR);
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- //扑克设置
- this.m_GameClientView.m_CardView.ResetView();
- //游戏变量
- this.m_wCurrentUser = INVALID_CHAIR;
- this.m_wActionMask = 0;
- this.m_wTimeOutCount = 0;
- for (var i = 0; i < GameDef.GAME_PLAYER; ++i) {
- this.m_cbWeaveCount[i] = 0;
- for (var j = 0; j < GameDef.MAX_WEAVE; ++j) {
- this.m_WeaveItemArray[i][j] = GameDef.tagWeaveItem();
- }
- }
- //扑克变量
- this.m_cbLeftCardCount = 0;
- for (var i = 0; i < 42; ++i)//GameDef.MAX_INDEX
- {
- this.m_cbCardIndex[i] = 0;
- }
- if (this.m_dwRulesArr[0] & GameDef.GAME_RULE_SP_7) {
- this.m_GameClientView.SetLeftCardCount(112);
- }
- else {
- this.m_GameClientView.SetLeftCardCount(108);
- }
- this.m_GameClientView.SetLeftCardCount(GameDef.MAX_REPERTORY);
- //设置用户动作
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- },
- //补牌
- OnReplaceCard: function (cbCardData) {
- //构造数据
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- var ReplaceCard = GameDef.CMD_C_ReplaceCard4();
- ReplaceCard.cbCardData[0] = cbCardData;
- ReplaceCard.cbCardCount = 1;
- console.log("补花", cbCardData, ReplaceCard)
- //发送数据
- // if (this.m_ReplayMode) return 0;
- this.SendGameData(GameDef.SUB_C_REPLACE_CARD, ReplaceCard);
- return 0;
- },
- //出牌消息
- OnOutCard: function (HandState, CardIndex, cbCardData, bAdd) {
- //出牌判断
- if (this.m_wCurrentUser != this.GetMeChairID()) return 0;
- // 检查 cbOutCardData 是否大于 55
- // if (cbCardData > 55) return 0;
- //设置变量
- this.m_wCurrentUser = INVALID_CHAIR;
- this.m_wActionMask = 0;
- var cbOutCardData = cbCardData;
- //设置界面
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- //定义变量
- var wMeChairId = this.GetMeChairID();
- var wOutCardUser = this.GetMeChairID();
- var wViewOutCardUser = this.SwitchViewChairID(wOutCardUser);
- // this.PlayActionSound(wMeChairId,this.GetCardStr(cbOutCardData),true);
- //环境设置
- this.KillGameClock();
- //设置变量
- this.m_wCurrentUser = INVALID_CHAIR;
- this.m_wActionMask = 0;
- //设置界面
- this.m_GameClientView.SetCurrentUser(INVALID_CHAIR);
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- //构造数据
- var OutCard = GameDef.CMD_C_OutCard();
- OutCard.cbCardData = cbOutCardData;
- OutCard.bAddGang = bAdd == true ? true : false;
- //发送数据
- this.SendGameData(GameDef.SUB_C_OUT_CARD, OutCard);
- return 0;
- },
- //扑克操作
- OnCardOperate: function (wOperateCode, cbOperateCard, cbCardCount, cbIndex) {
- //变量定义
- if (this.m_bFirstCard == false && wOperateCode == 0 && this.m_wCurrentUser == this.GetMeChairID()) {
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- var wViewID = this.SwitchViewChairID(this.GetMeChairID());
- this.m_GameClientView.m_CardView.m_HandCard[wViewID].SetCanTouch(true);
- if (this.m_bStustee == false) {
- this.ListenAutoOutCard(this.m_wCurrentUser);
- }
- return;
- }
- //补扭走打牌逻辑
- if (wOperateCode & (GameDef.WIK_ADD_ZFB | GameDef.WIK_ADD_DNJ | GameDef.WIK_ADD_FENG)) {
- this.m_GameClientView.m_CardView.m_HandCard[2].SetOutCard(cbOperateCard[0]);
- this.OnOutCard(0, 0, cbOperateCard[0], true);
- return;
- }
- //删除时间
- this.KillGameClock();
- this.m_wCurrentUser = INVALID_CHAIR;
- this.m_wActionMask = 0;
- //构造数据
- var OperateCard = GameDef.CMD_C_OperateCard();
- OperateCard.wOperateCode = wOperateCode;
- OperateCard.cbOperateCard[0] = cbOperateCard[0];
- OperateCard.cbOperateCard[1] = cbOperateCard[1];
- OperateCard.cbOperateCard[2] = cbOperateCard[2];
- OperateCard.cbOperateCard[3] = cbOperateCard[3];
- OperateCard.cbOperateCount = cbCardCount;
- OperateCard.cbIndex = cbIndex;
- console.log("发送胡牌操作",OperateCard)
- //发送数据
- this.SendGameData(GameDef.SUB_C_OPERATE_CARD, OperateCard);
- this.m_GameClientView.m_CardView.m_HandCard[2].SetCanTouch(false);
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- return 0;
- },
- //扑克操作
- OnDoubleOperate: function (cbDouble) {
- this.KillGameClock();
- var Double = GameDef.CMD_C_Double();
- Double.cbDouble = cbDouble;
- //发送数据
- this.SendGameData(GameDef.SUB_C_USER_DOUBLE, Double);
- return 0;
- },
- OnCancelTrustee: function (bTrustee) {
- var Trustee = GameDef.CMD_C_Trustee();
- Trustee.bTrustee = bTrustee;
- //发送数据
- this.SendGameData(GameDef.SUB_C_TRUSTEE, Trustee);
- },
- // //扑克操作
- // OnStusteeControl:function(wParam, lParam){
- // //设置变量
- // this.m_wTimeOutCount=0;
- // if(this.m_bStustee&&lParam==true)return 0;
- // if(!this.m_bStustee&&lParam==0)return 0;
- // //设置状态
- // this.m_bStustee = this.m_bStustee?false:true;
- // //构造数据
- // var Trustee = GameDef.CMD_C_Trustee();
- // Trustee.bTrustee = this.m_bStustee;
- // //发送数据
- // this.SendGameData(GameDef.SUB_C_TRUSTEE, Trustee);
- // return 0;
- // },
- // //离开控制
- // OnLeaveControl: function(event, customData){
- // if(customData != 0){
- // this.m_LeaveControl.ShowView(true);
- // this.m_bLeave = true;
- // }else{
- // this.m_LeaveControl.ShowView(false);
- // this.m_bLeave = false;
- // this.SetGameClock(this.GetMeChairID(),GameDef.IDI_OPERATE_CARD,GameDef.TIME_OPERATE_CARD);
- // }
- // //构造数据
- // var Leave = GameDef.CMD_C_Leave();
- // Leave.bLeave = this.m_bLeave;
- // //发送数据
- // this.SendGameData(GameDef.SUB_C_LEAVE, Leave);
- // return 0;
- // },
- OnNextReady: function () {
- this.KillGameClock();
- //游戏变量
- this.m_lCellScore = 0;
- //设置当前玩家
- this.m_wCurrentUser = INVALID_CHAIR;
- //隐藏按钮
- this.m_GameClientView.m_BtStart.active = false;
- //设置游戏状态
- this.m_GameClientView.SetPlayStatus(INVALID_CHAIR, 0);
- this.m_GameClientView.m_CardView.SetControlInfo(false);
- this.m_GameClientView.SetCurrentUser(INVALID_CHAIR);
- //设置界面
- this.m_GameClientView.m_CardView.SetDiscardTip(INVALID_CHAIR);
- this.m_GameClientView.SetBankerUser(INVALID_CHAIR);
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- //扑克设置
- this.m_GameClientView.m_CardView.ResetView();
- //游戏变量
- this.m_wCurrentUser = INVALID_CHAIR;
- this.m_wActionMask = 0;
- for (var i = 0; i < GameDef.GAME_PLAYER; ++i) {
- this.m_cbWeaveCount[i] = 0;
- for (var j = 0; j < GameDef.MAX_WEAVE; ++j) {
- this.m_WeaveItemArray[i][j] = GameDef.tagWeaveItem();
- }
- }
- //扑克变量
- this.m_cbLeftCardCount = 0;
- for (var i = 0; i < 42; ++i) {//GameDef.MAX_INDEX
- this.m_cbCardIndex[i] = 0;
- }
- if (this.m_dwRulesArr[0] & GameDef.GAME_RULE_SP_7) {
- this.m_GameClientView.SetLeftCardCount(112);
- }
- else {
- this.m_GameClientView.SetLeftCardCount(108);
- }
- this.m_GameClientView.SetLeftCardCount(GameDef.MAX_REPERTORY);
- //设置用户动作
- this.m_GameClientView.SetUserAction(INVALID_CHAIR, 0);
- this.SendGameData(GameDef.SUB_C_NEXT_READY, null);
- },
- //执行结束
- OnTimeIDI_PERFORM_END: function () {
- this.unschedule(this.OnTimeIDI_PERFORM_END);
- this.m_bEnd = true;
- //成绩界面
- this.ShowGamePrefab("LittleResultBG", GameDef.KIND_ID, this.node, function (Js) {
- this.m_EndLittleView = Js;
- //this.m_EndLittleView.SetTrustee(this.m_bStustee);
- }.bind(this));
- //this.ShowPrefabDLG('LittleResultBG_21201');
- },
- checkTotalEnd: function (bNext) {
- this.m_bEnd = false;
- if (this.m_RoomEnd) {
- if (this.m_wGameProgress > 0 || this.m_ReplayMode) {
- this.showRealEndView();
- } else {
- this.ShowAlert("該房間已被解散!", Alert_Yes, function (Res) {
- this.m_pTableScene.ExitGame();
- }.bind(this));
- }
- } else {
- var kernel = gClientKernel.get();
- if (!kernel.IsLookonMode() && bNext) this.OnMessageStart();
- }
- this.m_bCanShowBigEnd = true;
- },
- //发送准备
- SendUserReady: function (pBuffer, wDataSize) {
- var kernel = gClientKernel.get();
- if (kernel == 0 || kernel == null || kernel.IsLookonMode()) return;
- kernel.SendSocketData(MDM_GF_FRAME, SUB_GF_USER_READY, pBuffer, wDataSize);
- },
- //出牌声音字符串
- GetCardStr: function (cbCardData) {
- var str = "";
- var color = cbCardData & 0xf0;
- var value = cbCardData & 0x0f;
- if (color == 0)
- str = "W_";
- if (color == 0x10)
- str = "S_";
- if (color == 0x20)
- str = "T_";
- if (color == 0x30)
- str = "F_";
- str = str + value.toString();
- return str;
- },
- //播放操作声音
- PlayActionSound: function (wChairId, byAction, chuyin) {
- if (this.m_bRollBack) return;
- //椅子效验
- var kernel = gClientKernel.get();
- var pIClientUserItem = kernel.GetTableUserItem(wChairId);
- if (pIClientUserItem == null) return;
- console.log(pIClientUserItem)
- console.log(wChairId, byAction, chuyin)
- if (pIClientUserItem.GetGender() == 1) {
- cc.gSoundRes.PlayGameSound("M_" + byAction + "L" + wChairId);
- }
- else {
- cc.gSoundRes.PlayGameSound("W_" + byAction + "L" + wChairId);
- // cc.gSoundRes.PlayGameSound("W_" + byAction);
- }
- if (chuyin) {
- cc.gSoundRes.PlayGameSound("CHUPAI");
- }
- },
- OnExitGame: function () {
- //退出游戏
- this.m_TableViewFrame.ExitGame();
- },
- ExitGame: function () {
- this.OnExitGame();
- },
- //////////////////////////////////////////////////////////////////////////
- //获取用户
- GetClientUserItem: function (wChairID) {
- var kernel = gClientKernel.get();
- if (kernel == 0 || kernel == null || kernel == undefined) return null;
- return kernel.GetTableUserItem(wChairID);
- },
- GetGameStatus: function () {
- var kernel = gClientKernel.get();
- if (!kernel) return GAME_SCENE_FREE;
- return kernel.GetGameStatus();
- },
- IsValidChairID: function (wChairID) {
- if (wChairID >= 0 && wChairID < GameDef.GAME_PLAYER) return true;
- return false;
- },
- // 获取座位
- GetUserChairID: function (dwUserID) {
- for (var i = 0; i < GameDef.GAME_PLAYER; ++i) {
- var pIClientUserItem = this.GetClientUserItem(i);
- if (!pIClientUserItem) continue;
- if (pIClientUserItem.GetUserID() == dwUserID) return i;
- }
- return INVALID_CHAIR;
- },
- SetViewRoomInfo: function (dwServerRules, dwRulesArr) {
- if (this.m_GameClientView)
- this.m_GameClientView.SetViewRoomInfo(dwRulesArr, dwServerRules);
- GameDef.setRule(dwServerRules, dwRulesArr);
- this.updateUserCount();
- this.m_GameClientView.m_CardView.m_CenterViewCtrl.updateNorth();
- //this.m_GameClientView.m_Trustee.string = GameDef.GetTrusteeString(this.m_dwRules);
- },
- OnEventRoomEnd: function (data, datasize) {
- this.m_RoomEnd = GameDef.CMD_S_GameCustomInfo();
- if (datasize != gCByte.Bytes2Str(this.m_RoomEnd, data)) return false;
- console.log("总结束", this.m_RoomEnd)
- this.m_RoomEnd.UserID = new Array();
- //用户成绩
- for (var i = 0; i < GameDef.GAME_PLAYER; i++) {
- //变量定义
- var pIClientUserItem = this.GetClientUserItem(i);
- if (pIClientUserItem == null) continue;
- this.m_RoomEnd.UserID[i] = pIClientUserItem.GetUserID();
- }
- if (this.m_wGameProgress > 0 || this.m_ReplayMode) {
- this.m_GameClientView.m_BtStart.active = false;
- this.KillGameClock();
- if (this.m_bCanShowBigEnd) {
- this.showRealEndView();
- }
- } else {
- var self = this;
- this.ShowAlert("該房間已被解散!", Alert_Yes, function (Res) {
- self.m_pTableScene.ExitGame();
- });
- }
- return true;
- },
- showRealEndView() {
- this.RealShowEndView();
- GameDef.m_AllCardItem = [];
- },
- //点击安全监测
- OnBtClickedSafe: function () {
- cc.gSoundRes.PlaySound('Button');
- this.ShowGamePrefab('SafeCheck_21201');
- },
- ChangeCardBack: function (index) {
- this.m_CardBack = index;
- if (this.m_GameClientView.m_CardView == null) {
- this.m_GameClientView.Init();
- }
- this.m_GameClientView.m_CardView.ChangeCardBack(this.node, index);
- this.m_GameClientView.ChangeCardBack(index);
- },
- //震动会牌
- ShockHuiPai: function () {
- if (this.m_bRollBack) return;
- this.m_GameClientView.ShockHuiPai();
- },
- updateUserCount: function () {
- this.m_GameClientView.m_CardView.UpdateUserCount();
- this.m_GameClientView.updateUserCount();
- },
- //邀请好友分享
- OnFriend: function () {
- if (cc.sys.isNative) {
- this.ShowPrefabDLG("SharePre");
- } else {
- // this.m_GameClientView.m_FriendBg.node.active = true;
- }
- },
- OnClearScene: function () {
- if (this.m_EndLittleView) this.m_EndLittleView.HideView();
- var CardBack = cc.sys.localStorage.getItem(window.Key_CardColor);
- if (CardBack) {
- this.ChangeCardBack(CardBack);
- } else {
- this.ChangeCardBack(0);
- }
- this.CleanView();
- },
- GetOperateTime: function () {
- if (this.m_dwRulesArr[0] & GameDef.GAME_RULE_TUOGUAN_15) {
- return GameDef.TIME_OPERATE_CARD_15;
- }
- else if (this.m_dwRulesArr[0] & GameDef.GAME_RULE_TUOGUAN_30) {
- return GameDef.TIME_OPERATE_CARD_30;
- }
- else if (this.m_dwRulesArr[0] & GameDef.GAME_RULE_TUOGUAN_60) {
- return GameDef.TIME_OPERATE_CARD_60;
- }
- else if (this.m_dwRulesArr[0] & GameDef.GAME_RULE_TUOGUAN_NONE) {
- return GameDef.TIME_OPERATE_CARD;
- }
- },
- //测试
- __test: function () {
- this.m_GameClientView.m_CardView.setUserCount(4);
- this.m_GameClientView.m_CardView.SetClientEngine(this);
- this.m_CardData = new Array();
- this.m_CardData =
- [
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, //万子
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, //万子
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, //万子
- 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, //万子
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, //索子
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, //索子
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, //索子
- 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, //索子
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, //同子
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, //同子
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, //同子
- 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, //同子
- 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, //番子
- 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, //番子
- 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, //番子
- 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, //番子
- ];
- this.m_GameClientView.m_CardView.SetCardData(0, this.m_CardData, 10);
- this.m_GameClientView.m_CardView.SetCardData(1, this.m_CardData, 10);
- this.m_GameClientView.m_CardView.SetCardData(2, this.m_CardData, 10);
- this.m_GameClientView.m_CardView.SetPositively(true);
- var weaveCard = new Array();
- weaveCard[0] = 0x21;
- weaveCard[1] = 0x21;
- weaveCard[2] = 0x21;
- weaveCard[3] = 0x21;
- this.m_GameClientView.m_CardView.SetWeaveData(0, 0, weaveCard, 4);
- // this.m_GameClientView.m_CardView.SetWeaveData(1,0,weaveCard,4);
- this.m_GameClientView.m_CardView.SetWeaveData(2, 0, weaveCard, 4);
- // this.m_GameClientView.m_CardView.SetWeaveData(3,0,weaveCard,4);
- // this.m_GameClientView.m_CardView.SetCardData(3,cardData,13,0x02);
- this.DiscardDate = 0x22;
- this.m_GameClientView.m_CardView.SetDiscardCardDate(0, this.m_CardData, 33);
- this.m_GameClientView.m_CardView.SetDiscardCardDate(1, this.m_CardData, 33);
- this.m_GameClientView.m_CardView.SetDiscardCardDate(2, this.m_CardData, 33);
- this.m_GameClientView.m_CardView.SetDiscardCardDate(3, this.m_CardData, 33);
- // this.m_GameClientView.m_CardView.PlayDiscard(0,13);
- },
- });
|