提交6.20
parent
f976b9db20
commit
d7daa0c666
|
|
@ -31,13 +31,13 @@ function M.new()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:getCardItem(card_1, card_2)
|
function M:getCardItem(card_1, card_2)
|
||||||
|
|
||||||
if self._room.change_card_display ~= nil then
|
if self._room.change_card_display ~= nil then
|
||||||
return card_1 .. self._room.change_card_display .. card_2
|
return card_1 .. self._room.change_card_display .. card_2
|
||||||
else
|
else
|
||||||
return card_1 .. '6_' .. card_2
|
return card_1 .. '6_' .. card_2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:InitView(url)
|
function M:InitView(url)
|
||||||
local _room = self._room
|
local _room = self._room
|
||||||
self.Fix_Msg_Chat = Fix_Msg_Chat
|
self.Fix_Msg_Chat = Fix_Msg_Chat
|
||||||
|
|
@ -153,12 +153,14 @@ function M:NewPlayerCardInfoView(view, index)
|
||||||
end
|
end
|
||||||
return PlayerCardInfoView.new(view, self)
|
return PlayerCardInfoView.new(view, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:closeTipOnTuoguan()
|
function M:closeTipOnTuoguan()
|
||||||
if self._clearingView ~= nil then
|
if self._clearingView ~= nil then
|
||||||
self._clearingView:Close()
|
self._clearingView:Close()
|
||||||
end
|
end
|
||||||
self:__CloseTip()
|
self:__CloseTip()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:EventInit()
|
function M:EventInit()
|
||||||
MainView.EventInit(self)
|
MainView.EventInit(self)
|
||||||
local _room = self._room
|
local _room = self._room
|
||||||
|
|
@ -172,12 +174,10 @@ function M:EventInit()
|
||||||
self._popEvent = false
|
self._popEvent = false
|
||||||
self._player_card_info[1]:HideDaNiao(0)
|
self._player_card_info[1]:HideDaNiao(0)
|
||||||
if (currentPlayer1) then
|
if (currentPlayer1) then
|
||||||
|
|
||||||
local xipaiCB = function()
|
local xipaiCB = function()
|
||||||
self._popEvent = true
|
self._popEvent = true
|
||||||
end
|
end
|
||||||
self:PlayXiPai(xipaiCB)
|
self:PlayXiPai(xipaiCB)
|
||||||
|
|
||||||
end
|
end
|
||||||
if (currentPlayer2) then
|
if (currentPlayer2) then
|
||||||
local xipaiCB2 = function()
|
local xipaiCB2 = function()
|
||||||
|
|
@ -216,7 +216,6 @@ function M:EventInit()
|
||||||
info:Ready(false)
|
info:Ready(false)
|
||||||
--info:UpdatePiao(-1)
|
--info:UpdatePiao(-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
self._player_card_info[1]:ShwoDaNiao(niao)
|
self._player_card_info[1]:ShwoDaNiao(niao)
|
||||||
end)
|
end)
|
||||||
|
|
@ -231,7 +230,6 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
local head_info = self._player_info[self:GetPos(seat)]
|
local head_info = self._player_info[self:GetPos(seat)]
|
||||||
head_info:UpdateNiao(niao)
|
head_info:UpdateNiao(niao)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -405,7 +403,6 @@ function M:EventInit()
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
fangwei_msg:Show()
|
fangwei_msg:Show()
|
||||||
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -428,7 +425,6 @@ function M:EventInit()
|
||||||
info:UpdateIsOnClick(true)
|
info:UpdateIsOnClick(true)
|
||||||
info:SendChangeCard()
|
info:SendChangeCard()
|
||||||
info:ChuPaiTiShi()
|
info:ChuPaiTiShi()
|
||||||
|
|
||||||
end
|
end
|
||||||
local list = _room.player_list
|
local list = _room.player_list
|
||||||
for i = 1, #list do
|
for i = 1, #list do
|
||||||
|
|
@ -632,7 +628,6 @@ function M:EventInit()
|
||||||
--禁牌 把手上的牌都禁掉
|
--禁牌 把手上的牌都禁掉
|
||||||
-- local card_info = self._player_card_info[self:GetPos(seat)]
|
-- local card_info = self._player_card_info[self:GetPos(seat)]
|
||||||
-- card_info:banHandCards(self._room.self_player.card_list)
|
-- card_info:banHandCards(self._room.self_player.card_list)
|
||||||
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
@ -683,7 +678,6 @@ function M:__FangziTip(tip, _uid,fptype)
|
||||||
if td.type == 6 and td.weight == 8 then
|
if td.type == 6 and td.weight == 8 then
|
||||||
fpao = false
|
fpao = false
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if fpao and zdhu then
|
if fpao and zdhu then
|
||||||
|
|
@ -738,6 +732,7 @@ function M:__FangziTip(tip, _uid,fptype)
|
||||||
_chipeng_tip.y = _chipeng_tip.y - 50
|
_chipeng_tip.y = _chipeng_tip.y - 50
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:__TipAction(context)
|
function M:__TipAction(context)
|
||||||
local data = context.sender.data
|
local data = context.sender.data
|
||||||
local _gamectr = self._gamectr
|
local _gamectr = self._gamectr
|
||||||
|
|
@ -1054,7 +1049,6 @@ function M:OnFangziAction(...)
|
||||||
effect:Dispose()
|
effect:Dispose()
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
end
|
end
|
||||||
if (player == self._room.self_player) then
|
if (player == self._room.self_player) then
|
||||||
coroutine.start(
|
coroutine.start(
|
||||||
|
|
@ -1127,7 +1121,6 @@ function M:ReloadRoom()
|
||||||
info._view:GetController('zhanji').selectedIndex = 1
|
info._view:GetController('zhanji').selectedIndex = 1
|
||||||
info._view:GetChild('tex_jifen').text = p.total_score -- d2ad(p.total_hp)
|
info._view:GetChild('tex_jifen').text = p.total_score -- d2ad(p.total_hp)
|
||||||
info._view:GetChild('tex_jifen_text').text = "总胡息"
|
info._view:GetChild('tex_jifen_text').text = "总胡息"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local card_info = self._player_card_info[self:GetPos(p.seat)]
|
local card_info = self._player_card_info[self:GetPos(p.seat)]
|
||||||
|
|
|
||||||
|
|
@ -146,8 +146,6 @@ function M:FillRoomData(data)
|
||||||
self:UpdateStep(1)
|
self:UpdateStep(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function M:ShowStep(index)
|
function M:ShowStep(index)
|
||||||
local step = self._step[index + 1]
|
local step = self._step[index + 1]
|
||||||
self:UpdateStep(index + 1)
|
self:UpdateStep(index + 1)
|
||||||
|
|
@ -165,7 +163,8 @@ function M:ShowStep(index)
|
||||||
self._lit_fanzi = _chipeng_tip:GetChild('lit_fanzi')
|
self._lit_fanzi = _chipeng_tip:GetChild('lit_fanzi')
|
||||||
self._lit_fanzi:RemoveChildrenToPool()
|
self._lit_fanzi:RemoveChildrenToPool()
|
||||||
|
|
||||||
|
printlog("lingmeng ShowStep", self._step[index + 1].cmd)
|
||||||
|
pt(self._step[index + 1])
|
||||||
for i = 1, #step.player_card_data do
|
for i = 1, #step.player_card_data do
|
||||||
local p = self._room:GetPlayerBySeat(i)
|
local p = self._room:GetPlayerBySeat(i)
|
||||||
local info = self._player_card_info[self:GetPos(i)]
|
local info = self._player_card_info[self:GetPos(i)]
|
||||||
|
|
@ -208,7 +207,6 @@ function M:ShowStep(index)
|
||||||
if tonumber(index + 1) > tonumber(k) then
|
if tonumber(index + 1) > tonumber(k) then
|
||||||
list_remove(p.card_list, v)
|
list_remove(p.card_list, v)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -221,22 +219,23 @@ function M:ShowStep(index)
|
||||||
info:InitHandCard(false)
|
info:InitHandCard(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
if step.cmd == Record_Event.Evt_ChangePaiXing then
|
-- if step.cmd == Record_Event.Evt_ChangePaiXing then
|
||||||
local _card_list = {}
|
-- local _card_list = {}
|
||||||
for i = 1, #step.card_list do
|
-- for i = 1, #step.card_list do
|
||||||
local data = {}
|
-- local data = {}
|
||||||
data.card_item = step.card_list[i].card
|
-- data.card_item = step.card_list[i].card
|
||||||
data.index_X = step.card_list[i].X
|
-- data.index_X = step.card_list[i].X
|
||||||
data.index_Y = step.card_list[i].Y
|
-- data.index_Y = step.card_list[i].Y
|
||||||
_card_list[#_card_list + 1] = data
|
-- _card_list[#_card_list + 1] = data
|
||||||
end
|
-- end
|
||||||
local info = self._player_card_info[self:GetPos(step.seat)]
|
-- local info = self._player_card_info[self:GetPos(step.seat)]
|
||||||
if step.card_list[1].card ~= nil then
|
-- if step.card_list[1].card ~= nil then
|
||||||
info:UpdateHandCards(_card_list)
|
-- info:UpdateHandCards(_card_list)
|
||||||
else
|
-- -- info:InitHandCard(_card_list)
|
||||||
info:UpdateHandCards(step.card_list)
|
-- else
|
||||||
end
|
-- info:UpdateHandCards(step.card_list)
|
||||||
end
|
-- end
|
||||||
|
-- end
|
||||||
--end
|
--end
|
||||||
|
|
||||||
if step.cmd == Record_Event.Evt_OutCard or step.cmd == Record_Event.Evt_GetCard then
|
if step.cmd == Record_Event.Evt_OutCard or step.cmd == Record_Event.Evt_GetCard then
|
||||||
|
|
@ -274,15 +273,8 @@ function M:ShowStep(index)
|
||||||
_chipeng_tip:Center()
|
_chipeng_tip:Center()
|
||||||
self._chipeng_tip.x = self._chipeng_tip.x + 200
|
self._chipeng_tip.x = self._chipeng_tip.x + 200
|
||||||
self._chipeng_tip.y = self._chipeng_tip.y - 50
|
self._chipeng_tip.y = self._chipeng_tip.y - 50
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -327,10 +319,16 @@ function M:ShowStep(index)
|
||||||
if data[i]['hp_info'] then
|
if data[i]['hp_info'] then
|
||||||
p.total_score = d2ad(data[i].hp_info.cur_hp)
|
p.total_score = d2ad(data[i].hp_info.cur_hp)
|
||||||
local stotal_hp = data[i].hp_info.total_hp
|
local stotal_hp = data[i].hp_info.total_hp
|
||||||
|
local total_score = data[i].total_score
|
||||||
info._view:GetController('zhanji').selectedIndex = 0
|
info._view:GetController('zhanji').selectedIndex = 0
|
||||||
if _room.hpOnOff == 1 or _room:checkHpNonnegative() then
|
if _room.hpOnOff == 1 or _room:checkHpNonnegative() then
|
||||||
|
info._view:GetController('huxi').selectedIndex = 1
|
||||||
|
info._view:GetChild('huxi').text = d2ad(stotal_hp)
|
||||||
|
|
||||||
|
|
||||||
info._view:GetController('zhanji').selectedIndex = 1
|
info._view:GetController('zhanji').selectedIndex = 1
|
||||||
info._view:GetChild('tex_jifen').text = d2ad(stotal_hp)
|
|
||||||
|
info._view:GetChild('tex_jifen').text = total_score
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
info:UpdateScore(p.total_score)
|
info:UpdateScore(p.total_score)
|
||||||
|
|
@ -368,6 +366,7 @@ function M:GenerateAllStepData(data)
|
||||||
u.fz_list = {}
|
u.fz_list = {}
|
||||||
u.outcard_list = {}
|
u.outcard_list = {}
|
||||||
u.hu_xi = 0
|
u.hu_xi = 0
|
||||||
|
u.total_score = p.total_score
|
||||||
step.player_card_data[u.seat] = u
|
step.player_card_data[u.seat] = u
|
||||||
end
|
end
|
||||||
self._step[#self._step + 1] = step
|
self._step[#self._step + 1] = step
|
||||||
|
|
@ -396,6 +395,7 @@ function M:CmdGetCard(cmd, index)
|
||||||
data.seat = cmd.seat
|
data.seat = cmd.seat
|
||||||
data.DiceCard = cmd.data.card
|
data.DiceCard = cmd.data.card
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:CmdThrowCard(cmd, index)
|
function M:CmdThrowCard(cmd, index)
|
||||||
local data = self:CopyLastStep(index)
|
local data = self:CopyLastStep(index)
|
||||||
data.cmd = cmd.cmd
|
data.cmd = cmd.cmd
|
||||||
|
|
@ -405,6 +405,7 @@ function M:CmdThrowCard(cmd, index)
|
||||||
data.out_card_list = cmd.data.card
|
data.out_card_list = cmd.data.card
|
||||||
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
u.outcard_list[#u.outcard_list + 1] = cmd.data.card
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:CmdAddCard(cmd, index)
|
function M:CmdAddCard(cmd, index)
|
||||||
----printlog("CmdAddCard======>>>",index,cmd.data.card)
|
----printlog("CmdAddCard======>>>",index,cmd.data.card)
|
||||||
local data = self:CopyLastStep(index)
|
local data = self:CopyLastStep(index)
|
||||||
|
|
@ -422,6 +423,7 @@ function M:onResult(cmd, index)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:CmdChangePaiXing(cmd, index)
|
function M:CmdChangePaiXing(cmd, index)
|
||||||
|
printlog("lingmeng CmdChangePaiXing", index)
|
||||||
local data = self:CopyLastStep(index)
|
local data = self:CopyLastStep(index)
|
||||||
data.cmd = cmd.cmd
|
data.cmd = cmd.cmd
|
||||||
data.seat = cmd.seat
|
data.seat = cmd.seat
|
||||||
|
|
@ -713,7 +715,6 @@ function M:OnUpdate()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function M:Destroy()
|
function M:Destroy()
|
||||||
UpdateBeat:Remove(self.OnUpdate, self)
|
UpdateBeat:Remove(self.OnUpdate, self)
|
||||||
PlayBackView.Destroy(self)
|
PlayBackView.Destroy(self)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue