From e6fa8394f9dc75277038d27b7674be46a3d9671f Mon Sep 17 00:00:00 2001 From: xxyheaven <1433191064@qq.com> Date: Sat, 27 Apr 2024 12:04:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=AD=E7=BA=BF?= =?UTF-8?q?=E9=87=8D=E8=BF=9E=E7=9C=8B=E4=B8=8D=E5=88=B0=E7=A7=81=E4=BA=BA?= =?UTF-8?q?=E7=89=8C=E5=A0=86=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B#pile?= =?UTF-8?q?=E4=B8=8Eqml=5Fmark=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/client/client.lua | 11 ++++++++++- lua/server/serverplayer.lua | 7 ++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lua/client/client.lua b/lua/client/client.lua index a62ec47..9ac9903 100644 --- a/lua/client/client.lua +++ b/lua/client/client.lua @@ -126,6 +126,10 @@ function Client:moveCards(moves) if table.contains({ Player.Hand, Player.Equip, Player.Judge, Player.Special }, move.fromArea) then from:removeCards(move.fromArea, move.ids, move.fromSpecialName) end + if move.fromArea == Card.PlayerSpecial and move.fromSpecialName:startsWith("#") and Fk.qml_marks[move.fromSpecialName:sub(2)] then + local cards = self:getPlayerById(move.to):getPile(move.specialName) + ClientInstance:notifyUI("SetPlayerMark", {move.to, "@[" .. move.fromSpecialName:sub(2) .. "]", #cards > 0 and cards or 0}) + end end elseif move.fromArea == Card.DiscardPile then table.removeOne(self.discard_pile, move.ids[1]) @@ -143,6 +147,11 @@ function Client:moveCards(moves) end self:getPlayerById(move.to):addCards(move.toArea, ids, move.specialName) + + if move.toArea == Card.PlayerSpecial and move.specialName:startsWith("#") and Fk.qml_marks[move.specialName:sub(2)] then + ClientInstance:notifyUI("SetPlayerMark", {move.to, "@[" .. move.specialName:sub(2) .. "]", self:getPlayerById(move.to):getPile(move.specialName)}) + end + elseif move.toArea == Card.DiscardPile then table.insert(self.discard_pile, move.ids[1]) end @@ -1150,7 +1159,7 @@ local function loadPlayerSummary(pdata) to = id, toArea = Card.PlayerSpecial, specialName = k, - specialVisible = Self.id == id, + moveVisible = true, } table.insert(card_moves, move) end diff --git a/lua/server/serverplayer.lua b/lua/server/serverplayer.lua index 1d97c70..b6d1e44 100644 --- a/lua/server/serverplayer.lua +++ b/lua/server/serverplayer.lua @@ -604,8 +604,13 @@ end ---@param proposer? integer ---@param visiblePlayers? integer | integer[] function ServerPlayer:addToPile(pile_name, card, visible, skillName, proposer, visiblePlayers) + if type(visiblePlayers) == "table" and #visiblePlayers == 0 then + visiblePlayers = nil + elseif visiblePlayers == nil then + visiblePlayers = self.id + end self.room:moveCardTo(card, Card.PlayerSpecial, self, fk.ReasonJustMove, skillName, pile_name, visible, - proposer or self.id, nil, visiblePlayers or self.id) + proposer or self.id, nil, visiblePlayers) end function ServerPlayer:bury() -- Gitee From 3ac2d45d3028ce10a38b8ffdcbf641818856c039 Mon Sep 17 00:00:00 2001 From: xxyheaven <1433191064@qq.com> Date: Sat, 27 Apr 2024 17:05:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=9B=9E=E6=BB=9Aqml=20mark?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/client/client.lua | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lua/client/client.lua b/lua/client/client.lua index 9ac9903..5603924 100644 --- a/lua/client/client.lua +++ b/lua/client/client.lua @@ -126,10 +126,6 @@ function Client:moveCards(moves) if table.contains({ Player.Hand, Player.Equip, Player.Judge, Player.Special }, move.fromArea) then from:removeCards(move.fromArea, move.ids, move.fromSpecialName) end - if move.fromArea == Card.PlayerSpecial and move.fromSpecialName:startsWith("#") and Fk.qml_marks[move.fromSpecialName:sub(2)] then - local cards = self:getPlayerById(move.to):getPile(move.specialName) - ClientInstance:notifyUI("SetPlayerMark", {move.to, "@[" .. move.fromSpecialName:sub(2) .. "]", #cards > 0 and cards or 0}) - end end elseif move.fromArea == Card.DiscardPile then table.removeOne(self.discard_pile, move.ids[1]) @@ -147,11 +143,6 @@ function Client:moveCards(moves) end self:getPlayerById(move.to):addCards(move.toArea, ids, move.specialName) - - if move.toArea == Card.PlayerSpecial and move.specialName:startsWith("#") and Fk.qml_marks[move.specialName:sub(2)] then - ClientInstance:notifyUI("SetPlayerMark", {move.to, "@[" .. move.specialName:sub(2) .. "]", self:getPlayerById(move.to):getPile(move.specialName)}) - end - elseif move.toArea == Card.DiscardPile then table.insert(self.discard_pile, move.ids[1]) end -- Gitee