From 580b191478b01541f205f92377bad22e2f0c6ad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Sun, 15 Sep 2024 22:02:41 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E5=8D=A0=E4=BD=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/core/card.lua | 2 ++ standard_cards/i18n/en_US.lua | 2 +- standard_cards/i18n/zh_CN.lua | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/core/card.lua b/lua/core/card.lua index 9b86283..8a4c0b1 100644 --- a/lua/core/card.lua +++ b/lua/core/card.lua @@ -90,6 +90,8 @@ function Card:initialize(name, suit, number, color) self.color = Card.Red elseif color ~= nil then self.color = color + elseif suit == Card.Unknown then + self.color = Card.Unknown else self.color = Card.NoColor end diff --git a/standard_cards/i18n/en_US.lua b/standard_cards/i18n/en_US.lua index 4a353c5..7fe923d 100644 --- a/standard_cards/i18n/en_US.lua +++ b/standard_cards/i18n/en_US.lua @@ -8,7 +8,7 @@ Fk:loadTranslationTable({ ["log_heart"] = '', ["log_club"] = '♣', ["log_diamond"] = '', - ["log_nosuit"] = "No suit", + ["log_nosuit"] = "X", -- ["spade"] = "Spade", -- ["heart"] = "Heart", -- ["club"] = "Club", diff --git a/standard_cards/i18n/zh_CN.lua b/standard_cards/i18n/zh_CN.lua index f5a6afa..b0367a7 100644 --- a/standard_cards/i18n/zh_CN.lua +++ b/standard_cards/i18n/zh_CN.lua @@ -8,7 +8,7 @@ Fk:loadTranslationTable{ ["log_heart"] = '', ["log_club"] = '♣', ["log_diamond"] = '', - ["log_nosuit"] = "无花色", + ["log_nosuit"] = "无", ["spade"] = "黑桃", ["heart"] = "红桃", ["club"] = "梅花", -- Gitee From 2b47511bee4f513674fe094fde3fb58a3846300f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Tue, 17 Sep 2024 01:39:18 +0800 Subject: [PATCH 02/13] pattern --- lua/core/exppattern.lua | 44 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/lua/core/exppattern.lua b/lua/core/exppattern.lua index 1e73c3f..0bd33e2 100644 --- a/lua/core/exppattern.lua +++ b/lua/core/exppattern.lua @@ -33,6 +33,7 @@ ---@field public id? integer[] -- v0.2.6改动: cardType会被解析为trueName数组和name数组,而不是自己单独成立 +-- core改动: name数组为空时,将根据trueName数组生成对应的name数组 local numbertable = { ["A"] = 1, @@ -48,6 +49,8 @@ local placetable = { local card_type_table = {} +local card_truename_table = {} + local function fillCardTypeTable() local tmp = {} for _, cd in ipairs(Fk.cards) do @@ -66,6 +69,20 @@ local function fillCardTypeTable() end end +local function fillCardTrueNameTable() + local tmp = {} + for _, cd in ipairs(Fk.cards) do + local tn = cd.trueName + local n = cd.name + + if not tmp[n] then + card_truename_table[tn] = card_type_table[tn] or {} + table.insertIfNeed(card_type_table[tn], n) + tmp[n] = true + end + end +end + local function matchSingleKey(matcher, card, key) local match = matcher[key] if not match then return true end @@ -302,7 +319,9 @@ local function parseMatcher(str) ret.suit = not table.contains(t[3], ".") and t[3] or nil ret.place = not table.contains(t[4], ".") and t[4] or nil - ret.name = not table.contains(t[5], ".") and t[5] or nil + if table.empty(card_truename_table) then + fillCardTrueNameTable() + end -- ret.cardType = not table.contains(t[6], ".") and t[6] or nil if table.empty(card_type_table) then fillCardTypeTable() @@ -313,10 +332,10 @@ local function parseMatcher(str) table.insertIfNeed(ret.trueName, n) end end + if not ret.trueName then ret.trueName = {} end + if not ret.trueName.neg then ret.trueName.neg = {} end for _, neg in ipairs(t[6].neg or Util.DummyTable) do if type(neg) ~= "table" then neg = { neg } end - if not ret.trueName then ret.trueName = {} end - if not ret.trueName.neg then ret.trueName.neg = {} end local temp = {} for _, ctype in ipairs(neg) do @@ -325,6 +344,25 @@ local function parseMatcher(str) table.insert(ret.trueName.neg, temp) end + if table.contains(t[5], ".") and ret.trueName then + ret.name = {} + for _, tn in ipairs(ret.trueName) do + table.insertTableIfNeed(ret.name, card_truename_table[tn]) + end + if not ret.name.neg then ret.name.neg = {} end + for _, neg in ipairs(ret.trueName.neg) do + if type(neg) ~= "table" then neg = { neg } end + + local temp = {} + for _, tn in ipairs(neg) do + table.insertTableIfNeed(temp, card_truename_table[tn] or Util.DummyTable) + end + table.insert(ret.name.neg, temp) + end + else + ret.name = t[5] + end + if not table.contains(t[7], ".") then ret.id = parseRawNumTable(t[7]) end -- Gitee From 9723050d797b960db744dc1af7e34183a26e6b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Tue, 17 Sep 2024 03:39:31 +0800 Subject: [PATCH 03/13] addPackageFilter --- lua/core/game_mode.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/core/game_mode.lua b/lua/core/game_mode.lua index b74cf40..7a30c41 100644 --- a/lua/core/game_mode.lua +++ b/lua/core/game_mode.lua @@ -83,4 +83,14 @@ function GameMode:getAdjustedProperty (player) return list end +--- 向游戏模式中添加拓展包过滤。 +---@param whitelist string[] @ 白名单 +---@param blacklist string[] @ 黑名单 +function GameMode:addPackageFilter(whitelist, blacklist) + assert(type(whitelist) == "table") + assert(type(blacklist) == "table") + table.insertTable(self.whitelist, whitelist) + table.insertTable(self.blacklist, blacklist) +end + return GameMode -- Gitee From b9acde26f259cbb47f58aefebe0de9d564589af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Tue, 17 Sep 2024 04:34:55 +0800 Subject: [PATCH 04/13] WIP --- lua/core/card.lua | 16 ++++++++++++---- standard/game_rule.lua | 1 + standard_cards/i18n/en_US.lua | 1 + standard_cards/i18n/zh_CN.lua | 4 +++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lua/core/card.lua b/lua/core/card.lua index 8a4c0b1..419d161 100644 --- a/lua/core/card.lua +++ b/lua/core/card.lua @@ -244,7 +244,7 @@ end ---@return string @ 描述花色的字符串 function Card:getSuitString(symbol) local suit = self.suit - local ret + local ret = "unknown" if suit == Card.Spade then ret = "spade" elseif suit == Card.Heart then @@ -253,7 +253,7 @@ function Card:getSuitString(symbol) ret = "club" elseif suit == Card.Diamond then ret = "diamond" - else + elseif suit == Card.NoSuit then ret = "nosuit" end return symbol and "log_" .. ret or ret @@ -267,8 +267,10 @@ function Card:getColorString() return "black" elseif color == Card.Red then return "red" + elseif color == Card.NoColor then + return "nocolor" end - return "nocolor" + return "unknown" end --- 获取卡牌类型并返回类型描述(例如基本牌/锦囊牌/装备牌)。 @@ -428,8 +430,11 @@ end --- 比较两张卡牌的花色是否相同 ---@param anotherCard Card @ 另一张卡牌 ---@param diff? boolean @ 比较二者不同 ----@return boolean 返回比较结果 +---@return boolean @ 返回比较结果 function Card:compareSuitWith(anotherCard, diff) + if table.contains({ self.suit, anotherCard.suit }, Card.Unknown) then + return true + end if self ~= anotherCard and table.contains({ self.suit, anotherCard.suit }, Card.NoSuit) then return false end @@ -446,6 +451,9 @@ end ---@param diff? boolean @ 比较二者不同 ---@return boolean @ 返回比较结果 function Card:compareColorWith(anotherCard, diff) + if table.contains({ self.color, anotherCard.color }, Card.Unknown) then + return true + end if self ~= anotherCard and table.contains({ self.color, anotherCard.color }, Card.NoColor) then return false end diff --git a/standard/game_rule.lua b/standard/game_rule.lua index b5ba5a8..6e8c57f 100644 --- a/standard/game_rule.lua +++ b/standard/game_rule.lua @@ -48,6 +48,7 @@ GameRule = fk.CreateTriggerSkill{ end cardNames = table.filter(cardNames, function (cardName) + -- FIXME: 应该印一个“任何情况都适合”的牌,或者说根本不该有这个过滤 local cardCloned = Fk:cloneCard(cardName) return not (player:prohibitUse(cardCloned) or player:isProhibited(dyingPlayer, cardCloned)) end) diff --git a/standard_cards/i18n/en_US.lua b/standard_cards/i18n/en_US.lua index 7fe923d..4ea3df5 100644 --- a/standard_cards/i18n/en_US.lua +++ b/standard_cards/i18n/en_US.lua @@ -9,6 +9,7 @@ Fk:loadTranslationTable({ ["log_club"] = '♣', ["log_diamond"] = '', ["log_nosuit"] = "X", + ["log_unknown"] = "?", -- ["spade"] = "Spade", -- ["heart"] = "Heart", -- ["club"] = "Club", diff --git a/standard_cards/i18n/zh_CN.lua b/standard_cards/i18n/zh_CN.lua index b0367a7..39d9045 100644 --- a/standard_cards/i18n/zh_CN.lua +++ b/standard_cards/i18n/zh_CN.lua @@ -8,7 +8,9 @@ Fk:loadTranslationTable{ ["log_heart"] = '', ["log_club"] = '♣', ["log_diamond"] = '', - ["log_nosuit"] = "无", + ["log_nosuit"] = "X", + ["log_unknown"] = "?", + ["unknown"] = "未知", ["spade"] = "黑桃", ["heart"] = "红桃", ["club"] = "梅花", -- Gitee From 9e146d04887c1477fd88fb73c2bf57ebd392deb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Wed, 18 Sep 2024 00:12:46 +0800 Subject: [PATCH 05/13] doYiji --- lua/server/room.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lua/server/room.lua b/lua/server/room.lua index 809066c..0ad7509 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -3393,17 +3393,16 @@ function Room:moveCardTo(card, to_place, target, reason, skill_name, special_nam end --- 将一些卡牌同时分配给一些角色。 ----@param room Room @ 房间 ---@param list table @ 分配牌和角色的数据表,键为角色id,值为分配给其的牌id数组 ---@param proposer? integer @ 操作者的id。默认为空 ---@param skillName? string @ 技能名。默认为“分配” ---@return table @ 返回成功分配的卡牌 -function Room:doYiji(room, list, proposer, skillName) +function Room:doYiji(list, proposer, skillName) skillName = skillName or "distribution_skill" local moveInfos = {} local move_ids = {} for to, cards in pairs(list) do - local toP = room:getPlayerById(to) + local toP = self:getPlayerById(to) local handcards = toP:getCardIds("h") cards = table.filter(cards, function (id) return not table.contains(handcards, id) end) if #cards > 0 then @@ -3411,7 +3410,7 @@ function Room:doYiji(room, list, proposer, skillName) local moveMap = {} local noFrom = {} for _, id in ipairs(cards) do - local from = room.owner_map[id] + local from = self.owner_map[id] if from then moveMap[from] = moveMap[from] or {} table.insert(moveMap[from], id) @@ -3423,7 +3422,7 @@ function Room:doYiji(room, list, proposer, skillName) table.insert(moveInfos, { ids = _cards, moveInfo = table.map(_cards, function(id) - return {cardId = id, fromArea = room:getCardArea(id), fromSpecialName = room:getPlayerById(from):getPileNameOfId(id)} + return {cardId = id, fromArea = self:getCardArea(id), fromSpecialName = self:getPlayerById(from):getPileNameOfId(id)} end), from = from, to = to, @@ -3446,7 +3445,7 @@ function Room:doYiji(room, list, proposer, skillName) end end if #moveInfos > 0 then - room:moveCards(table.unpack(moveInfos)) + self:moveCards(table.unpack(moveInfos)) end return move_ids end -- Gitee From 5eacfaeaa7a45ba2490879f13e5cbd7774246466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Sun, 22 Sep 2024 01:17:10 +0800 Subject: [PATCH 06/13] fix --- lua/core/exppattern.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/core/exppattern.lua b/lua/core/exppattern.lua index 0bd33e2..e3b7f06 100644 --- a/lua/core/exppattern.lua +++ b/lua/core/exppattern.lua @@ -76,8 +76,8 @@ local function fillCardTrueNameTable() local n = cd.name if not tmp[n] then - card_truename_table[tn] = card_type_table[tn] or {} - table.insertIfNeed(card_type_table[tn], n) + card_truename_table[tn] = card_truename_table[tn] or {} + table.insertIfNeed(card_truename_table[tn], n) tmp[n] = true end end -- Gitee From 589652f5c0ba74011a22132033d437c9cdcfd40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Sun, 22 Sep 2024 01:53:47 +0800 Subject: [PATCH 07/13] fix --- lua/core/exppattern.lua | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/lua/core/exppattern.lua b/lua/core/exppattern.lua index e3b7f06..f230aa3 100644 --- a/lua/core/exppattern.lua +++ b/lua/core/exppattern.lua @@ -344,20 +344,24 @@ local function parseMatcher(str) table.insert(ret.trueName.neg, temp) end - if table.contains(t[5], ".") and ret.trueName then - ret.name = {} - for _, tn in ipairs(ret.trueName) do - table.insertTableIfNeed(ret.name, card_truename_table[tn]) - end - if not ret.name.neg then ret.name.neg = {} end - for _, neg in ipairs(ret.trueName.neg) do - if type(neg) ~= "table" then neg = { neg } end + if table.contains(t[5], ".") then + if ret.trueName then + ret.name = {} + for _, tn in ipairs(ret.trueName) do + table.insertTableIfNeed(ret.name, card_truename_table[tn]) + end + if not ret.name.neg then ret.name.neg = {} end + for _, neg in ipairs(ret.trueName.neg) do + if type(neg) ~= "table" then neg = { neg } end - local temp = {} - for _, tn in ipairs(neg) do - table.insertTableIfNeed(temp, card_truename_table[tn] or Util.DummyTable) + local temp = {} + for _, tn in ipairs(neg) do + table.insertTableIfNeed(temp, card_truename_table[tn] or Util.DummyTable) + end + table.insert(ret.name.neg, temp) end - table.insert(ret.name.neg, temp) + else + ret.name = nil end else ret.name = t[5] -- Gitee From 2cea55445f6ed3e3fc5c67f0403d406291086004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Sun, 22 Sep 2024 02:11:59 +0800 Subject: [PATCH 08/13] fix --- lua/core/exppattern.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/core/exppattern.lua b/lua/core/exppattern.lua index f230aa3..b6f3e0d 100644 --- a/lua/core/exppattern.lua +++ b/lua/core/exppattern.lua @@ -332,10 +332,10 @@ local function parseMatcher(str) table.insertIfNeed(ret.trueName, n) end end - if not ret.trueName then ret.trueName = {} end - if not ret.trueName.neg then ret.trueName.neg = {} end for _, neg in ipairs(t[6].neg or Util.DummyTable) do if type(neg) ~= "table" then neg = { neg } end + if not ret.trueName then ret.trueName = {} end + if not ret.trueName.neg then ret.trueName.neg = {} end local temp = {} for _, ctype in ipairs(neg) do @@ -350,10 +350,10 @@ local function parseMatcher(str) for _, tn in ipairs(ret.trueName) do table.insertTableIfNeed(ret.name, card_truename_table[tn]) end - if not ret.name.neg then ret.name.neg = {} end - for _, neg in ipairs(ret.trueName.neg) do + for _, neg in ipairs(ret.trueName.neg or Util.DummyTable) do if type(neg) ~= "table" then neg = { neg } end - + if not ret.name.neg then ret.name.neg = {} end + local temp = {} for _, tn in ipairs(neg) do table.insertTableIfNeed(temp, card_truename_table[tn] or Util.DummyTable) -- Gitee From 547987a38b7d979a5e833f4b8133030af14c01b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Thu, 26 Sep 2024 19:47:47 +0800 Subject: [PATCH 09/13] fix --- lua/core/exppattern.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/core/exppattern.lua b/lua/core/exppattern.lua index b6f3e0d..f9c5348 100644 --- a/lua/core/exppattern.lua +++ b/lua/core/exppattern.lua @@ -348,7 +348,7 @@ local function parseMatcher(str) if ret.trueName then ret.name = {} for _, tn in ipairs(ret.trueName) do - table.insertTableIfNeed(ret.name, card_truename_table[tn]) + table.insertTableIfNeed(ret.name, card_truename_table[tn] or Util.DummyTable) end for _, neg in ipairs(ret.trueName.neg or Util.DummyTable) do if type(neg) ~= "table" then neg = { neg } end -- Gitee From 741e66a454667324048bccf882c2d7bd02ff6f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Sun, 29 Sep 2024 03:33:05 +0800 Subject: [PATCH 10/13] fix --- lua/server/room.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/server/room.lua b/lua/server/room.lua index 0ad7509..ced9d76 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -1575,7 +1575,7 @@ function Room:askForYiji(player, cards, targets, skillName, minNum, maxNum, prom end end if not skipMove then - self:doYiji(self, list, player.id, skillName) + self:doYiji(list, player.id, skillName) end return list -- Gitee From 2ecb129a5f83e2d3cb0e50ff589e753259f4a982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Wed, 2 Oct 2024 19:50:44 +0800 Subject: [PATCH 11/13] fix --- lua/server/room.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lua/server/room.lua b/lua/server/room.lua index ced9d76..15dd42e 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -2210,18 +2210,20 @@ end --- 询问玩家任意交换几堆牌堆。 --- ---@param player ServerPlayer @ 要询问的玩家 ----@param piles table @ 卡牌id列表的列表,也就是……几堆牌堆的集合 ----@param piles_name string[] @ 牌堆名,必须一一对应,否则统一替换为“牌堆X” +---@param piles (integer[])[] @ 卡牌id列表的列表,也就是……几堆牌堆的集合 +---@param piles_name string[] @ 牌堆名,不足部分替换为“牌堆1、牌堆2...” ---@param customNotify? string @ 自定义读条操作提示 ----@return table +---@return (integer[])[] function Room:askForExchange(player, piles, piles_name, customNotify) local command = "AskForExchange" piles_name = piles_name or Util.DummyTable - if #piles_name ~= #piles then - piles_name = {} - for i, _ in ipairs(piles) do + local x = #piles - #piles_name + if x > 0 then + for i = 1, x, 1 do table.insert(piles_name, Fk:translate("Pile") .. i) end + elseif x < 0 then + piles_name = table.slice(piles_name, 1, #piles + 1) end self:notifyMoveFocus(player, customNotify or command) local data = { -- Gitee From 39515c1a9840416d8b70f26d30a2f2d6d5f2c832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Wed, 9 Oct 2024 21:51:56 +0800 Subject: [PATCH 12/13] fix --- lua/server/room.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/server/room.lua b/lua/server/room.lua index 15dd42e..78baf4d 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -1538,7 +1538,7 @@ function Room:askForYiji(player, cards, targets, skillName, minNum, maxNum, prom residued_list = residueMap, expand_pile = expand_pile } - p(json.encode(residueMap)) + -- p(json.encode(residueMap)) while maxNum > 0 and #_cards > 0 do data.max_num = maxNum -- Gitee From 9fab1b14a149dd8bcfe0becc08764d5805c8bf4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E7=BA=A7=E5=A6=96=E6=A2=A6=E5=8E=A8?= <12796194+youmuKon-supreme@user.noreply.gitee.com> Date: Sun, 13 Oct 2024 17:12:06 +0800 Subject: [PATCH 13/13] fix --- lua/server/room.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/server/room.lua b/lua/server/room.lua index 78baf4d..020bf11 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -1503,7 +1503,7 @@ end ---@param expand_pile? string @ 可选私人牌堆名称,如要分配你武将牌上的牌请填写 ---@param skipMove? boolean @ 是否跳过移动。默认不跳过 ---@param single_max? integer|table @ 限制每人能获得的最大牌数。输入整数或(以角色id为键以整数为值)的表 ----@return table @ 返回一个表,键为角色id,值为分配给其的牌id数组 +---@return table @ 返回一个表,键为角色id转字符串,值为分配给其的牌id数组 function Room:askForYiji(player, cards, targets, skillName, minNum, maxNum, prompt, expand_pile, skipMove, single_max) targets = targets or self.alive_players cards = cards or player:getCardIds("he") @@ -3395,10 +3395,10 @@ function Room:moveCardTo(card, to_place, target, reason, skill_name, special_nam end --- 将一些卡牌同时分配给一些角色。 ----@param list table @ 分配牌和角色的数据表,键为角色id,值为分配给其的牌id数组 +---@param list table @ 分配牌和角色的数据表,键为角色id,值为分配给其的牌id数组 ---@param proposer? integer @ 操作者的id。默认为空 ---@param skillName? string @ 技能名。默认为“分配” ----@return table @ 返回成功分配的卡牌 +---@return integer[][] @ 返回成功分配的卡牌 function Room:doYiji(list, proposer, skillName) skillName = skillName or "distribution_skill" local moveInfos = {} -- Gitee