diff --git a/lua_probject/base_project/Game/View/Common/ModalWaitingWindow.lua b/lua_probject/base_project/Game/View/Common/ModalWaitingWindow.lua index ad8ad0fc..d7202d83 100644 --- a/lua_probject/base_project/Game/View/Common/ModalWaitingWindow.lua +++ b/lua_probject/base_project/Game/View/Common/ModalWaitingWindow.lua @@ -1,6 +1,5 @@ - ModalWaitingWindow = { - + } local M = ModalWaitingWindow @@ -8,7 +7,7 @@ local M = ModalWaitingWindow local modal_wait_win_url = "ui://Common/GlobalModalWaiting" local modal_panel = nil function ModalWaitingWindow.new() - local self = setmetatable({}, {__index = M}) + local self = setmetatable({}, { __index = M }) self.class = "ModalWaitingWindow" self._view = UIPackage.CreateObjectFromURL(modal_wait_win_url) self.txt_title = self._view:GetChild("title") @@ -22,7 +21,7 @@ function ModalWaitingWindow.new() self._view:Center() GRoot.inst:AddChild(modal_panel) return self -end +end function M:Show() modal_panel.visible = true @@ -47,7 +46,7 @@ function ModalWaitingWindow.ShowModal(title) end function ModalWaitingWindow.CloseModal() - if(_inst) then + if (_inst) then _inst:Close() end -end \ No newline at end of file +end diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index 982a23e2..da6481f8 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -194,7 +194,7 @@ function M:_evtInviteResponse(...) return else UpdateBeat:Remove(self.OnUpdate, self) - ViewManager.ChangeView(ViewManager.View_Main, gameId) + ViewManager.ChangeView(ViewManager.View_Main, gameId, { _flag_showTip = true }) end end, groupid, diff --git a/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua b/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua index 4151c2d1..38efa988 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua @@ -72,8 +72,8 @@ function M:FillData() local config = ExtendManager.GetExtendConfig(play.gameId) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(play.config) - self._viewText_playConfig.text = play.hp_times/1000 .. "倍," .. gamePlay + local gamePlay = mode:LoadConfigToDetail(play.config, play.hpData) + self._viewText_playConfig.text = play.hp_times / 1000 .. "倍," .. gamePlay end function M:Destroy() diff --git a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua index 3c0e8af5..0dfaac13 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyMyFamily.lua @@ -140,7 +140,6 @@ function FamilyMyFamily:Close() end function FamilyMyFamily:Refalsh() - self.family = DataManager.groups.groupMap[self.groupId] self.tex_fName.text = Utils.TextOmit(self.family.name, 6, "...") @@ -220,9 +219,11 @@ function FamilyMyFamily:Init() if curView.class == "FamilyMainView" then curView:PlayEdit() else - local view = ViewManager.ChangeView(ViewManager.View_Family, function() - view:PlayEdit() - end) + local view = ViewManager.ChangeView(ViewManager.View_Family, { + _s_callback = function() + view:PlayEdit() + end + }) end end) @@ -236,9 +237,11 @@ function FamilyMyFamily:Init() if curView.class == "FamilyMainView" then curView:ShowShop() else - local view = ViewManager.ChangeView(ViewManager.View_Family, function() - view:ShowShop() - end) + local view = ViewManager.ChangeView(ViewManager.View_Family, { + _s_callback = function() + view:ShowShop() + end + }) end end) diff --git a/lua_probject/base_project/Game/View/Family/PlayEditView.lua b/lua_probject/base_project/Game/View/Family/PlayEditView.lua index 3f7ee9c0..81130597 100644 --- a/lua_probject/base_project/Game/View/Family/PlayEditView.lua +++ b/lua_probject/base_project/Game/View/Family/PlayEditView.lua @@ -74,7 +74,8 @@ function PlayEditView:Init() local pId = playList[index].id -- times倍数 local times = json.decode(playList[index].hpData).times - obj:GetChild('Label_details'):GetChild('title').text = times / 1000 .. "倍," .. mode:LoadConfigToDetail(playList[index].config) + obj:GetChild('Label_details'):GetChild('title').text = times / 1000 .. + "倍," .. mode:LoadConfigToDetail(playList[index].config, playList[index].hpData) obj:GetChild('text_playName').emojies = EmojiDitc.EmojiesDitc obj:GetChild('text_playName').text = Utils.TextOmit(playList[index].name, 6, "...") obj:GetController('type').selectedIndex = 1 diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 656d8c39..bc4c18a4 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -256,10 +256,11 @@ function M:Reflash() --self:ConnetFamily(1, groups) self.list_family.numItems = #DataManager.groups.groupList local chooseIndex = 1 - if FamilyView.lastId then + local lastID = Utils.LoadLocalFile("Family_lastID" .. DataManager.SelfUser.account_id) + if lastID then + lastID = tonumber(lastID) for i = 1, #DataManager.groups.groupList do - if FamilyView.lastId == DataManager.groups.groupList[i].id then - FamilyView.lastId = nil + if lastID == DataManager.groups.groupList[i].id then chooseIndex = i end end @@ -605,7 +606,8 @@ function M:UpdateFamilyRoom(fgCtr, id) local gameId = playGameInfoTable[roomList[newIndex].pid].gameId local config = ExtendManager.GetExtendConfig(gameId) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(playGameInfoTable[roomList[newIndex].pid].config) + local gamePlay = mode:LoadConfigToDetail(playGameInfoTable[roomList[newIndex].pid].config, + playGameInfoTable[roomList[newIndex].pid].hpData) local play = self._group:getPlay(roomList[newIndex].pid) local times = json.decode(play.hpData).times gamePlay = times / 1000 .. "倍," .. gamePlay @@ -648,7 +650,7 @@ function M:UpdateFamilyRoom(fgCtr, id) else UpdateBeat:Remove(self.OnUpdate, self) FamilyView.lastId = self._group.id - ViewManager.ChangeView(ViewManager.View_Main, gameId) + ViewManager.ChangeView(ViewManager.View_Main, gameId, { _flag_showTip = true }) end end, id, @@ -690,7 +692,7 @@ function M:UpdateFamilyRoom(fgCtr, id) -- times倍数 local times = json.decode(playList[newIndex].hpData).times local gamePlay = times / 1000 .. "倍," - gamePlay = gamePlay .. mode:LoadConfigToDetail(playList[newIndex].config) + gamePlay = gamePlay .. mode:LoadConfigToDetail(playList[newIndex].config, playList[newIndex].hpData) obj:GetChild('Label_gameRule').title = gamePlay local roomName = Utils.TextOmit(playList[newIndex].name, 6, "") roomName = string.format("(%s)%s", playList[newIndex].game_name, roomName) @@ -724,7 +726,8 @@ function M:UpdateFamilyRoom(fgCtr, id) else UpdateBeat:Remove(self.OnUpdate, self) FamilyView.lastId = self._group.id - ViewManager.ChangeView(ViewManager.View_Main, playList[newIndex].gameId) + ViewManager.ChangeView(ViewManager.View_Main, playList[newIndex].gameId, + { _flag_showTip = true }) end end, id, @@ -821,6 +824,7 @@ function M:ConnetFamily(index, groups) local fgCtr = ControllerManager.GetController(NewGroupController) ViewUtil.ShowModalWait(self._root_view, "正在进入亲友圈......") + Utils.SaveLocalFile("Family_lastID" .. DataManager.SelfUser.account_id, self._group.id) self:EnterGroup(fgCtr, self._group.id) --[[ diff --git a/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua b/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua index 51f9fafd..9946a30c 100644 --- a/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua +++ b/lua_probject/base_project/Game/View/Lobby/LobbySettingView.lua @@ -59,7 +59,7 @@ function M:init(url) local btn_quit = view:GetChild('btn_exitAccount') btn_quit.onClick:Set( function() - -- GameApplication.Instance:QuitGameOnUnity(); + Application.Quit() end ) --[[ diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 979fdda9..16c72519 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -497,7 +497,7 @@ function M:GetPlayerInfoData() self:ShowPlayerInfo(data.raffle, data.diamo, data.newMail) if data.group_id ~= 0 then -- 重连 - self:ReconnectRoom(data.groupId) + -- self:ReconnectRoom(data.groupId) end end end) diff --git a/lua_probject/base_project/Game/View/MainView.lua b/lua_probject/base_project/Game/View/MainView.lua index 6fd04d2d..131b57ad 100644 --- a/lua_probject/base_project/Game/View/MainView.lua +++ b/lua_probject/base_project/Game/View/MainView.lua @@ -274,8 +274,6 @@ function M:InitView(url, isHideIpAdds) self._btn_record.onTouchEnd:Set(self.__RecordTouchEnd, self) Voice.BeginRecord() self._ctr_voice.selectedIndex = 1 - self.__runwait_record = nil - self.__runwait_record = coroutine.start(self.__WaitRecord, self) end end) end @@ -317,8 +315,7 @@ function M:InitView(url, isHideIpAdds) if self._chat_Talk then self._ctr_voice = _view:GetController('voice') - self._chat_Talk.onTouchBegin:Set(function() - + self._chat_Talk.onTouchBegin:Set(function(context) if self._room.room_config.config.hpData.BanChat == 1 then ViewUtil.ShowBannerOnScreenCenter("本房间禁止快捷聊天") return @@ -328,12 +325,16 @@ function M:InitView(url, isHideIpAdds) self:__SetRecordEnable() else self._record_time = 0 + self._record_pos = Vector2.New(context.inputEvent.x, context.inputEvent.y) + self._record_view = _view:GetChild('comp_voice') + self._record_view_ctr = self._record_view:GetController('ctr_cancel') GameApplication.Instance.StopMusic = GameApplication.Instance.StopMusic + 1 self._chat_Talk.onTouchEnd:Set(self.__RecordTouchEnd, self) + self._chat_Talk.onTouchMove:Set(handler(self, self.__RecordTouchMove)) Voice.BeginRecord() self._ctr_voice.selectedIndex = 1 - self.__runwait_record = nil - self.__runwait_record = coroutine.start(self.__WaitRecord, self) + -- self.__runwait_record = nil + -- self.__runwait_record = coroutine.start(self.__WaitRecord, self) end end) end @@ -696,6 +697,14 @@ function M:NewSettingView() return settingView end +function M:__RecordTouchMove(context) + if Mathf.Abs(context.inputEvent.x - self._record_pos.x) >= 50 or Mathf.Abs(context.inputEvent.y - self._record_pos.y) >= 50 then + self._record_view_ctr.selectedIndex = 1 + else + self._record_view_ctr.selectedIndex = 0 + end +end + function M:__RecordTouchEnd() if (self.__runwait_record ~= nil) then coroutine.stop(self.__runwait_record) @@ -1323,8 +1332,14 @@ function M:OnUpdate() end if self._view:GetChild('gcm_chat') then self._record_time = self._record_time + deltaTime + if self._record_view then + self._record_view.title = math.floor(self._record_time) .. "\"" + end elseif self._record_time then self._record_time = self._record_time + deltaTime + if self._record_view then + self._record_view.title = math.floor(self._record_time) .. "\"" + end end local _left_time = self._left_time diff --git a/lua_probject/base_project/Game/View/RoomInfoView.lua b/lua_probject/base_project/Game/View/RoomInfoView.lua index 2a8b874e..c0243985 100644 --- a/lua_probject/base_project/Game/View/RoomInfoView.lua +++ b/lua_probject/base_project/Game/View/RoomInfoView.lua @@ -24,7 +24,7 @@ end function M:FillRoomConfig(roominfo_panel, _room) local config = ExtendManager.GetExtendConfig(_room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(_room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(_room.room_config.config), json.encode(_room.room_config.hpData)) local tex_gametype = roominfo_panel:GetChild("tex_gametype") tex_gametype.text = _room.room_config:GetGameName() diff --git a/lua_probject/base_project/Game/View/ViewUtil.lua b/lua_probject/base_project/Game/View/ViewUtil.lua index 99743ae2..d87b400e 100644 --- a/lua_probject/base_project/Game/View/ViewUtil.lua +++ b/lua_probject/base_project/Game/View/ViewUtil.lua @@ -37,12 +37,21 @@ end local modal_wait_win = nil -- local modal_wait_win_url = "ui://Common/GlobalModalWaiting" -function ViewUtil.ShowModalWait(blur_view, title) +function ViewUtil.ShowModalWait(blur_view, title, time) ViewUtil.CloseModalWait() - ModalWaitingWindow.ShowModal(title) + ViewUtil.continue = coroutine.start( + function() + coroutine.wait(time or 1) + ModalWaitingWindow.ShowModal(title) + end + ) end function ViewUtil.CloseModalWait() + if ViewUtil.continue then + coroutine.stop(ViewUtil.continue) + ViewUtil.continue = nil + end ModalWaitingWindow.CloseModal() end diff --git a/lua_probject/base_project/Game/ViewManager.lua b/lua_probject/base_project/Game/ViewManager.lua index 573b51bc..cbb65a1a 100644 --- a/lua_probject/base_project/Game/ViewManager.lua +++ b/lua_probject/base_project/Game/ViewManager.lua @@ -99,7 +99,7 @@ function ViewManager.GetCurrenView() return _currenView end -function ViewManager.ChangeViewByClass(dview_class, callback) +function ViewManager.ChangeViewByClass(dview_class, data) if (_currenView ~= nil) then if _currenView._close_destroy then _currenView:Destroy() @@ -116,7 +116,12 @@ function ViewManager.ChangeViewByClass(dview_class, callback) if not tem then tem = dview_class.new() - tem._s_callback = callback + if data and data._s_callback then + tem._s_callback = data._s_callback + end + if data then + tem._flag_showTip = data._flag_showTip + end _viewMap[dview_class] = tem end @@ -128,7 +133,7 @@ function ViewManager.ChangeViewByClass(dview_class, callback) end local last_game_id = 0 -function ViewManager.ChangeView(id, game_id, callback) +function ViewManager.ChangeView(id, game_id, data) -- if id==2 then -- printlog("cccccccccccccccccccccccccccccccc") -- printlog(debug.traceback()) @@ -148,7 +153,7 @@ function ViewManager.ChangeView(id, game_id, callback) if not dview_class then return end - return ViewManager.ChangeViewByClass(dview_class, callback) + return ViewManager.ChangeViewByClass(dview_class, data) end function ViewManager.OnApplicationPause() diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua index 1c3cf858..174d8b0f 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXClearingView.lua @@ -132,7 +132,7 @@ end function M:fillResult0(room, peopleNum, result) local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) self.list_lastCard.numItems = #result.cardList diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua index bf3af543..4e8badc0 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXGameInfo.lua @@ -173,13 +173,17 @@ function M:LoadConfigData(data) self._config:GetChild("n93").text = string.format("奖%s马", data.jiangma * 2) end -function M:LoadConfigToDetail(data) - +function M:LoadConfigToDetail(data, hpdata) local configData = data if type(data) == 'string' then configData = json.decode(data) end + local hpData = hpdata + if type(hpdata) == 'string' then + hpData = json.decode(hpdata) + end + local returnString = string.format("人数%s人", configData.maxPlayers) if configData.jiangma then returnString = string.format("%s,%s马", returnString, @@ -206,8 +210,29 @@ function M:LoadConfigToDetail(data) if configData.zuangfenfanbei then returnString = string.format("%s%s", returnString, configData.zikechengshun == 0 and ",庄家积分翻倍" or "") end + if configData.GPSDetection then + returnString = string.format("%s%s", returnString, + configData.GPSDetection == 0 and ",距离不限制" or string.format(",距离限制%s米", configData.GPSDetection)) + end + if configData.tuoguan_active_time then + returnString = string.format("%s%s", returnString, + configData.tuoguan_active_time == 0 and ",不自动托管" or string.format(",%s秒托管", configData.tuoguan_active_time)) + end + if hpData then + if hpData.JieShan then + returnString = string.format("%s%s", returnString, + hpData.JieShan == 1 and ",托管结束后不解散" or + string.format(",托管%s结束后强制解散", hpData.JieShan == 2 and "当局" or string.format("%s局", hpData.JieShan - 1))) + end + if hpData.BanChat then + returnString = string.format("%s%s", returnString, hpData.BanChat == 1 and ",不允许快捷聊天" or "") + end + if hpData.BanMissile then + returnString = string.format("%s%s", returnString, hpData.BanMissile == 1 and ",关闭互动表情" or "") + end + end - returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data) + returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data, hpdata) return returnString end diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua index 714a0796..b76b9b8e 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXMainView.lua @@ -59,7 +59,7 @@ function M:InitView(url) --]] local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('wanfa_text').text = gamePlay self.jing = self._view:GetChild('jing') diff --git a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua index 24efda2a..67bc8052 100644 --- a/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/fuzhou/EXWitnessView.lua @@ -58,7 +58,7 @@ function M:InitView(url) ------------------渲染桌面信息-------------------------- local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('text_time').text = os.date("%H:%M", os.time()) self._view:GetChild('text_roomId').text = room.room_id @@ -366,7 +366,6 @@ function M:UpdateCardBox(seat) end function M:OnFangziAction(...) - local arg = { ... } local _player_card_info = self._player_card_info local fz = arg[1] diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua index 2187e8dc..0c80ea43 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXClearingView.lua @@ -130,7 +130,7 @@ end function M:fillResult0(room, peopleNum, result) local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) self.list_lastCard.numItems = #result.cardList diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua index da94d57e..6ccddf07 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXGameInfo.lua @@ -169,8 +169,7 @@ function M:LoadConfigData(data) self._config:GetChild("n93").text = string.format("奖%s马", data.jiangma * 2) end -function M:LoadConfigToDetail(data) - +function M:LoadConfigToDetail(data, hpData) local configData = data if type(data) == 'string' then configData = json.decode(data) @@ -208,8 +207,28 @@ function M:LoadConfigToDetail(data) if configData.sanjingjiangma then returnString = string.format("%s%s", returnString, configData.sanjingjiangma == 0 and ",三精算奖马" or "") end - - returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data) + if configData.GPSDetection then + returnString = string.format("%s%s", returnString, + configData.GPSDetection == 0 and ",距离不限制" or string.format(",距离限制%s米", configData.GPSDetection)) + end + if configData.tuoguan_active_time then + returnString = string.format("%s%s", returnString, + configData.tuoguan_active_time == 0 and ",不自动托管" or string.format(",%s秒托管", configData.tuoguan_active_time)) + end + if hpData then + if hpData.JieShan then + returnString = string.format("%s%s", returnString, + hpData.JieShan == 1 and ",托管结束后不解散" or + string.format(",托管%s结束后强制解散", hpData.JieShan == 2 and "当局" or string.format("%s局", hpData.JieShan - 1))) + end + if hpData.BanChat then + returnString = string.format("%s%s", returnString, hpData.BanChat == 1 and ",不允许快捷聊天" or "") + end + if hpData.BanMissile then + returnString = string.format("%s%s", returnString, hpData.BanMissile == 1 and ",关闭互动表情" or "") + end + end + returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data, hpData) return returnString end diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua index ed9a2279..6effee29 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXMainView.lua @@ -59,7 +59,7 @@ function M:InitView(url) --]] local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('wanfa_text').text = gamePlay self.jing = self._view:GetChild('jing') diff --git a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua index ba1f170d..ef25e50d 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/EXWitnessView.lua @@ -57,7 +57,7 @@ function M:InitView(url) ------------------渲染桌面信息-------------------------- local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('text_time').text = os.date("%H:%M", os.time()) self._view:GetChild('text_roomId').text = room.room_id diff --git a/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua b/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua index 7359c4b6..b2189179 100644 --- a/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua +++ b/lua_probject/extend_project/extend/majiang/jinxi/HuCardImg.lua @@ -1,6 +1,6 @@ local HuCardImg = {} -HuCardImg[14] = { "tile_cs_deguo", "tile_cs_shisanlan" } +HuCardImg[14] = { "tile_cs_shisanlan", "tile_cs_deguo" } HuCardImg[15] = { "tile_cs_qxshisanlan", "tile_cs_deguo" } HuCardImg[16] = { "tile_cs_dihu" } HuCardImg[17] = { "tile_cs_pinghu" } diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua index 40f263e8..382e6de3 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXClearingView.lua @@ -128,7 +128,7 @@ end function M:fillResult0(room, peopleNum, result) local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) self.list_lastCard.numItems = #result.cardList diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua index ebe1623c..7cefc9f6 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXGameController.lua @@ -246,6 +246,10 @@ function M:OnEventFzTips(evt_data) -- end tiplist:AddTip(tip) end + --排序规则,胡杠碰 + tiplist:SortList(function(a, b) + return a.type < b.type + end) DispatchEvent(self._dispatcher, TX_GameEvent.FZTips, tiplist, weight) end) end diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua index 52bd65ea..b9b7e194 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXGameInfo.lua @@ -152,7 +152,6 @@ function M:LoadConfigData(data) end function M:LoadConfigToDetail(data) - local configData = data if type(data) == 'string' then configData = json.decode(data) @@ -164,7 +163,28 @@ function M:LoadConfigToDetail(data) configData.tuoguan == 0 and string.format("%d秒后自动托管", configData.tuoguan_active_time) or "不能托管", configData.jingbibo == 1 and "有精必博" or "有精可胡") - returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data) + if configData.GPSDetection then + returnString = string.format("%s%s", returnString, + configData.GPSDetection == 0 and ",距离不限制" or string.format(",距离限制%s米", configData.GPSDetection)) + end + if configData.tuoguan_active_time then + returnString = string.format("%s%s", returnString, + configData.tuoguan_active_time == 0 and ",不自动托管" or string.format(",%s秒托管", configData.tuoguan_active_time)) + end + if hpData then + if hpData.JieShan then + returnString = string.format("%s%s", returnString, + hpData.JieShan == 1 and ",托管结束后不解散" or + string.format(",托管%s结束后强制解散", hpData.JieShan == 2 and "当局" or string.format("%s局", hpData.JieShan - 1))) + end + if hpData.BanChat then + returnString = string.format("%s%s", returnString, hpData.BanChat == 1 and ",不允许快捷聊天" or "") + end + if hpData.BanMissile then + returnString = string.format("%s%s", returnString, hpData.BanMissile == 1 and ",关闭互动表情" or "") + end + end + returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data, hpData) return returnString end diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua index 28ac71cb..1e052db1 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXMainView.lua @@ -59,7 +59,7 @@ function M:InitView(url) --]] local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('wanfa_text').text = gamePlay self.jing = self._view:GetChild('jing') @@ -637,7 +637,7 @@ function M:__FangziTip(tip, weight) local _lit_fanzi = _chipeng_tip:GetChild("list") --_lit_fanzi:SetVirtual() - local _tlist = tip.tip_map_id + local _tlist = tip.tip_sortList _lit_fanzi.itemRenderer = function(index, obj) local type = obj:GetController('type') if index == tip.tip_num then diff --git a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua index a9b6c4fe..253db6ad 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/EXWitnessView.lua @@ -59,7 +59,7 @@ function M:InitView(url) ------------------渲染桌面信息-------------------------- local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('text_time').text = os.date("%H:%M", os.time()) self._view:GetChild('text_roomId').text = room.room_id diff --git a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua index 90f548d8..77fd052c 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/ExtendConfig.lua @@ -98,6 +98,7 @@ function M:FillRoomData(s2croom) room.curren_outcard_seat = _reloadInfo["curren_outcard_seat"] room.last_outcard_seat = last_outcard_seat room.playing = playing + room.reload = reload if jing then room.jing = jing end diff --git a/lua_probject/extend_project/extend/majiang/lichuan/HuCardImg.lua b/lua_probject/extend_project/extend/majiang/lichuan/HuCardImg.lua index e9a4daa1..f0f90c2e 100644 --- a/lua_probject/extend_project/extend/majiang/lichuan/HuCardImg.lua +++ b/lua_probject/extend_project/extend/majiang/lichuan/HuCardImg.lua @@ -8,7 +8,7 @@ HuCardImg[10] = { "tile_cs_deguo" } HuCardImg[11] = { "tile_cs_qiangganghu" } HuCardImg[12] = { "tile_cs_gangshanghua" } HuCardImg[13] = { "tile_cs_quanqiuren" } -HuCardImg[14] = { "tile_cs_deguo", "tile_cs_shisanlan" } +HuCardImg[14] = { "tile_cs_shisanlan", "tile_cs_deguo" } HuCardImg[15] = { "tile_cs_qxshisanlan", "tile_cs_deguo" } diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua index 7c6c277e..5082b1d5 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXClearingView.lua @@ -128,7 +128,7 @@ end function M:fillResult0(room, peopleNum, result) local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) self.list_lastCard.numItems = #result.cardList diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua index 4d87eb71..e0b5df95 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXGameInfo.lua @@ -179,7 +179,6 @@ function M:LoadConfigData(data) end function M:LoadConfigToDetail(data) - local configData = data if type(data) == 'string' then configData = json.decode(data) @@ -195,7 +194,28 @@ function M:LoadConfigToDetail(data) configData.jiahu and ",可以假胡" or "", configData.fengding and ",封顶20炮" or "", configData.zhuanwan and "大转弯" or "小转弯") - returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data) + if configData.GPSDetection then + returnString = string.format("%s%s", returnString, + configData.GPSDetection == 0 and ",距离不限制" or string.format(",距离限制%s米", configData.GPSDetection)) + end + if configData.tuoguan_active_time then + returnString = string.format("%s%s", returnString, + configData.tuoguan_active_time == 0 and ",不自动托管" or string.format(",%s秒托管", configData.tuoguan_active_time)) + end + if hpData then + if hpData.JieShan then + returnString = string.format("%s%s", returnString, + hpData.JieShan == 1 and ",托管结束后不解散" or + string.format(",托管%s结束后强制解散", hpData.JieShan == 2 and "当局" or string.format("%s局", hpData.JieShan - 1))) + end + if hpData.BanChat then + returnString = string.format("%s%s", returnString, hpData.BanChat == 1 and ",不允许快捷聊天" or "") + end + if hpData.BanMissile then + returnString = string.format("%s%s", returnString, hpData.BanMissile == 1 and ",关闭互动表情" or "") + end + end + returnString = returnString .. IGameInfo.LoadConfigToDetail(self, data, hpData) return returnString end diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua index a74c20cd..a19b5d4e 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXMainView.lua @@ -58,7 +58,7 @@ function M:InitView(url) --]] local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('wanfa_text').text = gamePlay self.jing = self._view:GetChild('jing') diff --git a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua index a9df19b9..d06fb351 100644 --- a/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua +++ b/lua_probject/extend_project/extend/majiang/nancheng/EXWitnessView.lua @@ -57,7 +57,7 @@ function M:InitView(url) ------------------渲染桌面信息-------------------------- local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild('text_time').text = os.date("%H:%M", os.time()) self._view:GetChild('text_roomId').text = room.room_id diff --git a/lua_probject/extend_project/extend/zipai/fulushou/main/CardCheck.lua b/lua_probject/extend_project/extend/zipai/fulushou/main/CardCheck.lua index 9b181d02..ef3b36ea 100644 --- a/lua_probject/extend_project/extend/zipai/fulushou/main/CardCheck.lua +++ b/lua_probject/extend_project/extend/zipai/fulushou/main/CardCheck.lua @@ -1,48 +1,48 @@ -- 检测牌是否存在 local function checkCard(eventCard, cardList, num) - if num == nil then - num = 1 - end - local result = 0 - for i = 1, #cardList do - if (cardList[i] == eventCard) then - result = result + 1 - if (result == num) then - return true - end - end - end - return false -end - -local function checkCard1(eventCard, cardList, num) - if num == nil then - num = 1 - end - local result = 0 - - for k,v in pairs(cardList) do - if k==eventCard then - result = v - if result==num then + if num == nil then + num = 1 + end + local result = 0 + for i = 1, #cardList do + if (cardList[i] == eventCard) then + result = result + 1 + if (result == num) then return true end end end - + return false +end + +local function checkCard1(eventCard, cardList, num) + if num == nil then + num = 1 + end + local result = 0 + + for k, v in pairs(cardList) do + if k == eventCard then + result = v + if result == num then + return true + end + end + end + return false end local function GetCheckCardNum(eventCard, cardList) - local result = 0 + local result = 0 - for k,v in pairs(cardList) do - if k==eventCard then + for k, v in pairs(cardList) do + if k == eventCard then result = v return v end end - + return result end @@ -51,1025 +51,941 @@ end -- 移除指定数量的牌 local function removeCard(cardList, card, count) - for i = 1, count do - list_remove(cardList, card) - end + for i = 1, count do + list_remove(cardList, card) + end end local function checkCardAndRomve(eventCard, cardList, num) - if (checkCard(eventCard, cardList, num)) then - removeCard(cardList, eventCard, num) - return true - end - return false + if (checkCard(eventCard, cardList, num)) then + removeCard(cardList, eventCard, num) + return true + end + return false end -- 获取列表中牌数量 local function cardNum(eventCard, cardList) - local result = 0 - for i = 1, #cardList do - local card = cardList[i] - if (card == eventCard) then - result = result + 1 - end - end - return result + local result = 0 + for i = 1, #cardList do + local card = cardList[i] + if (card == eventCard) then + result = result + 1 + end + end + return result end local M = { - cardList = nil, - stack = nil, - stackHuxi = nil, - cbCardMap=nil, + cardList = nil, + stack = nil, + stackHuxi = nil, + cbCardMap = nil, ting_pai = true } function M:push(cardGroup) - self.stack[#self.stack + 1] = cardGroup + self.stack[#self.stack + 1] = cardGroup end + function M:pushhuxi(cardGroup) - self.stackHuxi[#self.stackHuxi + 1] = cardGroup + self.stackHuxi[#self.stackHuxi + 1] = cardGroup end function M:rollBack() - local cardGroup = self.stack[#self.stack] - table.remove(self.stack, #self.stack) - for _, card in ipairs(cardGroup) do - self.cardList[#self.cardList + 1] = card - end - table.sort(self.cardList) + local cardGroup = self.stack[#self.stack] + table.remove(self.stack, #self.stack) + for _, card in ipairs(cardGroup) do + self.cardList[#self.cardList + 1] = card + end + table.sort(self.cardList) end - - - -function M:tryWin(player,room) - return self:checkWinOpList(player,player.fz_list,room) +function M:tryWin(player, room) + return self:checkWinOpList(player, player.fz_list, room) end - - -function M:checkWinOpList(player,opcardList,room) - local isHu=self:AnalyseChiHuCard(opcardList,room.room_config.config) +function M:checkWinOpList(player, opcardList, room) + local isHu = self:AnalyseChiHuCard(opcardList, room.room_config.config, room.room_config.hpData) return isHu end - -function M:AnalyseChiHuCard(opcardList,roomConfig) - return self:AnalyseChiHuCardEx(opcardList,roomConfig) - +function M:AnalyseChiHuCard(opcardList, roomConfig) + return self:AnalyseChiHuCardEx(opcardList, roomConfig) end -function M:AnalyseChiHuCardEx(opcardList,roomConfig) - local tempCardList=membe_deep_clone(self.cbCardMap) - +function M:AnalyseChiHuCardEx(opcardList, roomConfig) + local tempCardList = membe_deep_clone(self.cbCardMap) + --//变量定义 -- List tagAnalyseItemList = new ArrayList(); -- List wChiHuKind = new ArrayList(); - local tagAnalyseItemList={} - local wChiHuKind={} - self:AnalyseCard(tempCardList,opcardList,tagAnalyseItemList,roomConfig) - local huxi=0 - for i=1,#tagAnalyseItemList do - huxi=huxi+tagAnalyseItemList[i].huxi + local tagAnalyseItemList = {} + local wChiHuKind = {} + self:AnalyseCard(tempCardList, opcardList, tagAnalyseItemList, roomConfig) + local huxi = 0 + for i = 1, #tagAnalyseItemList do + huxi = huxi + tagAnalyseItemList[i].huxi end - - printlog("胡息数为=>>>",huxi) + + printlog("胡息数为=>>>", huxi) pt(tagAnalyseItemList) - if huxi >=11 then + if huxi >= 11 then return true else return false end - end - -function M:AnalyseCard(tempCardList,opCards,tagAnalyseItemList,config) - local cbCardCount=0 - for k,v in pairs(tempCardList) do - cbCardCount=cbCardCount+v +function M:AnalyseCard(tempCardList, opCards, tagAnalyseItemList, config) + local cbCardCount = 0 + for k, v in pairs(tempCardList) do + cbCardCount = cbCardCount + v end - - if cbCardCount<1 or cbCardCount>19 then return false end - - + + if cbCardCount < 1 or cbCardCount > 19 then return false end + + --List tagKindList = new ArrayList(); - local tagKindList={} - - - + local tagKindList = {} + + + --while false do repeat - local cbLessKindItem = math.floor((cbCardCount - 1) / 3) - if cbLessKindItem+#opCards ~=6 then + local cbLessKindItem = math.floor((cbCardCount - 1) / 3) + if cbLessKindItem + #opCards ~= 6 then break end - + --//单吊判断 - if cbLessKindItem==0 then - if not ((cbCardCount==1) and #opCards==6) then + if cbLessKindItem == 0 then + if not ((cbCardCount == 1) and #opCards == 6) then return false end - - for k,v in pairs(tempCardList) do - if v==1 then - return AnalyseCardFuLuShou(cbLessKindItem,nil,k,opCards,tagAnalyseItemList,config) + + for k, v in pairs(tempCardList) do + if v == 1 then + return AnalyseCardFuLuShou(cbLessKindItem, nil, k, opCards, tagAnalyseItemList, config) end end - + return false - end - + --//拆分分析 - if cbCardCount>=3 then - for k,v in pairs(tempCardList) do - if v>=2 and checkCard1( math.floor(k/100)*100+4,tempCardList,1) then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Peng + if cbCardCount >= 3 then + for k, v in pairs(tempCardList) do + if v >= 2 and checkCard1(math.floor(k / 100) * 100 + 4, tempCardList, 1) then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Peng kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k kindItem.cbCardList[2] = k - kindItem.cbCardList[3] = math.floor(k / 100) * 100 + 4 - table.insert(tagKindList,kindItem) + kindItem.cbCardList[3] = math.floor(k / 100) * 100 + 4 + table.insert(tagKindList, kindItem) end - if v>=3 then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Peng + if v >= 3 then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Peng kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k kindItem.cbCardList[2] = k - kindItem.cbCardList[3] = k - table.insert(tagKindList,kindItem) + kindItem.cbCardList[3] = k + table.insert(tagKindList, kindItem) end - + --//连牌判断 - if k%100>=1 and k%100<4 and v>0 then - for i=1,v do - if cardNum(k+1,self.cardList)>=i and cardNum(k+2,self.cardList)>=i and (k+1)%100~=4 and (k+2)%100~=4 then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Chi + if k % 100 >= 1 and k % 100 < 4 and v > 0 then + for i = 1, v do + if cardNum(k + 1, self.cardList) >= i and cardNum(k + 2, self.cardList) >= i and (k + 1) % 100 ~= 4 and (k + 2) % 100 ~= 4 then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Chi kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k - kindItem.cbCardList[2] = k+1 - kindItem.cbCardList[3] = k +2 - table.insert(tagKindList,kindItem) + kindItem.cbCardList[2] = k + 1 + kindItem.cbCardList[3] = k + 2 + table.insert(tagKindList, kindItem) end - - if cardNum(k+1,self.cardList)>=i and (k+1)%100~=4 and cardNum( math.floor(k/100)*100+4,self.cardList)>=i then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Chi + + if cardNum(k + 1, self.cardList) >= i and (k + 1) % 100 ~= 4 and cardNum(math.floor(k / 100) * 100 + 4, self.cardList) >= i then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Chi kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k - kindItem.cbCardList[2] = k+1 - kindItem.cbCardList[3] = math.floor(k/100) * 100 + 4 - table.insert(tagKindList,kindItem) + kindItem.cbCardList[2] = k + 1 + kindItem.cbCardList[3] = math.floor(k / 100) * 100 + 4 + table.insert(tagKindList, kindItem) end - - - if cardNum(k+2,self.cardList)>=i and (k+2)%100~=4 and cardNum( math.floor(k/100)*100+4,self.cardList)>=i then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Chi + + + if cardNum(k + 2, self.cardList) >= i and (k + 2) % 100 ~= 4 and cardNum(math.floor(k / 100) * 100 + 4, self.cardList) >= i then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Chi kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k - kindItem.cbCardList[2] = k+1 - kindItem.cbCardList[3] = math.floor(k/100) * 100 + 4 - table.insert(tagKindList,kindItem) + kindItem.cbCardList[2] = k + 1 + kindItem.cbCardList[3] = math.floor(k / 100) * 100 + 4 + table.insert(tagKindList, kindItem) end - - end - - - end - - - - end - end - - + + --//组合分析 - - if #tagKindList>=cbLessKindItem then - local cbIndex={} - for i=1,6 do - table.insert(cbIndex,i) + + if #tagKindList >= cbLessKindItem then + local cbIndex = {} + for i = 1, 6 do + table.insert(cbIndex, i) end - + --TagKindItem[] pKindItem = new TagKindItem[6]; - local pKindItem={} - + local pKindItem = {} + --local count = 0 - + repeat - --while true do - local cbCardMap_temp=membe_deep_clone(tempCardList) - for i=1,cbLessKindItem do - pKindItem[i]=tagKindList[i] + --while true do + local cbCardMap_temp = membe_deep_clone(tempCardList) + for i = 1, cbLessKindItem do + pKindItem[i] = tagKindList[i] end --//数量判断 local bEnoughCard = true - for i=1,cbLessKindItem * 3 do - local num1=math.floor((i-1)/3)+1 - local num2=i % 3 - if num==0 then - num2=3 + for i = 1, cbLessKindItem * 3 do + local num1 = math.floor((i - 1) / 3) + 1 + local num2 = i % 3 + if num == 0 then + num2 = 3 end - local cbCardIndex=pKindItem[num1].cbCardList[num2] - if GetCheckCardNum(cbCardIndex,cbCardMap_temp)<=0 then + local cbCardIndex = pKindItem[num1].cbCardList[num2] + if GetCheckCardNum(cbCardIndex, cbCardMap_temp) <= 0 then bEnoughCard = false break else if cbCardMap_temp[cbCardIndex] then - cbCardMap_temp[cbCardIndex]=cbCardMap_temp[cbCardIndex]-1 + cbCardMap_temp[cbCardIndex] = cbCardMap_temp[cbCardIndex] - 1 end - end - end - - + + --//胡牌判断 - - if bEnoughCard==true then - local cbCardEye = 0 - for k,v in pairs(cbCardMap_temp) do - if v==1 then - cbCardEye=k + + if bEnoughCard == true then + local cbCardEye = 0 + for k, v in pairs(cbCardMap_temp) do + if v == 1 then + cbCardEye = k break end end - + if cbCardEye ~= 0 then - local result = AnalyseCardFuLuShou(cbLessKindItem, pKindItem, cbCardEye, opCards, tagAnalyseItemList, config) + local result = AnalyseCardFuLuShou(cbLessKindItem, pKindItem, cbCardEye, opCards, + tagAnalyseItemList, config) if result then return true end end - end - - + + --//设置索引 - if cbIndex[cbLessKindItem]==#tagKindList then - local tempi=cbLessKindItem - for i=cbLessKindItem,2,-1 do - tempi=i-1 - if (cbIndex[i-1]+1)~=cbIndex[i] then + if cbIndex[cbLessKindItem] == #tagKindList then + local tempi = cbLessKindItem + for i = cbLessKindItem, 2, -1 do + tempi = i - 1 + if (cbIndex[i - 1] + 1) ~= cbIndex[i] then local cbNewIndex = cbIndex[i - 1] - for j=i-1,cbLessKindItem do - cbIndex[j]=cbNewIndex+j-i+2 + for j = i - 1, cbLessKindItem do + cbIndex[j] = cbNewIndex + j - i + 2 end break - end - - - end - - if tempi==1 then break end - + + if tempi == 1 then break end else - cbIndex[cbLessKindItem]=cbIndex[cbLessKindItem]+1 + cbIndex[cbLessKindItem] = cbIndex[cbLessKindItem] + 1 end - - - - until(false) + until (false) --end ---- - - end - - - if #tagAnalyseItemList>0 then break end - - - --end - until(true) - - tagKindList={} - - + + + if #tagAnalyseItemList > 0 then break end + + + --end + until (true) + + tagKindList = {} + + repeat - --while false do - - local cbLessKindItem = math.floor((cbCardCount - 4) / 3) - if cbLessKindItem+#opCards ~=5 then + --while false do + + local cbLessKindItem = math.floor((cbCardCount - 4) / 3) + if cbLessKindItem + #opCards ~= 5 then break end - - + + --//单吊判断 - if cbLessKindItem==0 then - if not ((cbCardCount==4) and #opCards==5 )then + if cbLessKindItem == 0 then + if not ((cbCardCount == 4) and #opCards == 5) then return false end - + --//牌眼判断 -- ArrayList eyeList = new ArrayList(); -- ArrayList eyeCardList = new ArrayList(); - local eyeList={} - local eyeCardList={} - - for k,v in pairs(tempCardList) do - if v>0 then - for i=1,v do - table.insert(eyeCardList,k) + local eyeList = {} + local eyeCardList = {} + + for k, v in pairs(tempCardList) do + if v > 0 then + for i = 1, v do + table.insert(eyeCardList, k) end - end end - - if #eyeCardList~=4 then return false end - - if math.floor(eyeCardList[1]/100)== math.floor(eyeCardList[2]/100) and math.floor(eyeCardList[3]/100)== math.floor(eyeCardList[4]/100) then - local card1=eyeCardList[1] - local card2=eyeCardList[2] - local card3=eyeCardList[3] - local card4=eyeCardList[4] - local result=AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, tagAnalyseItemList, config) + + if #eyeCardList ~= 4 then return false end + + if math.floor(eyeCardList[1] / 100) == math.floor(eyeCardList[2] / 100) and math.floor(eyeCardList[3] / 100) == math.floor(eyeCardList[4] / 100) then + local card1 = eyeCardList[1] + local card2 = eyeCardList[2] + local card3 = eyeCardList[3] + local card4 = eyeCardList[4] + local result = AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, + tagAnalyseItemList, config) if result then return true end end - - - if math.floor(eyeCardList[1]/100)== math.floor(eyeCardList[3]/100) and math.floor(eyeCardList[2]/100)== math.floor(eyeCardList[4]/100) then - local card1=eyeCardList[1] - local card2=eyeCardList[3] - local card3=eyeCardList[2] - local card4=eyeCardList[4] - local result=AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, tagAnalyseItemList, config) + + + if math.floor(eyeCardList[1] / 100) == math.floor(eyeCardList[3] / 100) and math.floor(eyeCardList[2] / 100) == math.floor(eyeCardList[4] / 100) then + local card1 = eyeCardList[1] + local card2 = eyeCardList[3] + local card3 = eyeCardList[2] + local card4 = eyeCardList[4] + local result = AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, + tagAnalyseItemList, config) if result then return true end end - - if math.floor(eyeCardList[1]/100)== math.floor(eyeCardList[4]/100) and math.floor(eyeCardList[2]/100)== math.floor(eyeCardList[3]/100) then - local card1=eyeCardList[1] - local card2=eyeCardList[4] - local card3=eyeCardList[3] - local card4=eyeCardList[2] - local result=AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, tagAnalyseItemList, config) + + if math.floor(eyeCardList[1] / 100) == math.floor(eyeCardList[4] / 100) and math.floor(eyeCardList[2] / 100) == math.floor(eyeCardList[3] / 100) then + local card1 = eyeCardList[1] + local card2 = eyeCardList[4] + local card3 = eyeCardList[3] + local card4 = eyeCardList[2] + local result = AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, + tagAnalyseItemList, config) if result then return true end end - - - if #tagAnalyseItemList>0 then + + + if #tagAnalyseItemList > 0 then return true else return false end - - end - - + + --//拆分分析 if cbCardCount >= 3 then - for k,v in pairs(tempCardList) do - if v>=2 and cardNum( math.floor(k / 100) * 100 + 4,self.cardList)==1 then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Peng + for k, v in pairs(tempCardList) do + if v >= 2 and cardNum(math.floor(k / 100) * 100 + 4, self.cardList) == 1 then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Peng kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k kindItem.cbCardList[2] = k kindItem.cbCardList[3] = math.floor(k / 100) * 100 + 4 - table.insert(tagKindList,kindItem) + table.insert(tagKindList, kindItem) end - - if v>=3 then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Peng + + if v >= 3 then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Peng kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k kindItem.cbCardList[2] = k kindItem.cbCardList[3] = k - table.insert(tagKindList,kindItem) + table.insert(tagKindList, kindItem) end - + --//连牌判断 - if k%100>=1 and k%100<=4 and v>0 then - for i=1,v do - if cardNum(k+1,self.cardList)>=i and cardNum(k+2,self.cardList)>=i and (k+1)%100~=4 and (k+2)%100~=4 then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Chi + if k % 100 >= 1 and k % 100 <= 4 and v > 0 then + for i = 1, v do + if cardNum(k + 1, self.cardList) >= i and cardNum(k + 2, self.cardList) >= i and (k + 1) % 100 ~= 4 and (k + 2) % 100 ~= 4 then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Chi kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k - kindItem.cbCardList[2] = k+1 - kindItem.cbCardList[3] = k+2 - table.insert(tagKindList,kindItem) + kindItem.cbCardList[2] = k + 1 + kindItem.cbCardList[3] = k + 2 + table.insert(tagKindList, kindItem) end - - if cardNum(k+1,self.cardList)>=i and cardNum(math.floor(k/100)*100+4,self.cardList)>=i and (k+1)%100~=4 then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Chi + + if cardNum(k + 1, self.cardList) >= i and cardNum(math.floor(k / 100) * 100 + 4, self.cardList) >= i and (k + 1) % 100 ~= 4 then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Chi kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k - kindItem.cbCardList[2] = k+1 - kindItem.cbCardList[3] = math.floor(k/100)*100+4 - table.insert(tagKindList,kindItem) + kindItem.cbCardList[2] = k + 1 + kindItem.cbCardList[3] = math.floor(k / 100) * 100 + 4 + table.insert(tagKindList, kindItem) end - - if cardNum(k+2,self.cardList)>=i and cardNum(math.floor(k/100)*100+4,self.cardList)>=i and (k+2)%100~=4 then - local kindItem={} - kindItem.type=RB_FZTypeFLS.Chi + + if cardNum(k + 2, self.cardList) >= i and cardNum(math.floor(k / 100) * 100 + 4, self.cardList) >= i and (k + 2) % 100 ~= 4 then + local kindItem = {} + kindItem.type = RB_FZTypeFLS.Chi kindItem.card = k - kindItem.cbCardList={} + kindItem.cbCardList = {} kindItem.cbCardList[1] = k - kindItem.cbCardList[2] = math.floor(k/100)*100+4 - kindItem.cbCardList[3] = k+2 - table.insert(tagKindList,kindItem) + kindItem.cbCardList[2] = math.floor(k / 100) * 100 + 4 + kindItem.cbCardList[3] = k + 2 + table.insert(tagKindList, kindItem) end - - - end - end - end - - end - - + + --//组合分析 - if #tagKindList>=cbLessKindItem then - local cbIndex={} - for i=1,5 do - table.insert(cbIndex,i-1) + if #tagKindList >= cbLessKindItem then + local cbIndex = {} + for i = 1, 5 do + table.insert(cbIndex, i - 1) end - + --TagKindItem[] pKindItem = new TagKindItem[6]; - local pKindItem={} - + local pKindItem = {} + repeat - --while true do - local cbCardMap_temp=membe_deep_clone(tempCardList) - for i=1,cbLessKindItem do - pKindItem[i]=tagKindList[i] + --while true do + local cbCardMap_temp = membe_deep_clone(tempCardList) + for i = 1, cbLessKindItem do + pKindItem[i] = tagKindList[i] end --//数量判断 local bEnoughCard = true - for i=1,cbLessKindItem * 3 do - local num1=math.floor((i-1)/3)+1 - local num2=i % 3 - if num==0 then - num2=3 + for i = 1, cbLessKindItem * 3 do + local num1 = math.floor((i - 1) / 3) + 1 + local num2 = i % 3 + if num == 0 then + num2 = 3 end - local cbCardIndex=pKindItem[num1].cbCardList[num2] - if GetCheckCardNum(cbCardIndex,cbCardMap_temp)<=0 then + local cbCardIndex = pKindItem[num1].cbCardList[num2] + if GetCheckCardNum(cbCardIndex, cbCardMap_temp) <= 0 then bEnoughCard = false break else if cbCardMap_temp[cbCardIndex] then - cbCardMap_temp[cbCardIndex]=cbCardMap_temp[cbCardIndex]-1 + cbCardMap_temp[cbCardIndex] = cbCardMap_temp[cbCardIndex] - 1 end - end - end - - - + + + --//胡牌判断 - - if bEnoughCard==true then + + if bEnoughCard == true then --//牌眼判断 -- ArrayList eyeList = new ArrayList(); -- ArrayList eyeCardList = new ArrayList(); - local eyeList={} - local eyeCardList={} - - for k,v in pairs(tempCardList) do - if v>0 then - for i=1,v do - table.insert(eyeCardList,k) + local eyeList = {} + local eyeCardList = {} + + for k, v in pairs(tempCardList) do + if v > 0 then + for i = 1, v do + table.insert(eyeCardList, k) end - end end - - if #eyeCardList~=4 then return false end - - if math.floor(eyeCardList[1]/100)==math.floor(eyeCardList[2]/100) and math.floor(eyeCardList[3]/100)==math.floor(eyeCardList[4]/100) then - local card1=eyeCardList[1] - local card2=eyeCardList[2] - local card3=eyeCardList[3] - local card4=eyeCardList[4] - local result=AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, tagAnalyseItemList, config) + + if #eyeCardList ~= 4 then return false end + + if math.floor(eyeCardList[1] / 100) == math.floor(eyeCardList[2] / 100) and math.floor(eyeCardList[3] / 100) == math.floor(eyeCardList[4] / 100) then + local card1 = eyeCardList[1] + local card2 = eyeCardList[2] + local card3 = eyeCardList[3] + local card4 = eyeCardList[4] + local result = AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, + tagAnalyseItemList, config) if result then return true end end - - - if math.floor(eyeCardList[1]/100)==math.floor(eyeCardList[3]/100) and math.floor(eyeCardList[2]/100)==math.floor(eyeCardList[4]/100) then - local card1=eyeCardList[1] - local card2=eyeCardList[3] - local card3=eyeCardList[2] - local card4=eyeCardList[4] - local result=AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, tagAnalyseItemList, config) + + + if math.floor(eyeCardList[1] / 100) == math.floor(eyeCardList[3] / 100) and math.floor(eyeCardList[2] / 100) == math.floor(eyeCardList[4] / 100) then + local card1 = eyeCardList[1] + local card2 = eyeCardList[3] + local card3 = eyeCardList[2] + local card4 = eyeCardList[4] + local result = AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, + tagAnalyseItemList, config) if result then return true end end - - if math.floor(eyeCardList[1]/100)==math.floor(eyeCardList[4]/100) and math.floor(eyeCardList[2]/100)==math.floor(eyeCardList[3]/100) then - local card1=eyeCardList[1] - local card2=eyeCardList[4] - local card3=eyeCardList[3] - local card4=eyeCardList[2] - local result=AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, tagAnalyseItemList, config) + + if math.floor(eyeCardList[1] / 100) == math.floor(eyeCardList[4] / 100) and math.floor(eyeCardList[2] / 100) == math.floor(eyeCardList[3] / 100) then + local card1 = eyeCardList[1] + local card2 = eyeCardList[4] + local card3 = eyeCardList[3] + local card4 = eyeCardList[2] + local result = AnalyseCardFuLuShouJiang(cbLessKindItem, nil, card1, card2, card3, card4, opCards, + tagAnalyseItemList, config) if result then return true end end - - if #tagAnalyseItemList>0 then + + if #tagAnalyseItemList > 0 then return true else return false end - - end - - - + + + --//设置索引 - if cbIndex[cbLessKindItem]==#tagKindList then - - local tempi=cbLessKindItem - for i=cbLessKindItem,2,-1 do - tempi=i-1 - if (cbIndex[i-1]+1)~=cbIndex[i] then + if cbIndex[cbLessKindItem] == #tagKindList then + local tempi = cbLessKindItem + for i = cbLessKindItem, 2, -1 do + tempi = i - 1 + if (cbIndex[i - 1] + 1) ~= cbIndex[i] then local cbNewIndex = cbIndex[i - 1] - for j=i-1,cbLessKindItem do - cbIndex[j]=cbNewIndex+j-i+2 + for j = i - 1, cbLessKindItem do + cbIndex[j] = cbNewIndex + j - i + 2 end break - end - - - end - - if tempi==1 then break end - - + + if tempi == 1 then break end else - cbIndex[cbLessKindItem]=cbIndex[cbLessKindItem]+1 + cbIndex[cbLessKindItem] = cbIndex[cbLessKindItem] + 1 end - - - - - until(false) + until (false) --end -- - - end - - if #tagAnalyseItemList>0 then break end - - --end - until(true) - - if #tagAnalyseItemList>0 then return true end - - return false + if #tagAnalyseItemList > 0 then break end + + --end + until (true) + + if #tagAnalyseItemList > 0 then return true end + + return false end -function M:AnalyseCardFuLuShou(cbLessKindItem,pKindItem,eyeCard,opCards,tagAnalyseItemList,config) +function M:AnalyseCardFuLuShou(cbLessKindItem, pKindItem, eyeCard, opCards, tagAnalyseItemList, config) printlog("AnalyseCardFuLuShou===>>>") - local AnalyseItem={} - AnalyseItem.huxi=0 + local AnalyseItem = {} + AnalyseItem.huxi = 0 AnalyseItem.cbCardEye = 0 - AnalyseItem.cbOpCard={} - AnalyseItem.cbCardEyeList={} + AnalyseItem.cbOpCard = {} + AnalyseItem.cbCardEyeList = {} --//设置结果 - for i=1,#opCards do - local src_card=opCards[i] - local op_card={} - op_card.type=src_card.type - op_card.card=src_card.card - - table.insert(AnalyseItem.cbOpCard,src_card) - if src_card.type==RB_FZTypeFLS.Chi then + for i = 1, #opCards do + local src_card = opCards[i] + local op_card = {} + op_card.type = src_card.type + op_card.card = src_card.card + + table.insert(AnalyseItem.cbOpCard, src_card) + if src_card.type == RB_FZTypeFLS.Chi then if IsShangDaRenFuLuShou(src_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end - elseif src_card.type==RB_FZTypeFLS.Peng then + elseif src_card.type == RB_FZTypeFLS.Peng then if IsShangFu(src_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+3*4 + AnalyseItem.huxi = AnalyseItem.huxi + 3 * 4 else - AnalyseItem.huxi=AnalyseItem.huxi+2 + AnalyseItem.huxi = AnalyseItem.huxi + 2 end else if IsShangFu(src_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+4*4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 * 4 else if config["gang_zhao_liu_xi"] then - AnalyseItem.huxi=AnalyseItem.huxi+6 + AnalyseItem.huxi = AnalyseItem.huxi + 6 else - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end end - end - end - + --//设置牌型 if pKindItem then - for i=1,cbLessKindItem do - local op_card={} - op_card.type=pKindItem[i].type - op_card.card=pKindItem[i].card - table.insert(AnalyseItem.cbOpCard,op_card) - if op_card.type==RB_FZTypeFLS.Chi then + for i = 1, cbLessKindItem do + local op_card = {} + op_card.type = pKindItem[i].type + op_card.card = pKindItem[i].card + table.insert(AnalyseItem.cbOpCard, op_card) + if op_card.type == RB_FZTypeFLS.Chi then if IsShangDaRenFuLuShou(op_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end - elseif op_card.type==RB_FZTypeFLS.Peng then + elseif op_card.type == RB_FZTypeFLS.Peng then if IsShangFu(op_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+3*4 + AnalyseItem.huxi = AnalyseItem.huxi + 3 * 4 else - AnalyseItem.huxi=AnalyseItem.huxi+3 + AnalyseItem.huxi = AnalyseItem.huxi + 3 end else if IsShangFu(op_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+4*4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 * 4 else if config["gang_zhao_liu_xi"] then - AnalyseItem.huxi=AnalyseItem.huxi+6 + AnalyseItem.huxi = AnalyseItem.huxi + 6 else - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end end - end - end end - - if eyeCard>0 then + + if eyeCard > 0 then AnalyseItem.cbCardEye = eyeCard if IsShangFu(eyeCard) then - AnalyseItem.huxi=AnalyseItem.huxi+8 + AnalyseItem.huxi = AnalyseItem.huxi + 8 elseif IsDaRenLuShou(eyeCard) then - AnalyseItem.huxi=AnalyseItem.huxi+4 - elseif eyeCard==104 or eyeCard==804 then - AnalyseItem.huxi=AnalyseItem.huxi+8 + AnalyseItem.huxi = AnalyseItem.huxi + 4 + elseif eyeCard == 104 or eyeCard == 804 then + AnalyseItem.huxi = AnalyseItem.huxi + 8 end end - - + + --//插入结果 - table.insert(tagAnalyseItemList,AnalyseItem) - + table.insert(tagAnalyseItemList, AnalyseItem) + pt(tagAnalyseItemList) - printlog("胡息---》》》",AnalyseItem.huxi) + printlog("胡息---》》》", AnalyseItem.huxi) if AnalyseItem.huxi >= 11 then return true end return false - - end -function M:AnalyseCardFuLuShouJiang(cbLessKindItem,pKindItem,card1,card2,card3,card4,opCards,tagAnalyseItemList,config) +function M:AnalyseCardFuLuShouJiang(cbLessKindItem, pKindItem, card1, card2, card3, card4, opCards, tagAnalyseItemList, + config) printlog("AnalyseCardFuLuShouJiang===>>>") - local AnalyseItem={} - AnalyseItem.huxi=0 + local AnalyseItem = {} + AnalyseItem.huxi = 0 AnalyseItem.cbCardEye = 0 - AnalyseItem.cbOpCard={} - AnalyseItem.cbCardEyeList={} - + AnalyseItem.cbOpCard = {} + AnalyseItem.cbCardEyeList = {} + --//设置结果 - local diJin = false + local diJin = false local shangDaRenFuLuShou = false local ban_shangDaRenFuLuShou = false local hasKan = false - - for i=1,#opCards do - local src_card=opCards[i] - local op_card={} - op_card.type=src_card.type - op_card.card=src_card.card - - table.insert(AnalyseItem.cbOpCard,src_card) - if src_card.type==RB_FZTypeFLS.Chi then + + for i = 1, #opCards do + local src_card = opCards[i] + local op_card = {} + op_card.type = src_card.type + op_card.card = src_card.card + + table.insert(AnalyseItem.cbOpCard, src_card) + if src_card.type == RB_FZTypeFLS.Chi then if IsShangDaRenFuLuShou(src_card.card) then shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end - elseif src_card.type==RB_FZTypeFLS.Peng then + elseif src_card.type == RB_FZTypeFLS.Peng then if IsShangFu(src_card.card) then hasKan = true - AnalyseItem.huxi=AnalyseItem.huxi+3*4 + AnalyseItem.huxi = AnalyseItem.huxi + 3 * 4 else - AnalyseItem.huxi=AnalyseItem.huxi+2 + AnalyseItem.huxi = AnalyseItem.huxi + 2 end else hasKan = true if IsShangFu(src_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+4*4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 * 4 else if config["gang_zhao_liu_xi"] then - AnalyseItem.huxi=AnalyseItem.huxi+6 + AnalyseItem.huxi = AnalyseItem.huxi + 6 else - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end end - end - end - + --//设置牌型 if pKindItem then - for i=1,cbLessKindItem do - local op_card={} - op_card.type=pKindItem[i].type - op_card.card=pKindItem[i].card - table.insert(AnalyseItem.cbOpCard,op_card) - if op_card.type==RB_FZTypeFLS.Chi then + for i = 1, cbLessKindItem do + local op_card = {} + op_card.type = pKindItem[i].type + op_card.card = pKindItem[i].card + table.insert(AnalyseItem.cbOpCard, op_card) + if op_card.type == RB_FZTypeFLS.Chi then if IsShangDaRenFuLuShou(op_card.card) then shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end - elseif op_card.type==RB_FZTypeFLS.Peng then + elseif op_card.type == RB_FZTypeFLS.Peng then hasKan = true if IsShangFu(op_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+3*4 + AnalyseItem.huxi = AnalyseItem.huxi + 3 * 4 else - AnalyseItem.huxi=AnalyseItem.huxi+3 + AnalyseItem.huxi = AnalyseItem.huxi + 3 end else hasKan = true if IsShangFu(op_card.card) then - AnalyseItem.huxi=AnalyseItem.huxi+4*4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 * 4 else if config["gang_zhao_liu_xi"] then - AnalyseItem.huxi=AnalyseItem.huxi+6 + AnalyseItem.huxi = AnalyseItem.huxi + 6 else - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end end - end - end end - - local eyeCard1={} - table.insert(eyeCard1,card1) - table.insert(eyeCard1,card2) - table.insert(AnalyseItem.cbCardEyeList,eyeCard1) - - local eyeCard1={} - table.insert(eyeCard1,card3) - table.insert(eyeCard1,card4) - table.insert(AnalyseItem.cbCardEyeList,eyeCard2) - + local eyeCard1 = {} + table.insert(eyeCard1, card1) + table.insert(eyeCard1, card2) + table.insert(AnalyseItem.cbCardEyeList, eyeCard1) + + + local eyeCard1 = {} + table.insert(eyeCard1, card3) + table.insert(eyeCard1, card4) + table.insert(AnalyseItem.cbCardEyeList, eyeCard2) + --//一对上、福,就可以胡了 - if card1 == card2 and IsShangFu(card1) then - AnalyseItem.huxi=AnalyseItem.huxi+12 - elseif card1 == card2 and (card1 == 104 or card1 == 804) then - AnalyseItem.huxi=AnalyseItem.huxi+12 - elseif (card1 == 101 and card2 == 104 or card2 == 101 and card1 == 104) then - AnalyseItem.huxi=AnalyseItem.huxi+12 - elseif (card1 == 801 and card2 == 804 or card2 == 801 and card1 == 804) then - AnalyseItem.huxi=AnalyseItem.huxi+12 - elseif ((card1 == 101 or card2 == 101 ) and card1 ~= card2) then + if card1 == card2 and IsShangFu(card1) then + AnalyseItem.huxi = AnalyseItem.huxi + 12 + elseif card1 == card2 and (card1 == 104 or card1 == 804) then + AnalyseItem.huxi = AnalyseItem.huxi + 12 + elseif (card1 == 101 and card2 == 104 or card2 == 101 and card1 == 104) then + AnalyseItem.huxi = AnalyseItem.huxi + 12 + elseif (card1 == 801 and card2 == 804 or card2 == 801 and card1 == 804) then + AnalyseItem.huxi = AnalyseItem.huxi + 12 + elseif ((card1 == 101 or card2 == 101) and card1 ~= card2) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 - elseif ((card1 == 104 or card2 == 104 ) and card1 ~= card2) then + AnalyseItem.huxi = AnalyseItem.huxi + 4 + elseif ((card1 == 104 or card2 == 104) and card1 ~= card2) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 - elseif ((card1 == 801 or card2 == 801 ) and card1 ~= card2) then + AnalyseItem.huxi = AnalyseItem.huxi + 4 + elseif ((card1 == 801 or card2 == 801) and card1 ~= card2) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 - elseif ((card1 == 804 or card2 == 804 ) and card1 ~= card2) then + AnalyseItem.huxi = AnalyseItem.huxi + 4 + elseif ((card1 == 804 or card2 == 804) and card1 ~= card2) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end - - + + if (card3 == card4 and IsShangFu(card3)) then - AnalyseItem.huxi=AnalyseItem.huxi+12 + AnalyseItem.huxi = AnalyseItem.huxi + 12 elseif (card3 == card4 and (card3 == 104 or card3 == 804)) then - AnalyseItem.huxi=AnalyseItem.huxi+12 + AnalyseItem.huxi = AnalyseItem.huxi + 12 elseif (card3 == 101 and card4 == 104 or card4 == 101 and card3 == 104) then - AnalyseItem.huxi=AnalyseItem.huxi+12 + AnalyseItem.huxi = AnalyseItem.huxi + 12 elseif (card3 == 801 and card4 == 804 or card4 == 801 and card3 == 804) then - AnalyseItem.huxi=AnalyseItem.huxi+12 + AnalyseItem.huxi = AnalyseItem.huxi + 12 elseif ((card3 == 101 or card4 == 101) and card3 ~= card4) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 elseif ((card3 == 104 or card4 == 104) and card3 ~= card4) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 elseif ((card3 == 801 or card4 == 801) and card3 ~= card4) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 - elseif ((card3 == 804 or card4 == 804) and card3 ~= card4) then + AnalyseItem.huxi = AnalyseItem.huxi + 4 + elseif ((card3 == 804 or card4 == 804) and card3 ~= card4) then ban_shangDaRenFuLuShou = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end - - + + if shangDaRenFuLuShou or ban_shangDaRenFuLuShou or hasKan then if (card1 ~= card2 and IsDaRen(card1) and IsDaRen(card2) or card3 ~= card4 and IsDaRen(card3) and IsDaRen(card4)) then if not diJin then diJin = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end - end - + if (card1 ~= card2 and IsLuShou(card1) and IsLuShou(card2) or card3 ~= card4 and IsLuShou(card3) and IsLuShou(card4)) then if not diJin then diJin = true - AnalyseItem.huxi=AnalyseItem.huxi+4 + AnalyseItem.huxi = AnalyseItem.huxi + 4 end end - + if ((card1 == card2 and not IsShangFu(card1) and card1 ~= 104 and card1 ~= 804) or - (card3 == card4 and not IsShangFu(card3) and card3 ~= 104 and card3 ~= 804)) then + (card3 == card4 and not IsShangFu(card3) and card3 ~= 104 and card3 ~= 804)) then if not diJin then diJin = true - AnalyseItem.huxi=AnalyseItem.huxi+3 + AnalyseItem.huxi = AnalyseItem.huxi + 3 end - - - elseif ((card1 ~= card2 and (( math.floor(card1 / 100) ~= 1 and math.floor(card1 / 100) ~= 8 and card1 % 100 == 4) or ( math.floor(card2 / 100) ~= 1 and math.floor(card2 / 100) ~= 8 and card2 % 100 == 4)) and not IsShangFu(card1)) or - (card3 ~= card4 and (( math.floor(card3 / 100) ~= 1 and math.floor(card3 / 100) ~= 8 and card3 % 100 == 4) or ( math.floor(card4 / 100) ~= 1 and math.floor(card4 / 100) ~= 8 and card4 % 100 == 4)) and not IsShangFu(card3))) then - + elseif ((card1 ~= card2 and ((math.floor(card1 / 100) ~= 1 and math.floor(card1 / 100) ~= 8 and card1 % 100 == 4) or (math.floor(card2 / 100) ~= 1 and math.floor(card2 / 100) ~= 8 and card2 % 100 == 4)) and not IsShangFu(card1)) or + (card3 ~= card4 and ((math.floor(card3 / 100) ~= 1 and math.floor(card3 / 100) ~= 8 and card3 % 100 == 4) or (math.floor(card4 / 100) ~= 1 and math.floor(card4 / 100) ~= 8 and card4 % 100 == 4)) and not IsShangFu(card3))) then if not diJin then diJin = true - AnalyseItem.huxi=AnalyseItem.huxi+3 + AnalyseItem.huxi = AnalyseItem.huxi + 3 end - end - end - - + + --//插入结果 - table.insert(tagAnalyseItemList,AnalyseItem) - + table.insert(tagAnalyseItemList, AnalyseItem) + pt(tagAnalyseItemList) - printlog("胡息---》》》",AnalyseItem.huxi) + printlog("胡息---》》》", AnalyseItem.huxi) if AnalyseItem.huxi >= 11 then - return true end return false - - end - function M:IsShangFu(card) - if card==101 or card==801 then + if card == 101 or card == 801 then return true end return false end function M:IsDaRen(card) - if card==102 or card==103 then + if card == 102 or card == 103 then return true end return false end - function M:IsLuShou(card) - if card==802 or card==803 then + if card == 802 or card == 803 then return true end return false end function M:IsDaRenLuShou(card) - if card==102 or card==103 or card==802 or card==803 then + if card == 102 or card == 103 or card == 802 or card == 803 then return true end return false end function M:IsShangDaRen(card) - if math.floor(card/100)==1 then + if math.floor(card / 100) == 1 then return true end return false end function M:IsFuLuShou(card) - if math.floor(card/100)==8 then + if math.floor(card / 100) == 8 then return true end return false end - function M:IsShangDaRenFuLuShou(card) - if math.floor(card/100)==1 or math.floor(card/100)==8 then + if math.floor(card / 100) == 1 or math.floor(card / 100) == 8 then return true end return false end +local function init(self, player, cardInhand, addCard, room) + self.stack = {} + self.stackHuxi = {} + self.cardList = membe_deep_clone(cardInhand) + if addCard then + self.cardList[#self.cardList + 1] = addCard + end + table.sort(self.cardList) - + self.cbCardMap = {} - - -local function init(self, player, cardInhand, addCard,room) - self.stack = {} - self.stackHuxi = {} - self.cardList = membe_deep_clone(cardInhand) - if addCard then - self.cardList[#self.cardList + 1] = addCard - end - table.sort(self.cardList) - - self.cbCardMap={} - - for i=1,#self.cardList do - if self.cbCardMap[self.cardList[i]]==nil then - self.cbCardMap[self.cardList[i]]=1 + for i = 1, #self.cardList do + if self.cbCardMap[self.cardList[i]] == nil then + self.cbCardMap[self.cardList[i]] = 1 end - local num=cardNum(self.cardList[i],self.cardList) - if num>1 then - self.cbCardMap[self.cardList[i]]=num + local num = cardNum(self.cardList[i], self.cardList) + if num > 1 then + self.cbCardMap[self.cardList[i]] = num end end - + --printlog("cbCardMap") --pt(self.cbCardMap) - - return self:tryWin(player,room) + + return self:tryWin(player, room) end function M.tingPai(player, room) - local self = setmetatable({}, {__index = M}) - local tingList = {} - local cardInhand = player.handcard_list - if not cardInhand or #cardInhand == 0 then - return tingList - end - - for k = 100, 800, 100 do - for i = 1, 4 do - local tem = k + i - printlog("听牌查询=======>>>",tem) - local result = init(self, player, cardInhand, tem,room) - if result then - printlog("胡牌值为==>>>",tem) - table.insert(tingList,tem) - end - - end - + local self = setmetatable({}, { __index = M }) + local tingList = {} + local cardInhand = player.handcard_list + if not cardInhand or #cardInhand == 0 then + return tingList end - - - return tingList + + for k = 100, 800, 100 do + for i = 1, 4 do + local tem = k + i + printlog("听牌查询=======>>>", tem) + local result = init(self, player, cardInhand, tem, room) + if result then + printlog("胡牌值为==>>>", tem) + table.insert(tingList, tem) + end + end + end + + + return tingList end - - function M:getHuxi(room) if room.game_id == 77 then return 11 @@ -1077,35 +993,35 @@ function M:getHuxi(room) if room.game_id == 301 then return 8 end - if room.game_id == 13 or room.game_id == 14 or room.game_id == 23 then - return 15 - elseif room.game_id == 26 then - return 10 - elseif room.game_id == 29 then - if room.room_config.maxPlayers == 3 then - return 15 - else - return 9 - end - end + if room.game_id == 13 or room.game_id == 14 or room.game_id == 23 then + return 15 + elseif room.game_id == 26 then + return 10 + elseif room.game_id == 29 then + if room.room_config.maxPlayers == 3 then + return 15 + else + return 9 + end + end end function M:GetFzData(tem, ctype) - local huxi - if ctype == 2 then - if tem > 200 then - huxi = 6 - else - huxi = 5 - end - elseif ctype == 3 then - huxi = 3 - elseif ctype == 4 then - huxi = 3 - elseif ctype == 5 then - huxi = 3 - end - return huxi + local huxi + if ctype == 2 then + if tem > 200 then + huxi = 6 + else + huxi = 5 + end + elseif ctype == 3 then + huxi = 3 + elseif ctype == 4 then + huxi = 3 + elseif ctype == 5 then + huxi = 3 + end + return huxi end return M diff --git a/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/ExtendConfig.lua b/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/ExtendConfig.lua index 38176923..76ed07fc 100644 --- a/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/ExtendConfig.lua +++ b/lua_probject/extend_project/extend/zipai/yueyangwaihuzi_bak/ExtendConfig.lua @@ -11,8 +11,8 @@ local ExtendConfig = {} local M = ExtendConfig function ExtendConfig.new() - setmetatable(M, {__index = IExtendConfig}) - local self = setmetatable({}, {__index = M}) + setmetatable(M, { __index = IExtendConfig }) + local self = setmetatable({}, { __index = M }) self.class = 'ExtendConfig' self.extend_id = 13 self._viewMap = {} @@ -54,8 +54,8 @@ function M:FillRoomConfig(room, _config) end function M:FillRoomData(s2croom) - printlog("初始化数据===>>>") - pt(s2croom) + printlog("初始化数据===>>>") + pt(s2croom) local room = DataManager.CurrenRoom local reload = s2croom['reload'] local _tableInfo = s2croom['tableInfo'] @@ -73,7 +73,7 @@ function M:FillRoomData(s2croom) local online = _jp['online'] p.line_state = online p.ready = _jp['ready'] == 1 and true or false - --p.piao=_jp['piao'] + --p.piao=_jp['piao'] local pid = _jp['aid'] if (DataManager.SelfUser.account_id == pid) then room.self_player = p @@ -103,11 +103,12 @@ function M:FillRoomData(s2croom) if (reload) then local _reloadInfo = s2croom['reloadInfo'] - room.self_player.currentNotPutCardList=_reloadInfo['notput'] + room.self_player.currentNotPutCardList = _reloadInfo['notput'] local _hand_card = _reloadInfo['hand_card'] local _card_list = _reloadInfo['card_list'] local _discard = _reloadInfo['discard'] room.discard = _discard + room.reload = reload -- local _index = _reloadInfo["typeface"] -- if _index ==1 then -- room.change_card_display = "2_" @@ -154,7 +155,7 @@ function M:FillRoomData(s2croom) p.total_hp = tem.hp_info.total_hp end p.entrust = tem['entrust'] - p.piao=tem['piao'] + p.piao = tem['piao'] local opcard = tem['opcard'] for k = 1, #opcard do local op = opcard[k] @@ -176,7 +177,7 @@ function M:FillRoomData(s2croom) end end end - pt(p) + pt(p) if not playing and room.curren_round > 0 then self.GetGameController():PlayerReady() end diff --git a/lua_probject/main_project/main/majiang/FZData.lua b/lua_probject/main_project/main/majiang/FZData.lua index 272040db..89447f6b 100644 --- a/lua_probject/main_project/main/majiang/FZData.lua +++ b/lua_probject/main_project/main/majiang/FZData.lua @@ -55,6 +55,7 @@ function M.new() setmetatable(self, { __index = FZTipList }) self.tip_map_id = {} self.tip_map_type = {} + self.tip_sortList = {} self.tip_num = 0 self.is_hu = false return self @@ -71,7 +72,12 @@ function M:AddTip(tip) self.tip_map_type[tip.weight] = tiplist end tiplist[#tiplist + 1] = tip + table.insert(self.tip_sortList, tip) self.tip_num = self.tip_num + 1 end +function M:SortList(fct) + table.sort(self.tip_sortList, fct) +end + return M diff --git a/lua_probject/main_project/main/majiang/GameInfoWindow.lua b/lua_probject/main_project/main/majiang/GameInfoWindow.lua index e32dcf53..48f01ff1 100644 --- a/lua_probject/main_project/main/majiang/GameInfoWindow.lua +++ b/lua_probject/main_project/main/majiang/GameInfoWindow.lua @@ -8,14 +8,13 @@ function GameInfoWindow.New() end function GameInfoWindow:Reflash() - local config = self.room.room_config.config - local times = self.room.room_config.config.hpData.times + local times = self.room.room_config.config.times local game_id = self.room.game_id local Info = ExtendManager.GetExtendConfig(game_id):GetGameInfo() local text = Info:LoadConfigToDetail(config) - self.tex_tex.text = times / 1000 .. "倍," .. text + self.tex_tex.text = times / 1000 .. "倍," .. text end function GameInfoWindow:Show(room) diff --git a/lua_probject/main_project/main/majiang/MJCheckG.lua b/lua_probject/main_project/main/majiang/MJCheckG.lua index 39d87ee6..27fe3a3e 100644 --- a/lua_probject/main_project/main/majiang/MJCheckG.lua +++ b/lua_probject/main_project/main/majiang/MJCheckG.lua @@ -29,10 +29,9 @@ function M:init(url) self.coroutine = coroutine.start(function(...) self.valueTemp = 0 while self.valueTemp < 100 do - -- 让他在72的时候卡顿一下 if self.valueTemp > 72 and self.valueTemp < 80 then - + end self.valueTemp = self.valueTemp + math.random(4) @@ -41,7 +40,7 @@ function M:init(url) end showText.text = "检测完毕,环境安全" coroutine.wait(2) - self:Destroy() + -- self:Destroy() end) end diff --git a/lua_probject/main_project/main/majiang/MJClearingView.lua b/lua_probject/main_project/main/majiang/MJClearingView.lua index d3ca8879..12d6bbb6 100644 --- a/lua_probject/main_project/main/majiang/MJClearingView.lua +++ b/lua_probject/main_project/main/majiang/MJClearingView.lua @@ -130,7 +130,7 @@ end function M:fillResult0(room, peopleNum, result) local config = ExtendManager.GetExtendConfig(room.game_id) local mode = config:GetGameInfo() - local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config)) + local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config), json.encode(room.room_config.hpData)) self._view:GetChild("Label_GamePlay").title = string.format("第%s/%s局,%s", room.curren_round, room.room_config.round, gamePlay) self.list_lastCard.numItems = #result.cardList diff --git a/lua_probject/main_project/main/majiang/MJMainView.lua b/lua_probject/main_project/main/majiang/MJMainView.lua index 742a084e..473c935f 100644 --- a/lua_probject/main_project/main/majiang/MJMainView.lua +++ b/lua_probject/main_project/main/majiang/MJMainView.lua @@ -786,7 +786,7 @@ function M:OnHuCard(...) end) coroutine.start(function() - coroutine.wait(1) + coroutine.wait(0.7) loader_HuEffect.visible = false local Effects = {} @@ -847,7 +847,7 @@ end function M:Show() MainView.Show(self) - if self._room and self._room.curren_round == 0 then + if self._room and self._room.curren_round == 0 and self._flag_showTip then local win = GameInfoWindow.New() win:Show(self._room) end diff --git a/wb_new_ui/assets/Main_Majiang/Main_new/Chat/Component/Comp_VoiceBegin.xml b/wb_new_ui/assets/Main_Majiang/Main_new/Chat/Component/Comp_VoiceBegin.xml new file mode 100644 index 00000000..9b010e31 --- /dev/null +++ b/wb_new_ui/assets/Main_Majiang/Main_new/Chat/Component/Comp_VoiceBegin.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + +