| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219 |
- 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_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;
- //设置界面
- 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.RealShowEndView();
- } 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.RealShowEndView();
- }
- } else {
- var self = this;
- this.ShowAlert("該房間已被解散!", Alert_Yes, function (Res) {
- self.m_pTableScene.ExitGame();
- });
- }
- return true;
- },
- //点击安全监测
- 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);
- },
- });
|