diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 87b5834a..9503caa8 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -46,8 +46,6 @@ function M:InitView(url) end self._hu_tip = HuTipView.new(self) - self._view:GetChild('wanfa_text').text = room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. '倍' - self.selectLaiziBtn = self._view:GetChild('selectlaizi') self.Laizi1Btn = self._view:GetChild('selectgang1') self.Laizi2Btn = self._view:GetChild('selectgang2') @@ -154,6 +152,10 @@ function M:InitView(url) if room.playing or room.curren_round > 0 then self:ReloadRoom() end + + ---------为了下次复现出牌情况 + self._viewText_testName = self._view:GetChild('text_testName') + self._viewText_testName.text = 0 end function M:__BuGang(cardInfo, callback) @@ -310,6 +312,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.OutHint, function(...) local info = self._player_card_info[self:GetPos(_room.self_player.seat)] + self._viewText_testName.text = tonumber(self._viewText_testName.text) + 1 info:UpdateHandCard(true) end) @@ -972,12 +975,10 @@ function M:PlayerChangeLineState() end function M:UpdateCardBox(seat) - local index = seat + local index = seat - 1 local people_num = self._room.room_config.people_num if people_num == 2 and seat == 2 then - index = 3 - elseif people_num == 3 and seat == 3 then - index = 4 + index = 2 end self._ctr_cardbox.selectedIndex = index end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua index c36054a2..128f16cc 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXGameController.lua @@ -36,13 +36,15 @@ function M:init(name) self._eventmap[TX_Protocol.GAME_EVT_GANGZI] = self.OnEventGangCards self._eventmap[TX_Protocol.GAME_EVT_BUGANG] = self.OnEventBuGang + + self._eventmap[TX_Protocol.GAME_EVT_RESIDUE_CARD] = self.OnEventResidueCard end local __pre_delete_card = false -- 发送出牌指令到服务器 --------------------------lingmeng--------------------------- +-------------------------展示牌--------------------------- function M:SendNextCard(card) local _data = {} _data["card"] = tonumber(card) @@ -50,6 +52,12 @@ function M:SendNextCard(card) _client:send(TX_Protocol.GAME_NEXT_CARD, _data) end +function M:ReqResidueCard() + local _data = {} + local _client = ControllerManager.GameNetClinet + _client:send(TX_Protocol.GAME_RESIDUE_CARD, _data) +end + ------------------------------------------------------------ function M:SendOutCard(card, callback) @@ -91,6 +99,12 @@ function M:OnEventBuGang(evt_data) DispatchEvent(self._dispatcher, TX_GameEvent.EventBuGang, evt_data["info"], true) end +function M:OnEventResidueCard(evt_data) + printlog("OnEventResidueCard") + pt(evt_data) + DispatchEvent(self._dispatcher, TX_GameEvent.EventResidueCard) +end + -- 发送放子选择到服务器 function M:SendAction(id) local _data = {} diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index 9bcda9e0..93cd3a9e 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -68,38 +68,20 @@ function M:InitView(url) self:UpdatePlayerInfoView() end) - local showNextCtr = self._view:GetController('showNext') - local ShowNextConfrimCtr = self._view:GetController('showNextConfrim') + self.showNextCtr = self._view:GetController('showNext') local showNextList = self._view:GetChild('list_showNext') - local pop_showNextConfrim = self._view:GetChild('pop_showNextConfrim') self._view:GetChild('btn_showNext').onClick:Set(function() - showNextCtr.selectedIndex = 1 - end) - self._view:GetChild('btn_sendShow').onClick:Set(function() - self:SendShowNext(ShowNextConfrimCtr) + self:reqResidueCard() end) self._view:GetChild('btn_closeShow').onClick:Set(function() - ShowNextConfrimCtr.selectedIndex = 0 - showNextCtr.selectedIndex = 0 + self.showNextCtr.selectedIndex = 0 showNextList.selectedIndex = -1 self._showNextName = nil end) showNextList.onClickItem:Set(function(context) local _gamectr = ControllerManager.GetController(GameController) _gamectr:SendNextCard(string.sub(context.data.name, -3)) - showNextCtr.selectedIndex = 0 - showNextList.selectedIndex = -1 - self._showNextName = nil - -- self:ClickShowNext(context, ShowNextConfrimCtr) - end) - ShowNextConfrimCtr.onChanged:Set(function() - pop_showNextConfrim:GetChild("btn_ShowCard").icon = self._showNextName - end) - pop_showNextConfrim:GetChild("btn_center").onClick:Set(function() - local _gamectr = ControllerManager.GetController(GameController) - _gamectr:SendNextCard(string.sub(self._showNextName, -3)) - ShowNextConfrimCtr.selectedIndex = 0 - showNextCtr.selectedIndex = 0 + self.showNextCtr.selectedIndex = 0 showNextList.selectedIndex = -1 self._showNextName = nil end) @@ -153,6 +135,10 @@ function M:InitView(url) if room.playing or room.curren_round > 0 then self:ReloadRoom() end + + ---------为了下次复现出牌情况 + self._viewText_testName = self._view:GetChild('text_testName') + self._viewText_testName.text = 0 end function M:__BuGang(cardInfo, callback) @@ -309,6 +295,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.OutHint, function(...) local info = self._player_card_info[self:GetPos(_room.self_player.seat)] + self._viewText_testName.text = tonumber(self._viewText_testName.text) + 1 info:UpdateHandCard(true) end) @@ -563,6 +550,11 @@ function M:EventInit() end end end) + + _gamectr:AddEventListener(TX_GameEvent.EventResidueCard, function(...) + local arg = { ... } + self.showNextCtr.selectedIndex = 1 + end) end function M:OutCard(card) @@ -972,17 +964,21 @@ function M:PlayerChangeLineState() end function M:UpdateCardBox(seat) - local index = seat + local index = seat - 1 local people_num = self._room.room_config.people_num if people_num == 2 and seat == 2 then - index = 3 - elseif people_num == 3 and seat == 3 then - index = 4 + index = 2 end self._ctr_cardbox.selectedIndex = index end ------------------------lingmeng---------------------------- +-----------------------展示牌---------------------------- + +function M:reqResidueCard() + local _gamectr = ControllerManager.GetController(GameController) + _gamectr:ReqResidueCard() +end + function M:SendShowNext(ShowNextConfrimCtr) if not self._showNextName then ViewUtil.ErrorTip(nil, "请先选择一个麻将牌") diff --git a/lua_probject/extend_project/extend/majiang/jinxi/GameEvent.lua b/lua_probject/extend_project/extend/majiang/jinxi/GameEvent.lua index 9180694e..58df4802 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/GameEvent.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/GameEvent.lua @@ -1,6 +1,5 @@ - local TX_GameEvent = { - -- 发牌 + -- 发牌 SendCards = "SendCards", EventTurn = "EventTurn", @@ -22,16 +21,18 @@ local TX_GameEvent = { ZPResult2 = "ZPResult2", EventNiao = "EventNiao", - + EvnetPiaoTip = "EvnetPiaoTip", EvnetPiao = "EvnetPiao", - - - --- - SendLaiZi="SendLaiZi", + + + --- + SendLaiZi = "SendLaiZi", SendGangZi = "SendGangZi", EventBuGang = "EventBuGang", - + + --- + EventResidueCard = "EventResidueCard" } -return TX_GameEvent \ No newline at end of file +return TX_GameEvent diff --git a/lua_probject/extend_project/extend/majiang/jinxi/Protocol.lua b/lua_probject/extend_project/extend/majiang/jinxi/Protocol.lua index 909cc4b2..1029458f 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/Protocol.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/Protocol.lua @@ -1,7 +1,7 @@ local Protocol = { - -- 发牌协议 - GAME_EVT_PLAYER_DEAL = "811", - + -- 发牌协议 + GAME_EVT_PLAYER_DEAL = "811", + -- 出牌 GAME_DIS_CARD = "611", @@ -28,16 +28,16 @@ local Protocol = { -- 大结算 GAME_EVT_RESULT2 = "818", - - -- 抓牌 + + -- 抓牌 GAME_EVT_DRAW = "819", - -- 转盘指向事件 + -- 转盘指向事件 GAME_EVT_CHANGE_ACTIVE_PLAYER = "820", -- 抓鸟事件 GAME_EVT_NIAO = "821", - + -- 飘鸟提示 GAME_EVT_PIAOTIP = "833", @@ -49,7 +49,9 @@ local Protocol = { GAME_EVT_DOGANG = "839", --送牌 - GAME_NEXT_CARD = "888" + GAME_NEXT_CARD = "888", + GAME_RESIDUE_CARD = "889", + GAME_EVT_RESIDUE_CARD = "613" } -return Protocol \ No newline at end of file +return Protocol diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 12114395..8d34c984 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -152,6 +152,10 @@ function M:InitView(url) if room.playing or room.curren_round > 0 then self:ReloadRoom() end + + ---------为了下次复现出牌情况 + self._viewText_testName = self._view:GetChild('text_testName') + self._viewText_testName.text = 0 end function M:__BuGang(cardInfo, callback) @@ -307,6 +311,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.OutHint, function(...) local info = self._player_card_info[self:GetPos(_room.self_player.seat)] + self._viewText_testName.text = tonumber(self._viewText_testName.text) + 1 info:UpdateHandCard(true) end) @@ -971,12 +976,10 @@ function M:PlayerChangeLineState() end function M:UpdateCardBox(seat) - local index = seat + local index = seat - 1 local people_num = self._room.room_config.people_num if people_num == 2 and seat == 2 then - index = 3 - elseif people_num == 3 and seat == 3 then - index = 4 + index = 2 end self._ctr_cardbox.selectedIndex = index end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index d167a100..ffe3f859 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -152,6 +152,10 @@ function M:InitView(url) if room.playing or room.curren_round > 0 then self:ReloadRoom() end + + ---------为了下次复现出牌情况 + self._viewText_testName = self._view:GetChild('text_testName') + self._viewText_testName.text = 0 end function M:__BuGang(cardInfo, callback) @@ -308,6 +312,7 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.OutHint, function(...) local info = self._player_card_info[self:GetPos(_room.self_player.seat)] + self._viewText_testName.text = tonumber(self._viewText_testName.text) + 1 info:UpdateHandCard(true) end) @@ -983,12 +988,10 @@ function M:PlayerChangeLineState() end function M:UpdateCardBox(seat) - local index = seat + local index = seat - 1 local people_num = self._room.room_config.people_num if people_num == 2 and seat == 2 then - index = 3 - elseif people_num == 3 and seat == 3 then - index = 4 + index = 2 end self._ctr_cardbox.selectedIndex = index end diff --git a/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua b/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua index 42c15a01..158bf69e 100644 --- a/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua +++ b/lua_probject/extend_project/extend/poker/runfast/CardCheck.lua @@ -1,5 +1,3 @@ -local RunFast_CardType = import('.RunFast_CardType') - local CardCheck = { cardList = {}, @@ -11,7 +9,20 @@ local CardCheck = { threeNoBelt = false, planelack = false, threelack = false, - fourDaiThree = false + fourDaiThree = false, + fristCard = true +} + +local cardType = { + one = 1, + long = 2, + dui = 3, + threeAndTwo = 4, + normolPlant = 5, + zha = 6, + onlyThree = 7, + onlyPlant = 8, + zhaAndThreee = 9 } local M = CardCheck @@ -23,12 +34,24 @@ function M:initFlag() self.planelack = config.planelack == 1 self.threelack = config.threelack == 1 self.fourDaiThree = config.fourDaiThree + self.fristCard = true print("==============================lingmengcheckinitFlag") pt(config) pt(self) return self end +function M:initLastCard(cardList) + self.fristCard = false + if #cardList == 0 then + self.fristCard = true + return + end + self.lastCardNum = #cardList + table.sort(cardList) + pt(cardList) +end + function M:initCards(cardList, flag, flag_allCards, lastCards) print("lingmenginitCards") pt(cardList) @@ -84,8 +107,6 @@ function M:initCards(cardList, flag, flag_allCards, lastCards) end function M:CheckCards() - -- local zha - print("lingmengCheckAloneOrLong") if self:CheckAloneOrLong() then return true @@ -110,14 +131,17 @@ function M:CheckCards() end function M:CheckAloneOrLong() - if self.cardNum == 1 or self.long then - return true + if self.cardNum == 1 then + return cardType.one + end + if self.long then + return cardType.long end end function M:CheckDuiZi() if self.cardNum == 2 and self.cardSize == 1 then - return true + return cardType.dui end if self.cardNum % 2 == 0 then local last_k @@ -137,22 +161,22 @@ function M:CheckDuiZi() return end end - return true + return cardType.dui end end function M:CheckSanDai() --三张 if self.cardNum == 5 and self.cardSize < 4 then - return true + return cardType.threeAndTwo end if self.threelack and self.cardNum == 4 and self.cardSize == 2 and self._flag_allCards then - return true + return cardType.threeAndTwo end if self.threeNoBelt and self.cardNum == 3 and self.cardSize == 1 then - return true + return cardType.onlyThree end @@ -181,7 +205,7 @@ function M:CheckSanDai() end end if num_san >= temp_normol_feiji then - return true + return cardType.normolPlant else return end @@ -210,7 +234,7 @@ function M:CheckSanDai() print("liengmengCheckthreelack4", num_san, self.cardNum - num_san * 3 < num_san * 2) if self.cardNum - num_san * 3 < num_san * 2 then - return true + return cardType.normolPlant else return end @@ -236,13 +260,13 @@ function M:CheckSanDai() return end end - return true + return cardType.onlyPlant end end function M:CheckZha() if self.cardNum == 4 and self.cardSize == 1 then - return true + return cardType.zha end if self.fourDaiThree and self.cardNum == 7 then @@ -254,7 +278,7 @@ function M:CheckZha() return true end end - return false + return cardType.zhaAndThreee end end diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua index a22b323f..dee35603 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_GameController.lua @@ -18,8 +18,8 @@ local RunFast_GameController = {} local M = RunFast_GameController function M.new() - setmetatable(M, {__index = GameController}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = GameController }) + local self = setmetatable({}, { __index = M }) self:init("跑得快") self.class = "RunFast_GameController" return self @@ -47,13 +47,13 @@ function M:RegisterEvt() --self._eventmap[RunFast_Protocol.RunFast_Oener] = self.Oener -- self._eventmap[Protocol.GAME_EVT_PLAYER_JOIN] = self.OnEventPlayerEnter self._eventmap[RunFast_Protocol.PT_GAMETUOGUAN] = self.Game_TuoGuan - - self._eventmap[RunFast_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai - self._eventmap[RunFast_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim - - self._eventmap[RunFast_Protocol.GAME_EVT_CARDINHAND] = self.OnPlaySuccCheckHandCard - + + self._eventmap[RunFast_Protocol.GAME_EVENT_XIPAI] = self.OnEventXiPai + self._eventmap[RunFast_Protocol.GAME_EVENT_NOTIFY_XIPAI] = self.OnEventXiPaiAnim + + self._eventmap[RunFast_Protocol.GAME_EVT_CARDINHAND] = self.OnPlaySuccCheckHandCard end + -- function M:Oener(evt_data) -- local seat = evt_data["owner"] -- self._cacheEvent:Enqueue(function() @@ -79,7 +79,7 @@ end -- p.total_score=evt_data["score"] -- p.hp_info = evt_data["hp_info"] -- -- p.total_score=self._room.room_config.energyTab==0 and evt_data["score"] or evt_data["score"]/10 - + -- DataManager.CurrenRoom:AddPlayer(p) -- DispatchEvent(self._dispatcher,GameEvent.PlayerEnter, p) -- end @@ -87,51 +87,47 @@ end function M:SendXiPaiAction(callBack) local _data = {} - local _client = ControllerManager.GameNetClinet + local _client = ControllerManager.GameNetClinet _client:send(RunFast_Protocol.GAME_XIPAI, _data) - self.XiPaiCallBack=callBack + self.XiPaiCallBack = callBack end function M:OnEventXiPai(evt_data) - if evt_data["result"]==0 then - if self.XiPaiCallBack then - self.XiPaiCallBack() - end - else - ViewUtil.ErrorTip(1000000,"申请洗牌失败") - end - + if evt_data["result"] == 0 then + if self.XiPaiCallBack then + self.XiPaiCallBack() + end + else + ViewUtil.ErrorTip(1000000, "申请洗牌失败") + end end - - function M:OnEventXiPaiAnim(evt_data) - printlog("洗牌动画===》》》》") - pt(evt_data) - local playeridList = evt_data["list"] - local my_isXiPai=false - local other_isXiPai=false - if playeridList and #playeridList>0 then - for i=1,#playeridList do - local p = self._room:GetPlayerById(playeridList[i]) - if p== self._room.self_player then - my_isXiPai=true - else - other_isXiPai=true - end - end - end - - self._cacheEvent:Enqueue(function() - DispatchEvent(self._dispatcher,RunFast_GameEvent.EventXiPai,my_isXiPai,other_isXiPai) - end) + printlog("洗牌动画===》》》》") + pt(evt_data) + local playeridList = evt_data["list"] + local my_isXiPai = false + local other_isXiPai = false + if playeridList and #playeridList > 0 then + for i = 1, #playeridList do + local p = self._room:GetPlayerById(playeridList[i]) + if p == self._room.self_player then + my_isXiPai = true + else + other_isXiPai = true + end + end + end + + self._cacheEvent:Enqueue(function() + DispatchEvent(self._dispatcher, RunFast_GameEvent.EventXiPai, my_isXiPai, other_isXiPai) + end) end - -function M:SendCard(cards,currentCard) +function M:SendCard(cards, currentCard) local _data = {} _data["card"] = cards - _data["all_card"] = currentCard + _data["all_card"] = currentCard local _client = ControllerManager.GameNetClinet _client:send(RunFast_Protocol.RunFast_Send_Card, _data) end @@ -210,16 +206,16 @@ end function M:OnPlaySucc(evt_data) if pcall( - self.OnPlaySuccCheck,self,evt_data - ) then - - else - printlog("数据异常OnPlaySucc==>>>") - end + self.OnPlaySuccCheck, self, evt_data + ) then + + else + printlog("数据异常OnPlaySucc==>>>") + end end function M:OnPlaySuccCheck(evt_data) - local seat = evt_data["player"] + local seat = evt_data["player"] local card_obj = evt_data["card_obj"] local cards = card_obj["card_list"] local remain = evt_data["remain"] -- 报单 @@ -231,31 +227,28 @@ function M:OnPlaySuccCheck(evt_data) player.hand_count = remain local card_type, number, length, plan_three_count = self:GetCardListInfo(out_card_list) player.out_card_list = self:GetSortOutCardList(out_card_list, card_type, number, plan_three_count) - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPlaySucc, player, remain, card_type, number, otherList,length) + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPlaySucc, player, remain, card_type, number, otherList, + length) end ) end function M:OnPlaySuccCheckHandCard(evt_data) - local seat = evt_data["player"] - local cards = evt_data["handCards"] + local seat = evt_data["player"] + local cards = evt_data["handCards"] self._cacheEvent:Enqueue( - function() - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPassSuccCheckCard,seat,cards) + function() + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPassSuccCheckCard, seat, cards) end ) - end - - - function M:OnPassSucc(evt_data) local seat = evt_data["seat"] self._cacheEvent:Enqueue( function() local p = self._room:GetPlayerBySeat(seat) - p.out_card_list = {0} + p.out_card_list = { 0 } DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPassSucc, p) end ) @@ -270,6 +263,7 @@ function M:OnPutError(evt_data) end ) end + function M:TuoGuan(isTuo) local _data = {} _data["tuoguan"] = isTuo @@ -284,6 +278,7 @@ function M:Game_TuoGuan(evt_data) DispatchEvent(self._dispatcher, RunFast_GameEvent.Game_TuoGuan, tuoguan, seat) end) end + function M:OnIndexMove(evt_data) local seat = evt_data["index"] self._cacheEvent:Enqueue( @@ -303,8 +298,8 @@ function M:OnOptions(evt_data) function() local lastCardList = self:GetLastCardList(self._room.self_player.seat) local cardType, cardNum, cardLength = self:GetCardListInfo(lastCardList) - - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnOptions, play, cardType, cardNum, cardLength, pass) + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnOptions, play, cardType, cardNum, cardLength, pass, + lastCardList) end ) end @@ -319,8 +314,7 @@ function M:OnPiaoTip(evt_data) local reload = evt_data["reload"] self._cacheEvent:Enqueue( function() - - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoTips, piao,reload) + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoTips, piao, reload) end ) end @@ -331,19 +325,18 @@ function M:OnPiaoAction(evt_data) self._cacheEvent:Enqueue( function() - - DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoAction, seat,piao) + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnPiaoAction, seat, piao) end ) end function M:OnResult(evt_data) local result_type = evt_data["type"] - + local info = evt_data["info"] local winseat = evt_data["winseat"] local remaincards = evt_data["remaincards"] - DataManager.CurrenRoom.xipaiScore=evt_data["xipai_score"] + DataManager.CurrenRoom.xipaiScore = evt_data["xipai_score"] --printlog("wwwwwwwwwwwwwwwwwwwww1111111 ",result_type) --pt(evt_data) if result_type == 1 then @@ -356,7 +349,7 @@ function M:OnResult(evt_data) p.total_score = info[i]["score"] info[i]["self_user"] = p.self_user end - + DispatchEvent(self._dispatcher, RunFast_GameEvent.OnResult, over, info, winseat, remaincards) end ) @@ -393,6 +386,7 @@ function M:OnConfrimToNextGameSucc(evt_data) end ) end + function M:Game_TuoGuan(evt_data) local tuoguan = evt_data["tuoguan"] local seat = evt_data["seat"] @@ -400,6 +394,7 @@ function M:Game_TuoGuan(evt_data) DispatchEvent(self._dispatcher, RunFast_GameEvent.Game_TuoGuan, tuoguan, seat) end) end + function M:ChangeCodeByFrom(cardList, isSort) isSort = isSort or false local new_card_list = {} @@ -520,14 +515,13 @@ end --Bomb = 11 -- 牌型,大小, 长度 function M:GetCardListInfo(cardlist) - if #cardlist == 0 then return 0, 0, 0, 0 end -- 检测牌型 local card_type, card_num, card_length, plan_three_count = RunFast_CardType.None, 0, #cardlist, 0 local card_map = self:GetCardMapByList(cardlist) - + if #cardlist == 1 then card_type = RunFast_CardType.OneCard card_num = math.floor(cardlist[1] / 10) @@ -536,14 +530,12 @@ function M:GetCardListInfo(cardlist) card_num = math.floor(cardlist[1] / 10) elseif #cardlist == 3 then card_num = math.floor(cardlist[1] / 10) - if card_num==14 and DataManager.CurrenRoom.room_config.threeA==1 then + if card_num == 14 and DataManager.CurrenRoom.room_config.threeA == 1 then -- body card_type = RunFast_CardType.Bomb else card_type = RunFast_CardType.Three - end - elseif #cardlist == 4 then local max_key = 0 for k, v in pairs(card_map) do @@ -598,11 +590,9 @@ function M:GetCardListInfo(cardlist) else local one_count, two_count, three_count = 0, 0, 0 local max_one_key, max_two_key, max_three_key = 0, 0, 0 - + for k, v in pairs(card_map) do - if #v == 2 then - if k > max_two_key then max_two_key = k end @@ -612,7 +602,6 @@ function M:GetCardListInfo(cardlist) card_num = max_two_key end elseif #v == 1 then - if k > max_one_key then max_one_key = k end @@ -622,7 +611,6 @@ function M:GetCardListInfo(cardlist) card_num = max_one_key end elseif #v == 3 then - if max_three_key == 0 then max_three_key = k three_count = three_count + 1 @@ -632,10 +620,10 @@ function M:GetCardListInfo(cardlist) elseif k < max_three_key and k == max_three_key - 1 then max_three_key = k three_count = three_count + 1 - -- else - -- max_three_key = k + -- else + -- max_three_key = k end - + --three_count = three_count + 1 end end @@ -651,25 +639,17 @@ function M:GetCardListInfo(cardlist) -- card_num = max_three_key -- end plan_three_count = three_count - - if three_count * 3 == #cardlist then + + if three_count * 3 == #cardlist then card_type = RunFast_CardType.Plane card_num = max_three_key - - elseif three_count * 4 >= #cardlist and #cardlist%4==0 then + elseif three_count * 4 >= #cardlist and #cardlist % 4 == 0 then card_type = RunFast_CardType.PlaneAndOne card_num = max_three_key - - - elseif three_count * 5 >= #cardlist and #cardlist%5==0 then + elseif three_count * 5 >= #cardlist and #cardlist % 5 == 0 then card_type = RunFast_CardType.PlaneAndTwo card_num = max_three_key - - end - - - end return card_type, card_num, card_length, plan_three_count @@ -681,7 +661,7 @@ function M:GetCardMapByList(cardlist) local card = cardlist[i] local card_num = math.floor(cardlist[i] / 10) if card_map[card_num] == nil then - card_map[card_num] = {card} + card_map[card_num] = { card } else card_map[card_num][#card_map[card_num] + 1] = card end diff --git a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua index 3728cf51..210d106e 100644 --- a/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua +++ b/lua_probject/extend_project/extend/poker/runfast/RunFast_MainView.lua @@ -769,6 +769,7 @@ function M:EventInit() local card_type = arg[2] local card_number = arg[3] local card_length = arg[4] + local lastCardList = arg[6] local ctr_number = pass == nil and 2 or 1 self.caozuo = 1 --记录是否是自己出牌的阶段 self.pass = pass @@ -790,6 +791,7 @@ function M:EventInit() end local zdts = self._view:GetController("zidongtishi").selectedIndex self._player_card_info[1]:ShowOutCardOption(ctr_number, card_type, card_number, card_length, m, play, zdts) + self._player_card_info[1]._cardCheck:initLastCard(lastCardList) end) -- 托管 _gamectr:AddEventListener(RunFast_GameEvent.Game_TuoGuan, function(...) diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 1a3f69c2..c3f4bfeb 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -40,9 +40,12 @@ function M:InitView(url, use_custom_bg) local _cardbox = _view:GetChild("cardbox") self._zhuanpanCtr = _cardbox:GetController("zuozi") - self._ctr_cardbox = _cardbox:GetController("c1") - self._tex_leftTime = _cardbox:GetChild("tex_leftnum") + -- self._ctr_cardbox = _cardbox:GetController("c1") + -- self._tex_leftTime = _cardbox:GetChild("tex_leftnum") + local centerBox = _view:GetChild("Comp_ConterBox") + self._ctr_cardbox = centerBox:GetController("seat") + self._tex_leftTime = centerBox:GetChild("Text_Time") if self._room.card_type == 2 then self:Change3d(true) diff --git a/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes b/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes index 4baba036..ec30cabb 100644 Binary files a/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes and b/wb_unity_pro/Assets/ART/base/main_majiang/ui/main_majiang_fui.bytes differ