同步头像和提示可以出牌修改
parent
391d43becf
commit
910d7508ec
|
|
@ -1,6 +1,7 @@
|
||||||
local CardCheck = {
|
local CardCheck = {
|
||||||
|
|
||||||
cardList = {},
|
cardList = {},
|
||||||
|
cardListSord = {},
|
||||||
cardNum = 0,
|
cardNum = 0,
|
||||||
cardSize = 0,
|
cardSize = 0,
|
||||||
long = false,
|
long = false,
|
||||||
|
|
@ -27,6 +28,8 @@ function M:initFlag()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:initCards(cardList, flag)
|
function M:initCards(cardList, flag)
|
||||||
|
print("lingmenginitCards")
|
||||||
|
pt(cardList)
|
||||||
local temp_long = 0
|
local temp_long = 0
|
||||||
self:Clear()
|
self:Clear()
|
||||||
if flag then
|
if flag then
|
||||||
|
|
@ -37,6 +40,7 @@ function M:initCards(cardList, flag)
|
||||||
else
|
else
|
||||||
self.cardList[number] = 1
|
self.cardList[number] = 1
|
||||||
self.cardSize = self.cardSize + 1
|
self.cardSize = self.cardSize + 1
|
||||||
|
table.insert(self.cardListSord, number)
|
||||||
end
|
end
|
||||||
self.cardNum = self.cardNum + 1
|
self.cardNum = self.cardNum + 1
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
|
|
@ -55,6 +59,7 @@ function M:initCards(cardList, flag)
|
||||||
else
|
else
|
||||||
self.cardList[number] = 1
|
self.cardList[number] = 1
|
||||||
self.cardSize = self.cardSize + 1
|
self.cardSize = self.cardSize + 1
|
||||||
|
table.insert(self.cardListSord, number)
|
||||||
end
|
end
|
||||||
self.cardNum = self.cardNum + 1
|
self.cardNum = self.cardNum + 1
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
|
|
@ -69,7 +74,7 @@ function M:initCards(cardList, flag)
|
||||||
|
|
||||||
print(self.cardNum, self.cardSize, temp_long)
|
print(self.cardNum, self.cardSize, temp_long)
|
||||||
pt(self.cardList)
|
pt(self.cardList)
|
||||||
self.long = temp_long == self.cardNum
|
self.long = temp_long == self.cardNum and self.cardNum >= 5
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:CheckCards()
|
function M:CheckCards()
|
||||||
|
|
@ -109,7 +114,9 @@ function M:CheckDuiZi()
|
||||||
end
|
end
|
||||||
if self.cardNum % 2 == 0 then
|
if self.cardNum % 2 == 0 then
|
||||||
local last_k
|
local last_k
|
||||||
for k, v in pairs(self.cardList) do
|
for i = 1, self.cardSize do
|
||||||
|
local k = self.cardListSord[i]
|
||||||
|
local v = self.cardList[k]
|
||||||
if v == 2 then
|
if v == 2 then
|
||||||
if not last_k then
|
if not last_k then
|
||||||
last_k = k
|
last_k = k
|
||||||
|
|
@ -117,6 +124,7 @@ function M:CheckDuiZi()
|
||||||
if math.abs(last_k - k) ~= 1 then
|
if math.abs(last_k - k) ~= 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
last_k = k
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
|
|
@ -147,7 +155,9 @@ function M:CheckSanDai()
|
||||||
if temp_normol_feiji then
|
if temp_normol_feiji then
|
||||||
local last_k
|
local last_k
|
||||||
local num_san = 0
|
local num_san = 0
|
||||||
for k, v in pairs(self.cardList) do
|
for i = 1, self.cardSize do
|
||||||
|
local k = self.cardListSord[i]
|
||||||
|
local v = self.cardList[k]
|
||||||
if v >= 3 then
|
if v >= 3 then
|
||||||
num_san = num_san + 1
|
num_san = num_san + 1
|
||||||
if not last_k then
|
if not last_k then
|
||||||
|
|
@ -156,10 +166,11 @@ function M:CheckSanDai()
|
||||||
if math.abs(last_k - k) ~= 1 then
|
if math.abs(last_k - k) ~= 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
last_k = k
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if num_san == temp_normol_feiji then
|
if num_san >= temp_normol_feiji then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
|
|
@ -169,7 +180,9 @@ function M:CheckSanDai()
|
||||||
print("liengmengCheckSanDai", self.planeNoBelt, self.cardNum)
|
print("liengmengCheckSanDai", self.planeNoBelt, self.cardNum)
|
||||||
if self.planeNoBelt and self.cardNum % 3 == 0 then
|
if self.planeNoBelt and self.cardNum % 3 == 0 then
|
||||||
local last_k
|
local last_k
|
||||||
for k, v in pairs(self.cardList) do
|
for i = 1, self.cardSize do
|
||||||
|
local k = self.cardListSord[i]
|
||||||
|
local v = self.cardList[k]
|
||||||
if v == 3 then
|
if v == 3 then
|
||||||
print("liengmengCheckSanDai2")
|
print("liengmengCheckSanDai2")
|
||||||
if not last_k then
|
if not last_k then
|
||||||
|
|
@ -179,6 +192,7 @@ function M:CheckSanDai()
|
||||||
if math.abs(last_k - k) ~= 1 then
|
if math.abs(last_k - k) ~= 1 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
last_k = k
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
|
|
@ -217,7 +231,9 @@ function M:CheckZha()
|
||||||
|
|
||||||
if self.fourDaiThree and self.cardNum == 7 then
|
if self.fourDaiThree and self.cardNum == 7 then
|
||||||
local flag_four
|
local flag_four
|
||||||
for k, v in pairs(self.cardList) do
|
for i = 1, self.cardSize do
|
||||||
|
local k = self.cardListSord[i]
|
||||||
|
local v = self.cardList[k]
|
||||||
if v == 4 then
|
if v == 4 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -228,6 +244,7 @@ end
|
||||||
|
|
||||||
function M:Clear()
|
function M:Clear()
|
||||||
self.cardList = {}
|
self.cardList = {}
|
||||||
|
self.cardListSord = {}
|
||||||
self.cardNum = 0
|
self.cardNum = 0
|
||||||
self.cardSize = 0
|
self.cardSize = 0
|
||||||
self.long = false
|
self.long = false
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ function M:InitView(url)
|
||||||
self:EventInit()
|
self:EventInit()
|
||||||
|
|
||||||
self._view:GetChild("bg_mask").onClick:Set(function()
|
self._view:GetChild("bg_mask").onClick:Set(function()
|
||||||
self:ResetPoker()
|
-- self:ResetPoker()
|
||||||
end)
|
end)
|
||||||
local btn_rule = self._view:GetChild("right_panel"):GetChild("btn_log")
|
local btn_rule = self._view:GetChild("right_panel"):GetChild("btn_log")
|
||||||
self._view:GetChild('info_text'):GetChild('text').text = room.room_config:GetDes()
|
self._view:GetChild('info_text'):GetChild('text').text = room.room_config:GetDes()
|
||||||
|
|
|
||||||
|
|
@ -1074,6 +1074,7 @@ function M:BtnEvent()
|
||||||
function()
|
function()
|
||||||
--printlog("wwwwwwwwwww111111111111111111111111")
|
--printlog("wwwwwwwwwww111111111111111111111111")
|
||||||
--pt(self.tips_card_list)
|
--pt(self.tips_card_list)
|
||||||
|
self._ctr_canSendCard.selectedIndex = 1
|
||||||
if self.tips_card_list ~= nil and #self.tips_card_list ~= 0 then
|
if self.tips_card_list ~= nil and #self.tips_card_list ~= 0 then
|
||||||
local index = self.tips_click_count % #self.tips_card_list + 1
|
local index = self.tips_click_count % #self.tips_card_list + 1
|
||||||
self:ShowTipsCard(index)
|
self:ShowTipsCard(index)
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue