新git地址同步
parent
8729b34381
commit
7edfac1243
|
|
@ -364,6 +364,5 @@ function ViewUtil.ShowOneInput(showText, callback)
|
||||||
local btn_center = pop_oneInput:GetChild('btn_close')
|
local btn_center = pop_oneInput:GetChild('btn_close')
|
||||||
btn_center.onClick:Add(function()
|
btn_center.onClick:Add(function()
|
||||||
GRoot.inst:RemoveChild(pop_oneInput)
|
GRoot.inst:RemoveChild(pop_oneInput)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -182,12 +182,11 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
||||||
local handCardList = handCardItem:GetChild("list")
|
local handCardList = handCardItem:GetChild("list")
|
||||||
--手牌排序
|
--手牌排序
|
||||||
table.sort(infoList.hand_card, ViewUtil.HandCardSort)
|
table.sort(infoList.hand_card, self.HandCardSortAndJing)
|
||||||
handCardList:SetVirtual()
|
handCardList:SetVirtual()
|
||||||
handCardList.itemRenderer = function(index, obj)
|
handCardList.itemRenderer = function(index, obj)
|
||||||
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
|
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
|
||||||
if room.jing == infoList.hand_card[index + 1] then
|
if room.jing == infoList.hand_card[index + 1] then
|
||||||
ViewUtil:ErrorTip("显示精")
|
|
||||||
obj:GetController('jing').selectedIndex = 1
|
obj:GetController('jing').selectedIndex = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -199,7 +198,6 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
end
|
end
|
||||||
|
|
||||||
if infoList.seat == room.banker_seat then
|
if infoList.seat == room.banker_seat then
|
||||||
ViewUtil:ErrorTip("显示庄家")
|
|
||||||
isZhuang.selectedIndex = 1
|
isZhuang.selectedIndex = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -215,7 +213,11 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
ziMoCtr.selectedIndex = 1
|
ziMoCtr.selectedIndex = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
huCardBtn.icon = string.format("ui://Main_Majiang/202_%d", infoList.win_card)
|
huCardBtn.icon = string.format("ui://Main_Majiang/202_%d", infoList.win_card)
|
||||||
|
if room.jing == infoList.win_card then
|
||||||
|
huCardBtn:GetController('jing').selectedIndex = 1
|
||||||
|
end
|
||||||
huCardBtn.visible = true
|
huCardBtn.visible = true
|
||||||
|
|
||||||
jiangMaList.visible = true
|
jiangMaList.visible = true
|
||||||
|
|
@ -286,6 +288,36 @@ function M:fillHead(url, view)
|
||||||
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local prefix
|
local prefix
|
||||||
function M:GetPrefix()
|
function M:GetPrefix()
|
||||||
-- if not prefix then
|
-- if not prefix then
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,10 @@ function M:SendOutCard(card, callback)
|
||||||
local p = _room.self_player
|
local p = _room.self_player
|
||||||
_room.curren_outcard_seat = -1
|
_room.curren_outcard_seat = -1
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
|
|
||||||
|
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
p.outcard_list[#p.outcard_list + 1] = card
|
p.outcard_list[#p.outcard_list + 1] = card
|
||||||
|
|
@ -158,7 +161,8 @@ function M:OnEventSendCards(evt_data)
|
||||||
end
|
end
|
||||||
p.card_list = handcards
|
p.card_list = handcards
|
||||||
self._room.self_player.hand_left_count = #handcards
|
self._room.self_player.hand_left_count = #handcards
|
||||||
table.sort(handcards, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(handcards, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -176,7 +180,8 @@ function M:OnEventOutCard(evt_data)
|
||||||
else
|
else
|
||||||
if seat == _room.self_player.seat then
|
if seat == _room.self_player.seat then
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
end
|
end
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
|
|
@ -196,7 +201,8 @@ function M:OnEventTakeCard(evt_data)
|
||||||
p.hand_left_count = p.hand_left_count + 1
|
p.hand_left_count = p.hand_left_count + 1
|
||||||
if (seat == _room.self_player.seat) then
|
if (seat == _room.self_player.seat) then
|
||||||
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
||||||
-- table.sort( _room.self_player.card_list, ViewUtil.HandCardSort )
|
|
||||||
|
-- table.sort( _room.self_player.card_list, self.HandCardSortAndJing )
|
||||||
end
|
end
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
||||||
end)
|
end)
|
||||||
|
|
@ -312,7 +318,7 @@ function M:OnEventHu(evt_data)
|
||||||
|
|
||||||
self._cacheEvent:Enqueue(function()
|
self._cacheEvent:Enqueue(function()
|
||||||
win_p.card_list = cards
|
win_p.card_list = cards
|
||||||
table.sort(win_p.card_list, ViewUtil.HandCardSort)
|
table.sort(win_p.card_list, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
||||||
win_list)
|
win_list)
|
||||||
end)
|
end)
|
||||||
|
|
@ -414,4 +420,34 @@ function M:Discard(card)
|
||||||
_client:send(Protocol.Game_Da, _data)
|
_client:send(Protocol.Game_Da, _data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -269,6 +269,7 @@ function M:EventInit()
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
|
self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ function M:FillRoomData(data)
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
local card_info = _player_card_info[self:GetPos(p.seat)]
|
local card_info = _player_card_info[self:GetPos(p.seat)]
|
||||||
card_info:Clear()
|
card_info:Clear()
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
card_info:UpdateHandCard(false, true)
|
card_info:UpdateHandCard(false, true)
|
||||||
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
@ -206,7 +206,7 @@ function M:CmdOutCard(cmd, index)
|
||||||
data.last_out_seat = cmd.seat
|
data.last_out_seat = cmd.seat
|
||||||
local u = data.player_card_data[cmd.seat]
|
local u = data.player_card_data[cmd.seat]
|
||||||
list_remove(u.card_list, cmd.data.card)
|
list_remove(u.card_list, cmd.data.card)
|
||||||
table.sort(u.card_list, ViewUtil.HandCardSort)
|
table.sort(u.card_list, self.HandCardSortAndJing)
|
||||||
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -294,4 +294,34 @@ function M:UpdateStep(step)
|
||||||
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -182,12 +182,11 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
||||||
local handCardList = handCardItem:GetChild("list")
|
local handCardList = handCardItem:GetChild("list")
|
||||||
--手牌排序
|
--手牌排序
|
||||||
table.sort(infoList.hand_card, ViewUtil.HandCardSort)
|
table.sort(infoList.hand_card, self.HandCardSortAndJing)
|
||||||
handCardList:SetVirtual()
|
handCardList:SetVirtual()
|
||||||
handCardList.itemRenderer = function(index, obj)
|
handCardList.itemRenderer = function(index, obj)
|
||||||
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
|
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
|
||||||
if room.jing == infoList.hand_card[index + 1] then
|
if room.jing == infoList.hand_card[index + 1] then
|
||||||
ViewUtil:ErrorTip("显示精")
|
|
||||||
obj:GetController('jing').selectedIndex = 1
|
obj:GetController('jing').selectedIndex = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -199,7 +198,6 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
end
|
end
|
||||||
|
|
||||||
if infoList.seat == room.banker_seat then
|
if infoList.seat == room.banker_seat then
|
||||||
ViewUtil:ErrorTip("显示庄家")
|
|
||||||
isZhuang.selectedIndex = 1
|
isZhuang.selectedIndex = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -286,6 +284,36 @@ function M:fillHead(url, view)
|
||||||
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local prefix
|
local prefix
|
||||||
function M:GetPrefix()
|
function M:GetPrefix()
|
||||||
-- if not prefix then
|
-- if not prefix then
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,10 @@ function M:SendOutCard(card, callback)
|
||||||
local p = _room.self_player
|
local p = _room.self_player
|
||||||
_room.curren_outcard_seat = -1
|
_room.curren_outcard_seat = -1
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
|
|
||||||
|
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
p.outcard_list[#p.outcard_list + 1] = card
|
p.outcard_list[#p.outcard_list + 1] = card
|
||||||
|
|
@ -158,7 +161,8 @@ function M:OnEventSendCards(evt_data)
|
||||||
end
|
end
|
||||||
p.card_list = handcards
|
p.card_list = handcards
|
||||||
self._room.self_player.hand_left_count = #handcards
|
self._room.self_player.hand_left_count = #handcards
|
||||||
table.sort(handcards, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(handcards, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -176,7 +180,8 @@ function M:OnEventOutCard(evt_data)
|
||||||
else
|
else
|
||||||
if seat == _room.self_player.seat then
|
if seat == _room.self_player.seat then
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
end
|
end
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
|
|
@ -196,7 +201,8 @@ function M:OnEventTakeCard(evt_data)
|
||||||
p.hand_left_count = p.hand_left_count + 1
|
p.hand_left_count = p.hand_left_count + 1
|
||||||
if (seat == _room.self_player.seat) then
|
if (seat == _room.self_player.seat) then
|
||||||
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
||||||
-- table.sort( _room.self_player.card_list, ViewUtil.HandCardSort )
|
|
||||||
|
-- table.sort( _room.self_player.card_list, self.HandCardSortAndJing )
|
||||||
end
|
end
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
||||||
end)
|
end)
|
||||||
|
|
@ -312,7 +318,7 @@ function M:OnEventHu(evt_data)
|
||||||
|
|
||||||
self._cacheEvent:Enqueue(function()
|
self._cacheEvent:Enqueue(function()
|
||||||
win_p.card_list = cards
|
win_p.card_list = cards
|
||||||
table.sort(win_p.card_list, ViewUtil.HandCardSort)
|
table.sort(win_p.card_list, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
||||||
win_list)
|
win_list)
|
||||||
end)
|
end)
|
||||||
|
|
@ -414,4 +420,34 @@ function M:Discard(card)
|
||||||
_client:send(Protocol.Game_Da, _data)
|
_client:send(Protocol.Game_Da, _data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -269,6 +269,7 @@ function M:EventInit()
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
|
self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ function M:FillRoomData(data)
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
local card_info = _player_card_info[self:GetPos(p.seat)]
|
local card_info = _player_card_info[self:GetPos(p.seat)]
|
||||||
card_info:Clear()
|
card_info:Clear()
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
card_info:UpdateHandCard(false, true)
|
card_info:UpdateHandCard(false, true)
|
||||||
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
@ -206,7 +206,7 @@ function M:CmdOutCard(cmd, index)
|
||||||
data.last_out_seat = cmd.seat
|
data.last_out_seat = cmd.seat
|
||||||
local u = data.player_card_data[cmd.seat]
|
local u = data.player_card_data[cmd.seat]
|
||||||
list_remove(u.card_list, cmd.data.card)
|
list_remove(u.card_list, cmd.data.card)
|
||||||
table.sort(u.card_list, ViewUtil.HandCardSort)
|
table.sort(u.card_list, self.HandCardSortAndJing)
|
||||||
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -294,4 +294,34 @@ function M:UpdateStep(step)
|
||||||
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
||||||
local handCardList = handCardItem:GetChild("list")
|
local handCardList = handCardItem:GetChild("list")
|
||||||
--手牌排序
|
--手牌排序
|
||||||
table.sort(infoList.hand_card, ViewUtil.HandCardSort)
|
table.sort(infoList.hand_card, self.HandCardSortAndJing)
|
||||||
handCardList:SetVirtual()
|
handCardList:SetVirtual()
|
||||||
handCardList.itemRenderer = function(index, obj)
|
handCardList.itemRenderer = function(index, obj)
|
||||||
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
|
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(), infoList.hand_card[index + 1])
|
||||||
|
|
@ -214,6 +214,9 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
end
|
end
|
||||||
|
|
||||||
huCardBtn.icon = string.format("ui://Main_Majiang/202_%d", infoList.win_card)
|
huCardBtn.icon = string.format("ui://Main_Majiang/202_%d", infoList.win_card)
|
||||||
|
if room.jing == infoList.win_card then
|
||||||
|
huCardBtn:GetController('jing').selectedIndex = 1
|
||||||
|
end
|
||||||
huCardBtn.visible = true
|
huCardBtn.visible = true
|
||||||
|
|
||||||
jiangMaList.visible = true
|
jiangMaList.visible = true
|
||||||
|
|
@ -284,6 +287,36 @@ function M:fillHead(url, view)
|
||||||
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local prefix
|
local prefix
|
||||||
function M:GetPrefix()
|
function M:GetPrefix()
|
||||||
-- if not prefix then
|
-- if not prefix then
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,11 @@ function M:SendOutCard(card, callback)
|
||||||
local p = _room.self_player
|
local p = _room.self_player
|
||||||
_room.curren_outcard_seat = -1
|
_room.curren_outcard_seat = -1
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
pt(p.card_list)
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
|
|
||||||
|
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
p.outcard_list[#p.outcard_list + 1] = card
|
p.outcard_list[#p.outcard_list + 1] = card
|
||||||
|
|
@ -158,7 +162,8 @@ function M:OnEventSendCards(evt_data)
|
||||||
end
|
end
|
||||||
p.card_list = handcards
|
p.card_list = handcards
|
||||||
self._room.self_player.hand_left_count = #handcards
|
self._room.self_player.hand_left_count = #handcards
|
||||||
table.sort(handcards, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(handcards, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -176,7 +181,8 @@ function M:OnEventOutCard(evt_data)
|
||||||
else
|
else
|
||||||
if seat == _room.self_player.seat then
|
if seat == _room.self_player.seat then
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
end
|
end
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
|
|
@ -196,7 +202,8 @@ function M:OnEventTakeCard(evt_data)
|
||||||
p.hand_left_count = p.hand_left_count + 1
|
p.hand_left_count = p.hand_left_count + 1
|
||||||
if (seat == _room.self_player.seat) then
|
if (seat == _room.self_player.seat) then
|
||||||
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
||||||
-- table.sort( _room.self_player.card_list, ViewUtil.HandCardSort )
|
|
||||||
|
-- table.sort( _room.self_player.card_list, self.HandCardSortAndJing )
|
||||||
end
|
end
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
||||||
end)
|
end)
|
||||||
|
|
@ -312,7 +319,7 @@ function M:OnEventHu(evt_data)
|
||||||
|
|
||||||
self._cacheEvent:Enqueue(function()
|
self._cacheEvent:Enqueue(function()
|
||||||
win_p.card_list = cards
|
win_p.card_list = cards
|
||||||
table.sort(win_p.card_list, ViewUtil.HandCardSort)
|
table.sort(win_p.card_list, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
||||||
win_list)
|
win_list)
|
||||||
end)
|
end)
|
||||||
|
|
@ -414,4 +421,34 @@ function M:Discard(card)
|
||||||
_client:send(Protocol.Game_Da, _data)
|
_client:send(Protocol.Game_Da, _data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ function M:SelectedConfigData()
|
||||||
local people = _config:GetController("peopleNum").selectedIndex + 2
|
local people = _config:GetController("peopleNum").selectedIndex + 2
|
||||||
|
|
||||||
local zimo = _config:GetController("ZiMo").selectedIndex
|
local zimo = _config:GetController("ZiMo").selectedIndex
|
||||||
local jingbibo = _config:GetController("jingbibo").selectedIndex
|
local jingbibo = 1 - _config:GetController("jingbibo").selectedIndex
|
||||||
|
|
||||||
|
|
||||||
local xi_pai = false
|
local xi_pai = false
|
||||||
|
|
@ -175,9 +175,9 @@ end
|
||||||
function M:LoadConfigToDetail(data)
|
function M:LoadConfigToDetail(data)
|
||||||
local configData = json.decode(data)
|
local configData = json.decode(data)
|
||||||
local returnString = string.format("人数%s人,%s,%s,%s", configData.maxPlayers,
|
local returnString = string.format("人数%s人,%s,%s,%s", configData.maxPlayers,
|
||||||
configData.zimo and "只能自摸" or "自摸可点炮",
|
configData.zimo == 0 and "只能自摸" or "自摸可点炮",
|
||||||
configData.tuoguan and string.format("%d秒后自动托管", configData.tuoguan_active_time) or "不能托管",
|
configData.tuoguan == 0 and string.format("%d秒后自动托管", configData.tuoguan_active_time) or "不能托管",
|
||||||
configData.jingbibo and "有精必博" or "有精可胡")
|
configData.jingbibo == 1 and "有精必博" or "有精可胡")
|
||||||
return returnString
|
return returnString
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -660,10 +660,13 @@ function M:__FangziTip(tip, weight)
|
||||||
local info = self._player_card_info[1]
|
local info = self._player_card_info[1]
|
||||||
local _chipeng_tip = info._view_FZTips
|
local _chipeng_tip = info._view_FZTips
|
||||||
local _ctr_tips = info._ctr_tip
|
local _ctr_tips = info._ctr_tip
|
||||||
|
printlog("__FangziTip1q")
|
||||||
|
|
||||||
local _lit_fanzi = _chipeng_tip:GetChild("list")
|
local _lit_fanzi = _chipeng_tip:GetChild("list")
|
||||||
_lit_fanzi:SetVirtual()
|
_lit_fanzi:SetVirtual()
|
||||||
local _tlist = tip.tip_map_id
|
local _tlist = tip.tip_map_id
|
||||||
|
printlog("__FangziTip1")
|
||||||
|
|
||||||
_lit_fanzi.itemRenderer = function(index, obj)
|
_lit_fanzi.itemRenderer = function(index, obj)
|
||||||
local type = obj:GetController('type')
|
local type = obj:GetController('type')
|
||||||
if index == tip.tip_num then
|
if index == tip.tip_num then
|
||||||
|
|
@ -712,6 +715,8 @@ function M:__FangziTip(tip, weight)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
printlog("__FangziTip2")
|
||||||
|
|
||||||
_ctr_tips.selectedIndex = 1
|
_ctr_tips.selectedIndex = 1
|
||||||
_lit_fanzi.numItems = tip.tip_num + 1
|
_lit_fanzi.numItems = tip.tip_num + 1
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ function M:FillRoomData(data)
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
local card_info = _player_card_info[self:GetPos(p.seat)]
|
local card_info = _player_card_info[self:GetPos(p.seat)]
|
||||||
card_info:Clear()
|
card_info:Clear()
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
card_info:UpdateHandCard(false, true)
|
card_info:UpdateHandCard(false, true)
|
||||||
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
@ -206,7 +206,7 @@ function M:CmdOutCard(cmd, index)
|
||||||
data.last_out_seat = cmd.seat
|
data.last_out_seat = cmd.seat
|
||||||
local u = data.player_card_data[cmd.seat]
|
local u = data.player_card_data[cmd.seat]
|
||||||
list_remove(u.card_list, cmd.data.card)
|
list_remove(u.card_list, cmd.data.card)
|
||||||
table.sort(u.card_list, ViewUtil.HandCardSort)
|
table.sort(u.card_list, self.HandCardSortAndJing)
|
||||||
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -294,4 +294,34 @@ function M:UpdateStep(step)
|
||||||
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ function M:FillRoomData(s2croom)
|
||||||
local _reloadInfo = s2croom["reloadInfo"]
|
local _reloadInfo = s2croom["reloadInfo"]
|
||||||
local _hand_card = _reloadInfo["hand_card"]
|
local _hand_card = _reloadInfo["hand_card"]
|
||||||
room.self_player.card_list = _hand_card
|
room.self_player.card_list = _hand_card
|
||||||
table.sort(_hand_card, ViewUtil.HandCardSort)
|
table.sort(_hand_card, self.HandCardSortAndJing)
|
||||||
|
|
||||||
local active_seat = _reloadInfo["active_seat"]
|
local active_seat = _reloadInfo["active_seat"]
|
||||||
local bank_seat = _reloadInfo["banker_seat"]
|
local bank_seat = _reloadInfo["banker_seat"]
|
||||||
|
|
@ -162,7 +162,7 @@ function M:FillPlayBackData(pd_data)
|
||||||
local _hand_card = _jp["hand_card"]
|
local _hand_card = _jp["hand_card"]
|
||||||
p.card_list = _hand_card
|
p.card_list = _hand_card
|
||||||
--room.self_player.card_list = _hand_card
|
--room.self_player.card_list = _hand_card
|
||||||
table.sort(_hand_card, ViewUtil.HandCardSort)
|
table.sort(_hand_card, self.HandCardSortAndJing)
|
||||||
p.total_score = _jp["score"]
|
p.total_score = _jp["score"]
|
||||||
p.hand_left_count = #_hand_card
|
p.hand_left_count = #_hand_card
|
||||||
if _jp.hp_info then
|
if _jp.hp_info then
|
||||||
|
|
@ -175,4 +175,34 @@ function M:FillPlayBackData(pd_data)
|
||||||
room.cmdList = pd_data["cmdList"]
|
room.cmdList = pd_data["cmdList"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ function M:fillResult0(room, peopleNum, result)
|
||||||
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
local handCardItem = allCardsList:AddItemFromPool("ui://Main_Majiang/Comp_HandCard")
|
||||||
local handCardList = handCardItem:GetChild("list")
|
local handCardList = handCardItem:GetChild("list")
|
||||||
--手牌排序
|
--手牌排序
|
||||||
table.sort(infoList.hand_card, ViewUtil.HandCardSort)
|
table.sort(infoList.hand_card, self.HandCardSortAndJing)
|
||||||
handCardList:SetVirtual()
|
handCardList:SetVirtual()
|
||||||
handCardList.itemRenderer = function(index, obj)
|
handCardList.itemRenderer = function(index, obj)
|
||||||
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(),
|
obj.icon = string.format("ui://Main_Majiang/%s202_%d", self:GetPrefix(),
|
||||||
|
|
@ -286,6 +286,36 @@ function M:fillHead(url, view)
|
||||||
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
ImageLoad.Load(url, view:GetChild("Btn_Head")._iconObject)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local prefix
|
local prefix
|
||||||
function M:GetPrefix()
|
function M:GetPrefix()
|
||||||
-- if not prefix then
|
-- if not prefix then
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,10 @@ function M:SendOutCard(card, callback)
|
||||||
local p = _room.self_player
|
local p = _room.self_player
|
||||||
_room.curren_outcard_seat = -1
|
_room.curren_outcard_seat = -1
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
|
|
||||||
|
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
p.outcard_list[#p.outcard_list + 1] = card
|
p.outcard_list[#p.outcard_list + 1] = card
|
||||||
|
|
@ -158,7 +161,8 @@ function M:OnEventSendCards(evt_data)
|
||||||
end
|
end
|
||||||
p.card_list = handcards
|
p.card_list = handcards
|
||||||
self._room.self_player.hand_left_count = #handcards
|
self._room.self_player.hand_left_count = #handcards
|
||||||
table.sort(handcards, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(handcards, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
DispatchEvent(self._dispatcher, TX_GameEvent.SendCards, p)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
@ -176,7 +180,8 @@ function M:OnEventOutCard(evt_data)
|
||||||
else
|
else
|
||||||
if seat == _room.self_player.seat then
|
if seat == _room.self_player.seat then
|
||||||
list_remove(p.card_list, card)
|
list_remove(p.card_list, card)
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
|
||||||
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
end
|
end
|
||||||
p.hand_left_count = p.hand_left_count - 1
|
p.hand_left_count = p.hand_left_count - 1
|
||||||
if not p.outcard_list then p.outcard_list = {} end
|
if not p.outcard_list then p.outcard_list = {} end
|
||||||
|
|
@ -196,7 +201,8 @@ function M:OnEventTakeCard(evt_data)
|
||||||
p.hand_left_count = p.hand_left_count + 1
|
p.hand_left_count = p.hand_left_count + 1
|
||||||
if (seat == _room.self_player.seat) then
|
if (seat == _room.self_player.seat) then
|
||||||
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
_room.self_player.card_list[#_room.self_player.card_list + 1] = card
|
||||||
-- table.sort( _room.self_player.card_list, ViewUtil.HandCardSort )
|
|
||||||
|
-- table.sort( _room.self_player.card_list, self.HandCardSortAndJing )
|
||||||
end
|
end
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
DispatchEvent(self._dispatcher, TX_GameEvent.GetCard, seat, card, left_count)
|
||||||
end)
|
end)
|
||||||
|
|
@ -312,7 +318,7 @@ function M:OnEventHu(evt_data)
|
||||||
|
|
||||||
self._cacheEvent:Enqueue(function()
|
self._cacheEvent:Enqueue(function()
|
||||||
win_p.card_list = cards
|
win_p.card_list = cards
|
||||||
table.sort(win_p.card_list, ViewUtil.HandCardSort)
|
table.sort(win_p.card_list, self.HandCardSortAndJing)
|
||||||
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
DispatchEvent(self._dispatcher, TX_GameEvent.ZPHuCard, evt_data["seat"], evt_data["from_seat"], win_card, cards,
|
||||||
win_list)
|
win_list)
|
||||||
end)
|
end)
|
||||||
|
|
@ -414,4 +420,34 @@ function M:Discard(card)
|
||||||
_client:send(Protocol.Game_Da, _data)
|
_client:send(Protocol.Game_Da, _data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -268,6 +268,7 @@ function M:EventInit()
|
||||||
|
|
||||||
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
_gamectr:AddEventListener(TX_GameEvent.SendCards, function(...)
|
||||||
-- self:ShowHuTip()
|
-- self:ShowHuTip()
|
||||||
|
self._viewText_testName.text = 0
|
||||||
self:UpdateRound()
|
self:UpdateRound()
|
||||||
self._state.selectedIndex = 1
|
self._state.selectedIndex = 1
|
||||||
self:ShowJing()
|
self:ShowJing()
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ function M.new()
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:InitView(url)
|
function M:InitView(url)
|
||||||
local room = self._room
|
local room = self._room
|
||||||
UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng")
|
UIPackage.AddPackage("extend/majiang/nancheng/ui/Extend_MJ_NanCheng")
|
||||||
|
|
@ -60,7 +59,7 @@ function M:FillRoomData(data)
|
||||||
local p = room.player_list[i]
|
local p = room.player_list[i]
|
||||||
local card_info = _player_card_info[self:GetPos(p.seat)]
|
local card_info = _player_card_info[self:GetPos(p.seat)]
|
||||||
card_info:Clear()
|
card_info:Clear()
|
||||||
table.sort(p.card_list, ViewUtil.HandCardSort)
|
table.sort(p.card_list, self.HandCardSortAndJing)
|
||||||
card_info:UpdateHandCard(false, true)
|
card_info:UpdateHandCard(false, true)
|
||||||
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
self._player_info[i]._view:GetController("piao_niao").selectedIndex = 0
|
||||||
end
|
end
|
||||||
|
|
@ -207,7 +206,7 @@ function M:CmdOutCard(cmd, index)
|
||||||
data.last_out_seat = cmd.seat
|
data.last_out_seat = cmd.seat
|
||||||
local u = data.player_card_data[cmd.seat]
|
local u = data.player_card_data[cmd.seat]
|
||||||
list_remove(u.card_list, cmd.data.card)
|
list_remove(u.card_list, cmd.data.card)
|
||||||
table.sort(u.card_list, ViewUtil.HandCardSort)
|
table.sort(u.card_list, self.HandCardSortAndJing)
|
||||||
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -295,4 +294,34 @@ function M:UpdateStep(step)
|
||||||
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
self._record:GetChild("tex_step").text = "第 " .. step .. " / " .. #self._step .. "步"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.HandCardSortAndJing(a, b)
|
||||||
|
local jing = DataManager.CurrenRoom.jing
|
||||||
|
if a == jing or b == jing then
|
||||||
|
if a == b then
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
return a == jing
|
||||||
|
else
|
||||||
|
if a < 200 then
|
||||||
|
a = a + 1000
|
||||||
|
elseif a < 300 then
|
||||||
|
a = a + 3000
|
||||||
|
elseif a < 400 then
|
||||||
|
a = a + 2000
|
||||||
|
else
|
||||||
|
a = a + 4000
|
||||||
|
end
|
||||||
|
if b < 200 then
|
||||||
|
b = b + 1000
|
||||||
|
elseif b < 300 then
|
||||||
|
b = b + 3000
|
||||||
|
elseif b < 400 then
|
||||||
|
b = b + 2000
|
||||||
|
else
|
||||||
|
b = b + 4000
|
||||||
|
end
|
||||||
|
return a < b
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
@ -20,6 +20,7 @@ local CardType = {
|
||||||
one = 1,
|
one = 1,
|
||||||
long = 2,
|
long = 2,
|
||||||
dui = 3,
|
dui = 3,
|
||||||
|
duiLong = 10,
|
||||||
threeAndTwo = 4,
|
threeAndTwo = 4,
|
||||||
normolPlant = 5,
|
normolPlant = 5,
|
||||||
zha = 6,
|
zha = 6,
|
||||||
|
|
@ -44,20 +45,22 @@ function M:InitFlag()
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitLastCard(cardList)
|
function M:InitLastCard(cardList, mustPutMaxCard)
|
||||||
self._flag_fristCard = false
|
self._flag_fristCard = false
|
||||||
|
self:Clear()
|
||||||
|
self._flag_mustMax = mustPutMaxCard
|
||||||
|
self.type = 0
|
||||||
|
self.lastCardNum = #cardList
|
||||||
|
self._flag_allCards = false
|
||||||
|
self._flag_checkLst = true
|
||||||
if #cardList == 0 then
|
if #cardList == 0 then
|
||||||
self._flag_fristCard = true
|
self._flag_fristCard = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
self.lastCardNum = #cardList
|
|
||||||
table.sort(cardList)
|
table.sort(cardList)
|
||||||
pt(cardList)
|
pt(cardList)
|
||||||
self.lastMinCard = math.floor(cardList[1] / 10)
|
self.lastMinCard = math.floor(cardList[1] / 10)
|
||||||
local temp_long = 0
|
local temp_long = 0
|
||||||
self:Clear()
|
|
||||||
self._flag_allCards = false
|
|
||||||
self._flag_checkLst = true
|
|
||||||
for i = 1, #cardList do
|
for i = 1, #cardList do
|
||||||
local number = math.floor(cardList[i] / 10)
|
local number = math.floor(cardList[i] / 10)
|
||||||
if self.cardList[number] then
|
if self.cardList[number] then
|
||||||
|
|
@ -77,7 +80,6 @@ function M:InitLastCard(cardList)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self.long = temp_long == self.cardNum and self.cardNum >= 5
|
self.long = temp_long == self.cardNum and self.cardNum >= 5
|
||||||
self.type = -1
|
|
||||||
print("lingmengCheckAloneOrLong2")
|
print("lingmengCheckAloneOrLong2")
|
||||||
if self:CheckAloneOrLong() then
|
if self:CheckAloneOrLong() then
|
||||||
self.type = self:CheckAloneOrLong()
|
self.type = self:CheckAloneOrLong()
|
||||||
|
|
@ -100,7 +102,7 @@ function M:InitLastCard(cardList)
|
||||||
self.type = self:CheckZha()
|
self.type = self:CheckZha()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self.type == -1 then
|
if self.type == 0 then
|
||||||
ViewUtil.ErrorTip(-1, "上一份牌型判断错误")
|
ViewUtil.ErrorTip(-1, "上一份牌型判断错误")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -160,6 +162,13 @@ function M:CheckCards()
|
||||||
if self.cardNum ~= 4 and self.cardNum ~= self.lastCardNum and not self._flag_fristCard then
|
if self.cardNum ~= 4 and self.cardNum ~= self.lastCardNum and not self._flag_fristCard then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
local flag_mustZha = self.cardNum == 4 and self.lastCardNum ~= 4
|
||||||
|
if self.cardNum == 1 and self._flag_mustMax and self.maxCard ~= self.cardListSord[1] then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if self.cardNum == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
print("lingmengCheckAloneOrLong")
|
print("lingmengCheckAloneOrLong")
|
||||||
if self:CheckAloneOrLong() then
|
if self:CheckAloneOrLong() then
|
||||||
|
|
@ -168,7 +177,7 @@ function M:CheckCards()
|
||||||
print("lingmengCheckDuiZi")
|
print("lingmengCheckDuiZi")
|
||||||
|
|
||||||
if self:CheckDuiZi() then
|
if self:CheckDuiZi() then
|
||||||
return true
|
return true and not flag_mustZha
|
||||||
end
|
end
|
||||||
print("lingmengCheckSanDai")
|
print("lingmengCheckSanDai")
|
||||||
|
|
||||||
|
|
@ -185,18 +194,19 @@ function M:CheckCards()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:CheckOutCard(cardList)
|
function M:CheckOutCard(cardList)
|
||||||
|
print("lingmengCheckOutCard===============")
|
||||||
|
pt(cardList)
|
||||||
self.tipCardList = {}
|
self.tipCardList = {}
|
||||||
self.touchCardSet = {}
|
self.touchCardSet = {}
|
||||||
self.touchCardMao = {}
|
self.touchCardMao = {}
|
||||||
|
|
||||||
local cardMap = {}
|
local cardMap = {}
|
||||||
local cardSet = {}
|
local cardSet = {}
|
||||||
local cardType,only,longLength = self:CheckOutCardGetType()
|
local temp_long = 0
|
||||||
|
local temp_longList = {}
|
||||||
if cardType == 0 then
|
local longList = {}
|
||||||
return
|
local lastCard = -1
|
||||||
end
|
|
||||||
|
|
||||||
|
local flag_threeOrFour = false
|
||||||
for i = 1, #cardList do
|
for i = 1, #cardList do
|
||||||
local number = math.floor(cardList[i].card_code_number / 10)
|
local number = math.floor(cardList[i].card_code_number / 10)
|
||||||
if cardMap[number] then
|
if cardMap[number] then
|
||||||
|
|
@ -209,25 +219,134 @@ function M:CheckOutCard(cardList)
|
||||||
table.insert(cardMap[number].cardList, cardList[i])
|
table.insert(cardMap[number].cardList, cardList[i])
|
||||||
table.insert(cardSet, number)
|
table.insert(cardSet, number)
|
||||||
end
|
end
|
||||||
|
if cardMap[number].value >= 3 then
|
||||||
|
flag_threeOrFour = true
|
||||||
|
end
|
||||||
|
if lastCard ~= number then
|
||||||
|
if lastCard - number ~= 1 then
|
||||||
|
if temp_long >= 5 then
|
||||||
|
table.insert(longList, temp_longList)
|
||||||
|
end
|
||||||
|
temp_long = 1
|
||||||
|
temp_longList = {}
|
||||||
|
else
|
||||||
|
temp_long = temp_long + 1
|
||||||
|
end
|
||||||
|
lastCard = number
|
||||||
|
table.insert(temp_longList, number)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if temp_long >= 4 then
|
||||||
|
table.insert(longList, temp_longList)
|
||||||
end
|
end
|
||||||
|
|
||||||
table.sort(cardSet)
|
table.sort(cardSet)
|
||||||
|
self.maxCard = cardSet[#cardSet]
|
||||||
|
|
||||||
|
if self._flag_fristCard then
|
||||||
|
if self._flag_mustMax then
|
||||||
|
self:CheckOutCardGetMustMax(cardSet, cardMap, flag_threeOrFour, longList)
|
||||||
|
else
|
||||||
|
self:CheckOutCardGetFristTipList(cardSet, cardMap)
|
||||||
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local cardType, only, longLength = self:CheckOutCardGetType()
|
||||||
|
|
||||||
|
|
||||||
local tipCardSet = self:CheckOutCardGetTouchSet(cardSet, cardMap, cardType, longLength)
|
local tipCardSet = self:CheckOutCardGetTouchSet(cardSet, cardMap, cardType, longLength)
|
||||||
|
|
||||||
self:CheckOutCardSetTipList(tipCardSet, longLength, cardMap, cardType)
|
self:CheckOutCardSetTipList(tipCardSet, longLength, cardMap, cardType)
|
||||||
|
|
||||||
|
if cardType >= 3 and only == 0 then
|
||||||
|
self:CheckOutCardGetAllCardSetAndMap()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckOutCardGetAllCardSetAndMap()
|
||||||
|
self.touchCardSet = {}
|
||||||
|
self.touchCardMao = {}
|
||||||
|
for i = 3, 15 do
|
||||||
|
table.insert(self.touchCardSet, i)
|
||||||
|
self.touchCardMao[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckOutCardGetFristTipList(cardSet, cardMap)
|
||||||
|
for i = 1, #cardSet do
|
||||||
|
local card = cardSet[i]
|
||||||
|
table.insert(self.touchCardSet, card)
|
||||||
|
self.touchCardMao[card] = 1
|
||||||
|
local temp = {}
|
||||||
|
table.insert(temp, cardMap[card].cardList[1])
|
||||||
|
table.insert(self.tipCardList, temp)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:CheckOutCardGetMustMax(cardSet, cardMap, flag_threeOrFour, longList)
|
||||||
|
if flag_threeOrFour then
|
||||||
|
for i = 3, 15 do
|
||||||
|
if cardMap[i] then
|
||||||
|
if i == cardSet[#cardSet] then
|
||||||
|
table.insert(self.touchCardSet, i)
|
||||||
|
self.touchCardMao[i] = 1
|
||||||
|
table.insert(self.tipCardList, cardMap[i].cardList)
|
||||||
|
elseif cardMap[i].value >= 2 then
|
||||||
|
table.insert(self.touchCardSet, i)
|
||||||
|
self.touchCardMao[i] = 1
|
||||||
|
table.insert(self.tipCardList, cardMap[i].cardList)
|
||||||
|
else
|
||||||
|
table.insert(self.touchCardSet, i)
|
||||||
|
self.touchCardMao[i] = 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
table.insert(self.touchCardSet, i)
|
||||||
|
self.touchCardMao[i] = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for i = 1, #cardSet do
|
||||||
|
local card = cardSet[i]
|
||||||
|
if i == #cardSet then
|
||||||
|
table.insert(self.touchCardSet, card)
|
||||||
|
self.touchCardMao[card] = 1
|
||||||
|
table.insert(self.tipCardList, cardMap[card].cardList)
|
||||||
|
elseif cardMap[card].value >= 2 then
|
||||||
|
table.insert(self.touchCardSet, card)
|
||||||
|
self.touchCardMao[card] = 1
|
||||||
|
table.insert(self.tipCardList, cardMap[card].cardList)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
---单数顺另外添加到提示和现实
|
||||||
|
for i = 1, #longList do
|
||||||
|
local tempTipList = {}
|
||||||
|
for j = 1, #longList[i] do
|
||||||
|
local card = longList[i][j]
|
||||||
|
if not self.touchCardMao[card] then
|
||||||
|
table.insert(self.touchCardSet, card)
|
||||||
|
self.touchCardMao[card] = 1
|
||||||
|
end
|
||||||
|
table.insert(tempTipList, cardMap[card].cardList[1])
|
||||||
|
end
|
||||||
|
table.insert(self.tipCardList, tempTipList)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:CheckOutCardGetType()
|
function M:CheckOutCardGetType()
|
||||||
local cardType = 0
|
local cardType = 0
|
||||||
local only = 0
|
local only = 0
|
||||||
local longLength = 1
|
local longLength = 1
|
||||||
|
if self.type == 0 then
|
||||||
|
return cardType, only, longLength
|
||||||
|
end
|
||||||
if self.type == CardType.one or self.type == CardType.long then
|
if self.type == CardType.one or self.type == CardType.long then
|
||||||
cardType = 1
|
cardType = 1
|
||||||
if self.type == CardType.long then
|
if self.type == CardType.long then
|
||||||
longLength = self.lastCardNum
|
longLength = self.lastCardNum
|
||||||
end
|
end
|
||||||
elseif self.type == CardType.dui then
|
elseif self.type == CardType.dui or self.type == CardType.duiLong then
|
||||||
cardType = 2
|
cardType = 2
|
||||||
if self.lastCardNum > 2 then
|
if self.lastCardNum > 2 then
|
||||||
longLength = self.lastCardNum / 2
|
longLength = self.lastCardNum / 2
|
||||||
|
|
@ -262,7 +381,7 @@ function M:CheckOutCardGetTouchSet(cardSet,cardMap,cardType,longLength)
|
||||||
local tipCardSet = {}
|
local tipCardSet = {}
|
||||||
for i = 1, #cardSet do
|
for i = 1, #cardSet do
|
||||||
local card = cardSet[i]
|
local card = cardSet[i]
|
||||||
if (cardMap[card].value >= cardType or cardMap[card].value == 4) and card > self.lastMinCard then
|
if cardMap[card].value >= cardType and card > self.lastMinCard then
|
||||||
if tempLong == 0 then
|
if tempLong == 0 then
|
||||||
tempLong = 1
|
tempLong = 1
|
||||||
else
|
else
|
||||||
|
|
@ -283,6 +402,11 @@ function M:CheckOutCardGetTouchSet(cardSet,cardMap,cardType,longLength)
|
||||||
table.insert(tempCardSet, card)
|
table.insert(tempCardSet, card)
|
||||||
lastCard = card
|
lastCard = card
|
||||||
end
|
end
|
||||||
|
if cardMap[card].value == 4 then
|
||||||
|
table.insert(self.touchCardSet, card)
|
||||||
|
self.touchCardMao[card] = 1
|
||||||
|
table.insert(tipCardSet, card)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if tempLong >= longLength then
|
if tempLong >= longLength then
|
||||||
for j = 1, tempLong do
|
for j = 1, tempLong do
|
||||||
|
|
@ -298,6 +422,9 @@ function M:CheckOutCardSetTipList(tipCardSet,longLength,cardMap,cardType)
|
||||||
print("lingmengCheckOutCardSetTipList", longLength, cardMap, cardType)
|
print("lingmengCheckOutCardSetTipList", longLength, cardMap, cardType)
|
||||||
pt(tipCardSet)
|
pt(tipCardSet)
|
||||||
for i = 1, #tipCardSet do
|
for i = 1, #tipCardSet do
|
||||||
|
if type(tipCardSet[i]) == 'number' then
|
||||||
|
table.insert(self.tipCardList, cardMap[tipCardSet[i]].cardList)
|
||||||
|
else
|
||||||
local tipCardSetLen = #tipCardSet[i]
|
local tipCardSetLen = #tipCardSet[i]
|
||||||
if tipCardSetLen == longLength then
|
if tipCardSetLen == longLength then
|
||||||
local tempList = {}
|
local tempList = {}
|
||||||
|
|
@ -311,9 +438,9 @@ function M:CheckOutCardSetTipList(tipCardSet,longLength,cardMap,cardType)
|
||||||
table.insert(self.tipCardList, tempList)
|
table.insert(self.tipCardList, tempList)
|
||||||
else
|
else
|
||||||
for j = 1, tipCardSetLen do
|
for j = 1, tipCardSetLen do
|
||||||
if j + longLength <= tipCardSetLen then
|
if j + longLength - 1 <= tipCardSetLen then
|
||||||
local tempList = {}
|
local tempList = {}
|
||||||
for k = j,j + longLength do
|
for k = j, j + longLength - 1 do
|
||||||
local card = tipCardSet[i][k]
|
local card = tipCardSet[i][k]
|
||||||
local minNum = Mathf.Min(cardMap[card].value, cardType)
|
local minNum = Mathf.Min(cardMap[card].value, cardType)
|
||||||
for l = 1, minNum do
|
for l = 1, minNum do
|
||||||
|
|
@ -326,6 +453,7 @@ function M:CheckOutCardSetTipList(tipCardSet,longLength,cardMap,cardType)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M:CheckAloneOrLong()
|
function M:CheckAloneOrLong()
|
||||||
if self.cardNum == 1 and M:CheckType(CardType.one) then
|
if self.cardNum == 1 and M:CheckType(CardType.one) then
|
||||||
|
|
@ -340,7 +468,7 @@ function M:CheckDuiZi()
|
||||||
if self.cardNum == 2 and self.cardSize == 1 and M:CheckType(CardType.dui) then
|
if self.cardNum == 2 and self.cardSize == 1 and M:CheckType(CardType.dui) then
|
||||||
return CardType.dui
|
return CardType.dui
|
||||||
end
|
end
|
||||||
if self.cardNum % 2 == 0 and M:CheckType(CardType.dui) then
|
if self.cardNum % 2 == 0 and M:CheckType(CardType.duiLong) then
|
||||||
local last_k
|
local last_k
|
||||||
for i = 1, self.cardSize do
|
for i = 1, self.cardSize do
|
||||||
local k = self.cardListSord[i]
|
local k = self.cardListSord[i]
|
||||||
|
|
@ -358,7 +486,7 @@ function M:CheckDuiZi()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return CardType.dui
|
return CardType.duiLong
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -478,12 +606,12 @@ function M:CheckZha()
|
||||||
local k = self.cardListSord[i]
|
local k = self.cardListSord[i]
|
||||||
local v = self.cardList[k]
|
local v = self.cardList[k]
|
||||||
if v == 4 then
|
if v == 4 then
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return CardType.zhaAndThreee
|
return CardType.zhaAndThreee
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function M:CheckType(type)
|
function M:CheckType(type)
|
||||||
return self._flag_checkLst or self._flag_fristCard or type == self.type
|
return self._flag_checkLst or self._flag_fristCard or type == self.type
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,8 @@ function M:FillPoker(poker, prefix, num, code)
|
||||||
if num ~= nil then
|
if num ~= nil then
|
||||||
code = self:ChangeCodeByTo(num)
|
code = self:ChangeCodeByTo(num)
|
||||||
end
|
end
|
||||||
local suffix = code == 310 and (DataManager.CurrenRoom.pai == 0 and "_1" or "_2") or ""
|
local suffix = code == 310 and
|
||||||
|
(DataManager.CurrenRoom.pai == 0 and (DataManager.CurrenRoom.room_config.Heart10 == 2 and "_1" or "") or "_2") or ""
|
||||||
code = code == 1 and "00" or code
|
code = code == 1 and "00" or code
|
||||||
if not poker.icon then
|
if not poker.icon then
|
||||||
poker:GetChild('icon').url = string.format("ui://Extend_Poker_RunFastNew/%s%s%s", prefix, code, suffix)
|
poker:GetChild('icon').url = string.format("ui://Extend_Poker_RunFastNew/%s%s%s", prefix, code, suffix)
|
||||||
|
|
|
||||||
|
|
@ -779,7 +779,7 @@ function M:HidePiao()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ShowOutCardOption2(lastCardList,ctr_select,mustPutMaxCard)
|
function M:ShowOutCardOption2(lastCardList,ctr_select,mustPutMaxCard)
|
||||||
self._cardCheck:InitLastCard(lastCardList)
|
self._cardCheck:InitLastCard(lastCardList,mustPutMaxCard)
|
||||||
self._cardCheck:CheckOutCard(self.card_list)
|
self._cardCheck:CheckOutCard(self.card_list)
|
||||||
self.tips_card_list = self._cardCheck:GetTipsList()
|
self.tips_card_list = self._cardCheck:GetTipsList()
|
||||||
self.touchCardSet = self._cardCheck:GetTouchSet()
|
self.touchCardSet = self._cardCheck:GetTouchSet()
|
||||||
|
|
@ -788,10 +788,8 @@ function M:ShowOutCardOption2(lastCardList,ctr_select,mustPutMaxCard)
|
||||||
print("lingmengShowOutCardOption2",#self.touchCardSet )
|
print("lingmengShowOutCardOption2",#self.touchCardSet )
|
||||||
pt( self.touchCardSet )
|
pt( self.touchCardSet )
|
||||||
pt(self.touchCardMap)
|
pt(self.touchCardMap)
|
||||||
if #self.touchCardSet >= 1 then
|
|
||||||
-- body --在这个方法里添加判断抬起牌是否符合出牌类型(少跑一次手牌循环)
|
-- body --在这个方法里添加判断抬起牌是否符合出牌类型(少跑一次手牌循环)
|
||||||
self:UpdateHandCardsColor()
|
self:UpdateHandCardsColor()
|
||||||
end
|
|
||||||
|
|
||||||
if #self.tips_card_list == 1 then
|
if #self.tips_card_list == 1 then
|
||||||
self:ShowTipsCard(1)
|
self:ShowTipsCard(1)
|
||||||
|
|
@ -1076,7 +1074,7 @@ function M:UpdateHandCardsColor()
|
||||||
local send_card = {}
|
local send_card = {}
|
||||||
for i = 1, #self.card_list do
|
for i = 1, #self.card_list do
|
||||||
local card_view = self.card_list[i]
|
local card_view = self.card_list[i]
|
||||||
if self.touchCardMap[math.floor(card_view.card_code_number / 10)] then
|
if self.touchCardMap[math.floor(card_view.card_code_number / 10)] or #self.touchCardSet == 0 then
|
||||||
card_view.btn_card.touchable = true
|
card_view.btn_card.touchable = true
|
||||||
self:SetBtnCardColor(card_view, 0)
|
self:SetBtnCardColor(card_view, 0)
|
||||||
else
|
else
|
||||||
|
|
@ -1188,7 +1186,7 @@ function M:ShowTipsCard(index)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
pt(item)
|
pt(item)
|
||||||
self._cardCheck:InitFlag(item)
|
self._cardCheck:initCards(item)
|
||||||
self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0
|
self._ctr_canSendCard.selectedIndex = self._cardCheck:CheckCards() and 1 or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,7 @@ end
|
||||||
function M:Clear()
|
function M:Clear()
|
||||||
MJPlayerCardInfoView.Clear(self)
|
MJPlayerCardInfoView.Clear(self)
|
||||||
|
|
||||||
self._view_FZTips:RemoveChildren(0, -1, true)
|
-- self._view_FZTips:RemoveChildren(0, -1, true)
|
||||||
|
|
||||||
self._ctr_seletedGet.selectedIndex = 1
|
self._ctr_seletedGet.selectedIndex = 1
|
||||||
self._ctr_tip.selectedIndex = 0
|
self._ctr_tip.selectedIndex = 0
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue