diff --git a/Fk/Pages/RoomLogic.js b/Fk/Pages/RoomLogic.js index c1677e75..6e27cc18 100644 --- a/Fk/Pages/RoomLogic.js +++ b/Fk/Pages/RoomLogic.js @@ -574,10 +574,22 @@ function enableTargets(card) { // card: int | { skill: string, subcards: int[] } )); photo.selectable = ret; if (roomScene.extra_data instanceof Object) { + const must = roomScene.extra_data.must_targets; + const included = roomScene.extra_data.include_targets; const exclusived = roomScene.extra_data.exclusive_targets; if (exclusived instanceof Array) { if (exclusived.indexOf(id) === -1) photo.selectable = false; } + if (must instanceof Array) { + if (must.filter((val) => { + return selected_targets.indexOf(val) === -1; + }).length !== 0 && must.indexOf(id) === -1) photo.selectable = false; + } + if (included instanceof Array) { + if (included.filter((val) => { + return selected_targets.indexOf(val) !== -1; + }).length === 0 && included.indexOf(id) === -1) photo.selectable = false; + } } }) @@ -596,8 +608,12 @@ function enableTargets(card) { // card: int | { skill: string, subcards: int[] } if (okButton.enabled) { if (roomScene.extra_data instanceof Object) { const must = roomScene.extra_data.must_targets; + const included = roomScene.extra_data.include_targets; if (must instanceof Array) { - okButton.enabled = (must.length === 0); + if(must.length === 0) okButton.enabled = false; + } + if (included instanceof Array) { + if (included.length === 0) okButton.enabled = false; } } } @@ -636,10 +652,22 @@ function updateSelectedTargets(playerid, selected) { )); photo.selectable = ret; if (roomScene.extra_data instanceof Object) { + const must = roomScene.extra_data.must_targets; + const included = roomScene.extra_data.include_targets; const exclusived = roomScene.extra_data.exclusive_targets; if (exclusived instanceof Array) { if (exclusived.indexOf(id) === -1) photo.selectable = false; } + if (must instanceof Array) { + if (must.filter((val) => { + return selected_targets.indexOf(val) === -1; + }).length !== 0 && must.indexOf(id) === -1) photo.selectable = false; + } + if (included instanceof Array) { + if (included.filter((val) => { + return selected_targets.indexOf(val) !== -1; + }).length === 0 && included.indexOf(id) === -1) photo.selectable = false; + } } }) @@ -658,10 +686,16 @@ function updateSelectedTargets(playerid, selected) { if (okButton.enabled) { if (roomScene.extra_data instanceof Object) { const must = roomScene.extra_data.must_targets; + const included = roomScene.extra_data.include_targets; if (must instanceof Array) { - okButton.enabled = (must.filter((val) => { + if (must.filter((val) => { return selected_targets.indexOf(val) === -1; - }).length === 0); + }).length !== 0) okButton.enabled = false; + } + if (included instanceof Array) { + if (included.filter((val) => { + return selected_targets.indexOf(val) !== -1; + }).length === 0) okButton.enabled = false; } } } diff --git a/Fk/RoomElement/Dashboard.qml b/Fk/RoomElement/Dashboard.qml index 09faeb03..14b27b3e 100644 --- a/Fk/RoomElement/Dashboard.qml +++ b/Fk/RoomElement/Dashboard.qml @@ -365,9 +365,9 @@ RowLayout { [pending_skill, cid, pendings, targets] ))) { enabled_cards.push(cid); - if (!expanded_piles[pile]) { - expandPile(pile); - } + }; + if (!expanded_piles[pile]) { + expandPile(pile); } }); diff --git a/lua/server/events/hp.lua b/lua/server/events/hp.lua index e65dc334..31520d74 100644 --- a/lua/server/events/hp.lua +++ b/lua/server/events/hp.lua @@ -175,7 +175,6 @@ GameEvent.functions[GameEvent.Damage] = function(self) stages = { {fk.Damage, damageStruct.from}, {fk.Damaged, damageStruct.to}, - {fk.DamageFinished, damageStruct.to}, } for _, struct in ipairs(stages) do diff --git a/lua/server/room.lua b/lua/server/room.lua index b329375c..bd2a6816 100644 --- a/lua/server/room.lua +++ b/lua/server/room.lua @@ -3157,6 +3157,7 @@ end ---@param card_ids integer[] @ 被重铸的牌 ---@param who ServerPlayer @ 重铸的角色 ---@param skillName? string @ 技能名,默认为“重铸” +---@return integer[] @ 摸到的牌 function Room:recastCard(card_ids, who, skillName) if type(card_ids) == "number" then card_ids = {card_ids} @@ -3167,7 +3168,7 @@ function Room:recastCard(card_ids, who, skillName) from = who.id, toArea = Card.DiscardPile, skillName = skillName, - moveReason = fk.ReasonPutIntoDiscardPile, + moveReason = fk.ReasonRecast, proposer = who.id }) self:broadcastPlaySound("./audio/system/recast") @@ -3177,7 +3178,7 @@ function Room:recastCard(card_ids, who, skillName) card = card_ids, arg = skillName, } - self:drawCards(who, #card_ids, skillName) + return self:drawCards(who, #card_ids, skillName) end --- 根据拼点信息开始拼点。 diff --git a/lua/server/system_enum.lua b/lua/server/system_enum.lua index 3219e62c..e4f404ea 100644 --- a/lua/server/system_enum.lua +++ b/lua/server/system_enum.lua @@ -192,6 +192,7 @@ fk.ReasonExchange = 8 fk.ReasonUse = 9 fk.ReasonResonpse = 10 fk.ReasonJudge = 11 +fk.ReasonRecast = 12 ---@class PindianStruct ---@field public from ServerPlayer diff --git a/packages/standard/aux_skills.lua b/packages/standard/aux_skills.lua index 8d54d6c4..8a6c75bb 100644 --- a/packages/standard/aux_skills.lua +++ b/packages/standard/aux_skills.lua @@ -95,7 +95,23 @@ local choosePlayersSkill = fk.CreateActiveSkill{ local exChooseSkill = fk.CreateActiveSkill{ name = "ex__choose_skill", card_filter = function(self, to_select, selected) - return self.pattern ~= "" and Exppattern:Parse(self.pattern):match(Fk:getCardById(to_select)) and #selected < self.max_card_num + if #selected < self.max_card_num then return false end + + if Fk:currentRoom():getCardArea(to_select) == Card.PlayerSpecial then + if not string.find(self.pattern or "", self.expand_pile or "") then return false end + end + + local checkpoint = true + local card = Fk:getCardById(to_select) + + if not self.include_equip then + checkpoint = checkpoint and (Fk:currentRoom():getCardArea(to_select) ~= Player.Equip) + end + + if self.pattern and self.pattern ~= "" then + checkpoint = checkpoint and (Exppattern:Parse(self.pattern):match(card)) + end + return checkpoint end, target_filter = function(self, to_select, selected, cards) if self.pattern ~= "" and #cards < self.min_card_num then return end