同步出牌提示
parent
b502289a2a
commit
ff796b86dd
|
|
@ -195,13 +195,13 @@ function M:LoadConfigToDetail(data)
|
|||
configData.jiangma == 0 and "不奖" or string.format("奖%s", configData.jiangma * 2))
|
||||
end
|
||||
if configData.zimo then
|
||||
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
|
||||
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
|
||||
end
|
||||
if configData.shaozhuang then
|
||||
returnString = string.format("%s%s", returnString, configData.shaozhuang == 0 and "" or ",有烧庄")
|
||||
end
|
||||
if configData.fengding then
|
||||
local matString = "%s,%s"
|
||||
local matString = "%s%s"
|
||||
if configData.fengding == 0 then
|
||||
returnString = string.format(matString, returnString, ",封顶20炮")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ function M:LoadConfigToDetail(data)
|
|||
configData.jiangma == 0 and "不奖" or string.format("奖%s", configData.jiangma * 2))
|
||||
end
|
||||
if configData.zimo then
|
||||
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
|
||||
returnString = string.format("%s,%s", returnString, configData.zimo == 0 and "可点炮,可自摸" or "必须自摸")
|
||||
end
|
||||
if configData.shaozhuang then
|
||||
returnString = string.format("%s%s", returnString, configData.shaozhuang == 0 and "" or ",有烧庄")
|
||||
|
|
|
|||
|
|
@ -79,17 +79,21 @@ function M:initCards(cardList, flag, flag_allCards)
|
|||
end
|
||||
|
||||
function M:CheckCards()
|
||||
print("lingmengCheckAloneOrLong")
|
||||
if self:CheckAloneOrLong() then
|
||||
return true
|
||||
end
|
||||
print("lingmengCheckDuiZi")
|
||||
|
||||
if self:CheckDuiZi() then
|
||||
return true
|
||||
end
|
||||
print("lingmengCheckSanDai")
|
||||
|
||||
if self:CheckSanDai() then
|
||||
return true
|
||||
end
|
||||
print("lingmengCheckZha")
|
||||
|
||||
if self:CheckZha() then
|
||||
return true
|
||||
|
|
@ -135,13 +139,16 @@ function M:CheckSanDai()
|
|||
if self.cardNum == 5 and self.cardSize < 4 then
|
||||
return true
|
||||
end
|
||||
if self.threeNoBelt and self.cardNum == 3 and self.cardSize == 1 then
|
||||
return true
|
||||
end
|
||||
|
||||
if self.threelack and self.cardNum == 4 and self.cardSize == 2 and self._flag_allCards then
|
||||
return true
|
||||
end
|
||||
|
||||
if self.threeNoBelt and self.cardNum == 3 and self.cardSize == 1 then
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
--飞机
|
||||
local temp_normol_feiji
|
||||
if self.cardNum % 5 == 0 then
|
||||
|
|
@ -173,29 +180,7 @@ function M:CheckSanDai()
|
|||
end
|
||||
end
|
||||
|
||||
print("liengmengCheckSanDai", self.planeNoBelt, self.cardNum)
|
||||
if self.planeNoBelt and self.cardNum % 3 == 0 then
|
||||
local last_k
|
||||
for i = 1, self.cardSize do
|
||||
local k = self.cardListSord[i]
|
||||
local v = self.cardList[k]
|
||||
if v == 3 then
|
||||
print("liengmengCheckSanDai2")
|
||||
if not last_k then
|
||||
last_k = k
|
||||
else
|
||||
print("liengmengCheckSanDai3", last_k, k)
|
||||
if math.abs(last_k - k) ~= 1 then
|
||||
return
|
||||
end
|
||||
last_k = k
|
||||
end
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
print("liengmengCheckthreelack", self.threelack, self._flag_allCards)
|
||||
|
||||
if self.threelack and self._flag_allCards then
|
||||
local last_k
|
||||
|
|
@ -203,21 +188,49 @@ function M:CheckSanDai()
|
|||
for k, v in pairs(self.cardList) do
|
||||
if v >= 3 then
|
||||
num_san = num_san + 1
|
||||
print("liengmengCheckthreelack2", last_k, k)
|
||||
|
||||
if not last_k then
|
||||
last_k = k
|
||||
else
|
||||
if math.abs(last_k - k) ~= 1 then
|
||||
return
|
||||
end
|
||||
last_k = k
|
||||
end
|
||||
end
|
||||
end
|
||||
print("liengmengCheckthreelack4", num_san, self.cardNum - num_san * 3 < num_san * 2)
|
||||
|
||||
if self.cardNum - num_san * 3 < num_san * 2 then
|
||||
return true
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
print("liengmengCheckplaneNoBelt", self.planeNoBelt, self.cardNum % 3)
|
||||
|
||||
if self.planeNoBelt and self.cardNum % 3 == 0 then
|
||||
local last_k
|
||||
for i = 1, self.cardSize do
|
||||
local k = self.cardListSord[i]
|
||||
local v = self.cardList[k]
|
||||
if v == 3 then
|
||||
if not last_k then
|
||||
last_k = k
|
||||
else
|
||||
if math.abs(last_k - k) ~= 1 then
|
||||
return
|
||||
end
|
||||
last_k = k
|
||||
end
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function M:CheckZha()
|
||||
|
|
|
|||
|
|
@ -287,6 +287,9 @@ end
|
|||
function M:LoadConfigToDetail(data)
|
||||
local configData = json.decode(data)
|
||||
local returnString = string.format("人数%s人", configData.maxPlayers)
|
||||
if configData.leaf then
|
||||
returnString = string.format("%s,%s", returnString, configData.leaf == 1 and "十五张手牌" or "十六张手牌")
|
||||
end
|
||||
if configData.rule then
|
||||
returnString = string.format("%s%s", returnString,
|
||||
configData.rule == 1 and ",黑桃三必出" or "")
|
||||
|
|
|
|||
|
|
@ -746,6 +746,7 @@ function M:TouchMoveEnd(context)
|
|||
table.sort(send_card, tableSortNumber)
|
||||
send_card = #xuan_card > 0 and xuan_card or send_card
|
||||
self._cardCheck:initCards(send_card, #xuan_card > 0, #send_card == self._view_handCard.numItems)
|
||||
print("lingmengthis?")
|
||||
self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0
|
||||
else
|
||||
self._ctr_canSendCard.selectedIndex = 0
|
||||
|
|
@ -1068,6 +1069,7 @@ function M:BtnEvent()
|
|||
self:ErrorTip('请选择要出的牌')
|
||||
else
|
||||
self.gameCtr:SendCard(send_card, currentCard)
|
||||
self._ctr_canSendCard.selectedIndex = 0
|
||||
end
|
||||
end
|
||||
)
|
||||
|
|
@ -1114,6 +1116,7 @@ function M:BtnEvent()
|
|||
end
|
||||
|
||||
function M:ShowTipsCard(index)
|
||||
print("lingmengShowTipsCard")
|
||||
local item = self.tips_card_list[index]
|
||||
for i = 1, #self.card_list do
|
||||
local card = self.card_list[i]
|
||||
|
|
@ -1126,11 +1129,10 @@ function M:ShowTipsCard(index)
|
|||
end
|
||||
if isExsit == false then
|
||||
self:UpdateCardMove(card.btn_card, false, false)
|
||||
else
|
||||
end
|
||||
end
|
||||
self._ctr_canSendCard.selectedIndex = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M:GetHandCardOffset(count)
|
||||
local start = -90 ---54
|
||||
|
|
|
|||
|
|
@ -157,6 +157,9 @@ function M:onTouchMove(context)
|
|||
else
|
||||
local touchPos = self._view_handCardList:GetChildAt(0):GlobalToLocal(Vector2.New(context.inputEvent.x,
|
||||
context.inputEvent.y))
|
||||
if touchPos.x < 0 then
|
||||
return
|
||||
end
|
||||
local cardWidth = button.width;
|
||||
local grap = self._view_handCardList.columnGap
|
||||
local chooseIndex = math.floor(touchPos.x / (cardWidth + grap))
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue