听提示列表
parent
dce2f67297
commit
69f358c85c
|
|
@ -108,7 +108,6 @@ function M:tryPair(card)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:tryKezi1Zhong(card)
|
function M:tryKezi1Zhong(card)
|
||||||
if (self.zhong_count >= 1 and checkCardAndRomve(card, self.cardList, 2)) then
|
if (self.zhong_count >= 1 and checkCardAndRomve(card, self.cardList, 2)) then
|
||||||
local cardGroup = { card, card, zhongid }
|
local cardGroup = { card, card, zhongid }
|
||||||
|
|
@ -233,7 +232,6 @@ function M:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self:tryKezi2Zhong(activeCard)) then
|
if (self:tryKezi2Zhong(activeCard)) then
|
||||||
|
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -367,12 +365,10 @@ function M.MuiltiplteCaculateTingPai(cardInhand,isZhong,qidui,eightLaizi)
|
||||||
end
|
end
|
||||||
|
|
||||||
return currentTingList
|
return currentTingList
|
||||||
|
|
||||||
else
|
else
|
||||||
zhongid = 0
|
zhongid = 0
|
||||||
return M.tingPai(cardInhand, isZhong, qidui, eightLaizi)
|
return M.tingPai(cardInhand, isZhong, qidui, eightLaizi)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
@ -108,7 +108,6 @@ function M:tryPair(card)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:tryKezi1Zhong(card)
|
function M:tryKezi1Zhong(card)
|
||||||
if (self.zhong_count >= 1 and checkCardAndRomve(card, self.cardList, 2)) then
|
if (self.zhong_count >= 1 and checkCardAndRomve(card, self.cardList, 2)) then
|
||||||
local cardGroup = { card, card, zhongid }
|
local cardGroup = { card, card, zhongid }
|
||||||
|
|
@ -204,6 +203,7 @@ function M:tryWin()
|
||||||
|
|
||||||
local activeCard = self.cardList[1]
|
local activeCard = self.cardList[1]
|
||||||
if (self:tryPair(activeCard)) then
|
if (self:tryPair(activeCard)) then
|
||||||
|
print("tryPair")
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -212,6 +212,7 @@ function M:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self:tryKezi(activeCard)) then
|
if (self:tryKezi(activeCard)) then
|
||||||
|
print("tryKezi")
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -219,6 +220,7 @@ function M:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self:tryShunzi(activeCard)) then
|
if (self:tryShunzi(activeCard)) then
|
||||||
|
print("tryShunzi")
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -226,6 +228,7 @@ function M:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self:tryKezi1Zhong(activeCard)) then
|
if (self:tryKezi1Zhong(activeCard)) then
|
||||||
|
print("tryKezi1Zhong")
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -233,7 +236,7 @@ function M:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self:tryKezi2Zhong(activeCard)) then
|
if (self:tryKezi2Zhong(activeCard)) then
|
||||||
|
print("tryKezi2Zhong")
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -241,6 +244,7 @@ function M:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self:tryShunzi1Zhong(activeCard)) then
|
if (self:tryShunzi1Zhong(activeCard)) then
|
||||||
|
print("tryShunzi1Zhong")
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -248,6 +252,7 @@ function M:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
if (self:tryPair1Zhong(activeCard)) then
|
if (self:tryPair1Zhong(activeCard)) then
|
||||||
|
print("tryPair1Zhong")
|
||||||
if (self:tryWin()) then
|
if (self:tryWin()) then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -314,12 +319,12 @@ local function init(self,cardInhand,addCard,isZhong,qidui,eightLaizi)
|
||||||
return self:checkQidui() or self:tryWin()
|
return self:checkQidui() or self:tryWin()
|
||||||
end
|
end
|
||||||
|
|
||||||
local specialCardList={400,403,406,409,412,415,418}
|
local specialCardList = { 401, 402, 403, 404, 405, 406, 407 }
|
||||||
function M.tingPai(cardInhand, isZhong, qidui, eightLaizi)
|
function M.tingPai(cardInhand, isZhong, qidui, eightLaizi)
|
||||||
--printlog("isZhong",isZhong)
|
printlog("isZhong", isZhong)
|
||||||
--printlog("qidui",qidui)
|
printlog("qidui", qidui)
|
||||||
--printlog("eightLaizi",eightLaizi)
|
printlog("eightLaizi", eightLaizi)
|
||||||
--pt(cardInhand)
|
pt(cardInhand)
|
||||||
local self = setmetatable({}, { __index = M })
|
local self = setmetatable({}, { __index = M })
|
||||||
local tingList = {}
|
local tingList = {}
|
||||||
if not cardInhand or #cardInhand == 0 then
|
if not cardInhand or #cardInhand == 0 then
|
||||||
|
|
@ -367,12 +372,10 @@ function M.MuiltiplteCaculateTingPai(cardInhand,isZhong,qidui,eightLaizi)
|
||||||
end
|
end
|
||||||
|
|
||||||
return currentTingList
|
return currentTingList
|
||||||
|
|
||||||
else
|
else
|
||||||
zhongid = 0
|
zhongid = 0
|
||||||
return M.tingPai(cardInhand, isZhong, qidui, eightLaizi)
|
return M.tingPai(cardInhand, isZhong, qidui, eightLaizi)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
@ -38,12 +38,7 @@ function M:InitView(url)
|
||||||
self.Laizi2Btn.visible = true
|
self.Laizi2Btn.visible = true
|
||||||
self.bugangnum = self._view:GetChild("bugangnum")
|
self.bugangnum = self._view:GetChild("bugangnum")
|
||||||
|
|
||||||
print("==================================jing", room.jing)
|
|
||||||
if room.jing then
|
|
||||||
self.jing = self._view:GetChild('jing')
|
self.jing = self._view:GetChild('jing')
|
||||||
print("==================================self.jing", room.jing)
|
|
||||||
self.jing.visible = true
|
|
||||||
end
|
|
||||||
|
|
||||||
self:PlayerChangeLineState()
|
self:PlayerChangeLineState()
|
||||||
|
|
||||||
|
|
@ -105,6 +100,17 @@ function M:UpdateRound()
|
||||||
self._view:GetChild("tex_round2").text = self._room.room_config.round
|
self._view:GetChild("tex_round2").text = self._room.room_config.round
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M:ShowJing()
|
||||||
|
print("==================================self._room.jing", self._room.jing)
|
||||||
|
if self._room.jing then
|
||||||
|
self.jing.icon = 'ui://Main_Majiang/' ..
|
||||||
|
get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. self._room.jing
|
||||||
|
self.jing.visible = true
|
||||||
|
else
|
||||||
|
self.jing.visible = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M:InitPlayerInfoView()
|
function M:InitPlayerInfoView()
|
||||||
self._player_info = {}
|
self._player_info = {}
|
||||||
local _player_info = self._player_info
|
local _player_info = self._player_info
|
||||||
|
|
@ -159,6 +165,7 @@ function M:EventInit()
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
|
self:ShowJing()
|
||||||
local list = _room.player_list
|
local list = _room.player_list
|
||||||
for i = 1, #list do
|
for i = 1, #list do
|
||||||
local p = list[i]
|
local p = list[i]
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,9 @@ end
|
||||||
|
|
||||||
function M:ShowHuTip(card_list)
|
function M:ShowHuTip(card_list)
|
||||||
printlog("ShowHuTip")
|
printlog("ShowHuTip")
|
||||||
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
|
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui,
|
||||||
|
DataManager.CurrenRoom.room_config.Laizi)
|
||||||
|
pt(tingList)
|
||||||
if #tingList > 0 then
|
if #tingList > 0 then
|
||||||
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
|
if DataManager.CurrenRoom.laiziInfo and #DataManager.CurrenRoom.laiziInfo > 0 then
|
||||||
for i = 1, #DataManager.CurrenRoom.laiziInfo do
|
for i = 1, #DataManager.CurrenRoom.laiziInfo do
|
||||||
|
|
@ -26,7 +28,6 @@ function M:ShowHuTip(card_list)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
self._mainView._hu_tip:FillData(tingList)
|
self._mainView._hu_tip:FillData(tingList)
|
||||||
end
|
end
|
||||||
|
|
@ -44,7 +45,6 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
if obj.card:GetController("laizi") then
|
if obj.card:GetController("laizi") then
|
||||||
obj.card:GetController("laizi").selectedIndex = 1
|
obj.card:GetController("laizi").selectedIndex = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if obj.card.GetController then
|
if obj.card.GetController then
|
||||||
|
|
@ -53,11 +53,8 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -73,7 +70,8 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
local btn = _carViewList[i].card
|
local btn = _carViewList[i].card
|
||||||
local card = self:GetCard(btn)
|
local card = self:GetCard(btn)
|
||||||
list_remove(card_list, card)
|
list_remove(card_list, card)
|
||||||
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true, DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
|
local tingList = CardCheck.MuiltiplteCaculateTingPai(card_list, true,
|
||||||
|
DataManager.CurrenRoom.room_config.Qidui, DataManager.CurrenRoom.room_config.Laizi)
|
||||||
if #tingList > 0 then
|
if #tingList > 0 then
|
||||||
local count = 0
|
local count = 0
|
||||||
for j = 1, #tingList do
|
for j = 1, #tingList do
|
||||||
|
|
@ -109,7 +107,6 @@ function M:UpdateHandCard(getcard, mp)
|
||||||
end
|
end
|
||||||
self._out_card = false
|
self._out_card = false
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__OnClickHandCard(context)
|
function M:__OnClickHandCard(context)
|
||||||
|
|
@ -190,6 +187,7 @@ function M:CheckPlayerOnlineState()
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Clear(bskip)
|
function M:Clear(bskip)
|
||||||
--self._ctr_state.selectedIndex = 0
|
--self._ctr_state.selectedIndex = 0
|
||||||
self._area_fz_list.x = self._src_fz_list.x
|
self._area_fz_list.x = self._src_fz_list.x
|
||||||
|
|
@ -208,6 +206,6 @@ function M:Clear(bskip)
|
||||||
self._carViewList[i].card:Dispose()
|
self._carViewList[i].card:Dispose()
|
||||||
end
|
end
|
||||||
self._carViewList = {}
|
self._carViewList = {}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
Loading…
Reference in New Issue