Skip to content

Commit

Permalink
Bug fix (Qsgs-Fans#326)
Browse files Browse the repository at this point in the history
1. 修复askForCard(s)Chosen
2. table.insertIfNeed添加返回值
3. 每轮每回合结束后filter手牌并播报手牌上限
4. 修复ex__choose

---------

Co-authored-by: YoumuKon <[email protected]>
  • Loading branch information
Mechanel and YoumuKon committed Feb 27, 2024
1 parent 7266028 commit dfbe59e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lua/client/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ fk.client_callback["AskForCardChosen"] = function(jsonData)
if #equip ~= 0 then table.insert(ui_data.card_data, { "$Equip", equip }) end
if #judge ~= 0 then table.insert(ui_data.card_data, { "$Judge", judge }) end
else
ui_data._id = id
ui_data._reason = reason
ui_data._prompt = prompt
end
Expand Down Expand Up @@ -429,6 +430,7 @@ fk.client_callback["AskForCardsChosen"] = function(jsonData)
if #equip ~= 0 then table.insert(ui_data.card_data, { "$Equip", equip }) end
if #judge ~= 0 then table.insert(ui_data.card_data, { "$Judge", judge }) end
else
ui_data._id = id
ui_data._min = min
ui_data._max = max
ui_data._reason = reason
Expand Down
1 change: 1 addition & 0 deletions lua/core/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ end
function table:insertIfNeed(element)
if not table.contains(self, element) then
table.insert(self, element)
return true
end
end

Expand Down
5 changes: 5 additions & 0 deletions lua/server/events/gameflow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -385,4 +385,9 @@ GameEvent.cleaners[GameEvent.Phase] = function(self)
end
end
end

for _, p in ipairs(room.players) do
p:filterHandcards()
room:broadcastProperty(p, "MaxCards")
end
end
4 changes: 0 additions & 4 deletions packages/standard/aux_skills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ local exChooseSkill = fk.CreateActiveSkill{
return table.contains(self.targets, to_select)
end
end,
min_target_num = function(self) return self.min_target_num end,
max_target_num = function(self) return self.max_target_num end,
min_card_num = function(self) return self.min_card_num end,
max_card_num = function(self) return self.max_card_num end,
}

local maxCardsSkill = fk.CreateMaxCardsSkill{
Expand Down

0 comments on commit dfbe59e

Please sign in to comment.