diff --git a/lua_probject/extend_project/extend/majiang/hechi/CS_Win_Type.lua b/lua_probject/extend_project/extend/majiang/hechi/CS_Win_Type.lua index 4518f13f..a25531c6 100644 --- a/lua_probject/extend_project/extend/majiang/hechi/CS_Win_Type.lua +++ b/lua_probject/extend_project/extend/majiang/hechi/CS_Win_Type.lua @@ -24,11 +24,11 @@ local CS_Win_Type = { "七大对", "七大对清一色", "七大对混一色", - "双杠花", - "双杠上炮", - "三杠花", - "三杠上炮", - "四杠花", + "清一色全求人", + "混一色全求人", + "碰碰胡清一色全求人", + "碰碰胡混一色全求人", + "碰碰胡全求人", "四杠上炮", "塘子七星", "塘子一般高", diff --git a/lua_probject/extend_project/extend/majiang/hechi/CardCheck.lua b/lua_probject/extend_project/extend/majiang/hechi/CardCheck.lua index d1e0cece..b55d509b 100644 --- a/lua_probject/extend_project/extend/majiang/hechi/CardCheck.lua +++ b/lua_probject/extend_project/extend/majiang/hechi/CardCheck.lua @@ -435,7 +435,7 @@ function M:isQdPari(cardList) return false end -local function init(self,cardInhand,addCard,isZhong,qidui,eightLaizi) +local function init(self,cardInhand,addCard,isZhong,qidui,eightLaizi,isDeadLockResolved) self.stack = {} self.pair_count = 0 self.cardList = membe_clone(cardInhand) @@ -452,12 +452,15 @@ local function init(self,cardInhand,addCard,isZhong,qidui,eightLaizi) table.sort(self.cardList) --printlog("添加排序====>>>") --pt(self.cardList) + if isDeadLockResolved then + return false + end return self:checkLanPai() or self:checkQidui() or self:tryWin() end local specialCardList={401,402,403,404,502,503,501} -function M.tingPai(cardInhand,isZhong,qidui,eightLaizi) +function M.tingPai(cardInhand,isZhong,qidui,eightLaizi,isDeadLockResolved) local self = setmetatable({}, {__index = M}) local tingList = {} if not cardInhand or #cardInhand == 0 then @@ -466,7 +469,7 @@ function M.tingPai(cardInhand,isZhong,qidui,eightLaizi) for k=100,300,100 do for i=1,9 do local tem = k + i - local result = init(self,cardInhand,tem,isZhong,qidui,eightLaizi) + local result = init(self,cardInhand,tem,isZhong,qidui,eightLaizi,isDeadLockResolved) --printlog("返回结果为===>>>",result) if(result) then tingList[#tingList + 1] = tem @@ -477,7 +480,7 @@ function M.tingPai(cardInhand,isZhong,qidui,eightLaizi) for j=1,#specialCardList do local tem = specialCardList[j] - local result = init(self,cardInhand,tem,isZhong,qidui,eightLaizi) + local result = init(self,cardInhand,tem,isZhong,qidui,eightLaizi,isDeadLockResolved) if(result) then tingList[#tingList + 1] = tem end @@ -486,14 +489,14 @@ function M.tingPai(cardInhand,isZhong,qidui,eightLaizi) return tingList end -function M.MuiltiplteCaculateTingPai(cardInhand,isZhong,qidui,eightLaizi) +function M.MuiltiplteCaculateTingPai(cardInhand,isZhong,qidui,eightLaizi, wuyonCanShu, isDeadLockResolved) if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo>0 then zhongid=DataManager.CurrenRoom.laiziInfo[1] local tempTingList2={} - local tempTingList1=M.tingPai(cardInhand,isZhong,qidui,eightLaizi) + local tempTingList1=M.tingPai(cardInhand,isZhong,qidui,eightLaizi,isDeadLockResolved) if DataManager.CurrenRoom.laiziInfo[2] then zhongid=DataManager.CurrenRoom.laiziInfo[2] - tempTingList2=M.tingPai(cardInhand,isZhong,qidui,eightLaizi) + tempTingList2=M.tingPai(cardInhand,isZhong,qidui,eightLaizi,isDeadLockResolved) zhongid=DataManager.CurrenRoom.laiziInfo[1] end local currentTingList={} @@ -509,7 +512,7 @@ function M.MuiltiplteCaculateTingPai(cardInhand,isZhong,qidui,eightLaizi) else zhongid=501 - return M.tingPai(cardInhand,isZhong,qidui,eightLaizi) + return M.tingPai(cardInhand,isZhong,qidui,eightLaizi,isDeadLockResolved) end end diff --git a/lua_probject/extend_project/extend/majiang/hechi/EXGameInfo.lua b/lua_probject/extend_project/extend/majiang/hechi/EXGameInfo.lua index 43b46345..5ee630d5 100644 --- a/lua_probject/extend_project/extend/majiang/hechi/EXGameInfo.lua +++ b/lua_probject/extend_project/extend/majiang/hechi/EXGameInfo.lua @@ -116,7 +116,7 @@ function M:SelectedConfigData() end - local fengdingTable = { 0, 40, 80, 160 } + local fengdingTable = { [0] = 0, [1] =100,[2] =200} ------ local _data = {} @@ -146,13 +146,13 @@ function M:SelectedConfigData() end function M:LoadConfigData(data) - printlog("加载房间配置=========>>>") - pt(data) + -- printlog("加载房间配置=========>>>") + -- pt(data) local _config = self._config _config:GetController("round").selectedIndex = data.opt - 1 _config:GetController("play_list").selectedIndex = data.maxPlayers - 2 - local fengdingTable = { 0, 40, 80, 160 } + local fengdingTable = { [0] = 0, [1] =100,[2] =200} for i, v in ipairs(fengdingTable) do if v == data.fengding then diff --git a/lua_probject/extend_project/extend/majiang/hechi/EXMainView.lua b/lua_probject/extend_project/extend/majiang/hechi/EXMainView.lua index 04703325..1946b2d0 100644 --- a/lua_probject/extend_project/extend/majiang/hechi/EXMainView.lua +++ b/lua_probject/extend_project/extend/majiang/hechi/EXMainView.lua @@ -16,6 +16,8 @@ function M.new() self.asset_group = "HeChi_MJ" -- 初始化锁定吃牌具体变量 self._lockedCardForChi = nil + -- 初始化是否进入死锁解除状态标记 + self.isDeadLockResolved = false self:init() @@ -192,6 +194,8 @@ function M:EventInit() _gamectr:AddEventListener(TX_GameEvent.SendCards,function( ... ) + -- 每局发牌时,重置死锁标记,确保新一局干净 + self.isDeadLockResolved = false -- self:ShowHuTip() self:UpdateRound() self:reqResidueCard() @@ -659,7 +663,6 @@ function M:OnFangziAction(...) local player = arg[2] local index = arg[3] printlog("OnFangziAction") - -- 计算锁定状态,保存到 self._lockedCardForChi if player.seat == self._room.self_player.seat and fz.type == FZType.Chi then self:CalculateChiLockCard(fz) @@ -734,15 +737,42 @@ function M:CalculateChiLockCard(fz) targetCard = nil end - -- 验证目标牌是否真的在手牌中 (可选,为了严谨) + -- 验证手牌是否只剩下锁定牌,如果是,则解除锁定防止死锁 if targetCard then - local hasCard = false - for _, c in ipairs(self._room.self_player.card_list) do - if c == targetCard then - hasCard = true - break + local selfPlayer = self._room.self_player + if selfPlayer and selfPlayer.card_list then + local hasOtherCard = false + for _, c in ipairs(selfPlayer.card_list) do + if c ~= targetCard then + hasOtherCard = true + break + end + end + + -- 如果手牌里没有其他牌了(全是 targetCard),则不锁定 + if not hasOtherCard then + printlog("警告:手牌仅剩被锁定牌,解除锁定以避免死锁") + self._lockedCardForChi = nil + -- 标记发生了死锁解除 + self.isDeadLockResolved = true + return end end + end + + -- 验证目标牌是否真的在手牌中 (原有逻辑) + if targetCard then + local hasCard = false + local selfPlayer = self._room.self_player + if selfPlayer and selfPlayer.card_list then + for _, c in ipairs(selfPlayer.card_list) do + if c == targetCard then + hasCard = true + break + end + end + end + if hasCard then self._lockedCardForChi = targetCard else @@ -815,6 +845,8 @@ function M:__PiaoNiaoTip() end function M:ReloadRoom(bskip) + -- 【新增】每局开始/重加载时,重置死锁标记 + self.isDeadLockResolved = false local room = self._room -- if not room.playing then -- self._state.selectedIndex = 2 diff --git a/lua_probject/extend_project/extend/majiang/hechi/MJPlayerSelfCardInfoView.lua b/lua_probject/extend_project/extend/majiang/hechi/MJPlayerSelfCardInfoView.lua index c6191541..8ff94b7e 100644 --- a/lua_probject/extend_project/extend/majiang/hechi/MJPlayerSelfCardInfoView.lua +++ b/lua_probject/extend_project/extend/majiang/hechi/MJPlayerSelfCardInfoView.lua @@ -17,7 +17,16 @@ end function M:ShowHuTip(card_list) printlog("ShowHuTip") - local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) + -- 1. 获取死锁状态 + local isDeadLock = self._mainView.isDeadLockResolved + local tingList = CardCheck.MuiltiplteCaculateTingPai( + card_list, + true, + true, + DataManager.CurrenRoom.room_config.Qidui, + DataManager.CurrenRoom.room_config.Laizi, + isDeadLock + ) if #tingList > 0 then if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo>0 then for i=1,#DataManager.CurrenRoom.laiziInfo do @@ -87,6 +96,8 @@ function M:UpdateHandCard(getcard, mp) -- 记录需要标记听牌提示的牌 local lst_mark = {} local total_num = 0 + -- 在这里获取死锁状态,以便在下面循环中使用 + local isDeadLock = self._mainView.isDeadLockResolved for i = 1, #_carViewList do local btn = _carViewList[i].card local card = self:GetCard(btn) @@ -100,7 +111,9 @@ function M:UpdateHandCard(getcard, mp) end list_remove(card_list, card) - local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi) + local tingList = CardCheck.MuiltiplteCaculateTingPai( + card_list, true, true, DataManager.CurrenRoom.room_config.Qidui, + DataManager.CurrenRoom.room_config.Laizi,isDeadLock) if #tingList > 0 then local count = 0 for j = 1, #tingList do diff --git a/wb_new_ui/.objs/metas/h30s8vme/la4eb.info b/wb_new_ui/.objs/metas/h30s8vme/la4eb.info index f118f951..e4eb3d2e 100644 --- a/wb_new_ui/.objs/metas/h30s8vme/la4eb.info +++ b/wb_new_ui/.objs/metas/h30s8vme/la4eb.info @@ -1,5 +1,8 @@ { "objectStatus": { + "n121_xevg": { + "hidden": true + }, "n154_la4e": { "collapsed": true } diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index 28740ff5..8d6511b5 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -43,6 +43,20 @@ "/images/", "27vd145b", "/images/COMMui/", + "hrxsdiix", + "/", + "hrxsdiix", + "/component/", + "hrxsdiix", + "/component/hu_effect/", + "hrxsdiix", + "/component/hu_effect/image/", + "h30s8vme", + "/", + "h30s8vme", + "/component/", + "h30s8vme", + "/component/create_room/", "v0j9abjy", "/", "v0j9abjy", diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he26.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he26.png index 6e5f6ffe..3879ce20 100644 Binary files a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he26.png and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he26.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he26_1.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he26_1.png new file mode 100644 index 00000000..6e5f6ffe Binary files /dev/null and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he26_1.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he27.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he27.png index 3ef8d627..75f4b3bf 100644 Binary files a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he27.png and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he27.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he27_1.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he27_1.png new file mode 100644 index 00000000..3ef8d627 Binary files /dev/null and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he27_1.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he28.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he28.png index 04b6608c..e25eb86f 100644 Binary files a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he28.png and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he28.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he28_1.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he28_1.png new file mode 100644 index 00000000..04b6608c Binary files /dev/null and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he28_1.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he29.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he29.png index 01d8475a..cbb85839 100644 Binary files a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he29.png and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he29.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he29_1.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he29_1.png new file mode 100644 index 00000000..01d8475a Binary files /dev/null and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he29_1.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he30.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he30.png index 793bf141..07412f3c 100644 Binary files a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he30.png and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he30.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he30_1.png b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he30_1.png new file mode 100644 index 00000000..793bf141 Binary files /dev/null and b/wb_new_ui/assets/Extend_MJ_HeChi/component/hu_effect/image/he30_1.png differ diff --git a/wb_new_ui/assets/Extend_MJ_HeChi/package.xml b/wb_new_ui/assets/Extend_MJ_HeChi/package.xml index 52e5487d..e7579000 100644 --- a/wb_new_ui/assets/Extend_MJ_HeChi/package.xml +++ b/wb_new_ui/assets/Extend_MJ_HeChi/package.xml @@ -208,11 +208,11 @@ - - - - - + + + + + @@ -236,6 +236,11 @@ + + + + + \ No newline at end of file diff --git a/wb_new_ui/assets/Info_MJ_HeChi/Cgm_create_room.xml b/wb_new_ui/assets/Info_MJ_HeChi/Cgm_create_room.xml index 8ccc213f..781ad403 100644 --- a/wb_new_ui/assets/Info_MJ_HeChi/Cgm_create_room.xml +++ b/wb_new_ui/assets/Info_MJ_HeChi/Cgm_create_room.xml @@ -53,17 +53,17 @@