From 267dae38956ae5e2826a04e72db381522900abd1 Mon Sep 17 00:00:00 2001 From: Newaser Date: Mon, 26 May 2025 20:09:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E8=A7=86?= =?UTF-8?q?=E4=B8=BA=E6=8A=80=E5=93=8D=E5=BA=94=E6=97=A0=E6=87=88=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/core/skill_skeleton.lua | 2 ++ lua/core/skill_type/cardskill.lua | 2 ++ lua/core/skill_type/view_as.lua | 7 +++++++ lua/fk_ex.lua | 1 + 4 files changed, 12 insertions(+) diff --git a/lua/core/skill_skeleton.lua b/lua/core/skill_skeleton.lua index 100744c..c2bba3c 100644 --- a/lua/core/skill_skeleton.lua +++ b/lua/core/skill_skeleton.lua @@ -520,6 +520,8 @@ function SkillSkeleton:createViewAsSkill(_skill, idx, key, attr, spec) if spec.click_count then skill.click_count = spec.click_count end + skill.filterNullification = spec.filter_nullification + skill.handly_pile = spec.handly_pile skill.mute_card = spec.mute_card diff --git a/lua/core/skill_type/cardskill.lua b/lua/core/skill_type/cardskill.lua index b04583d..465001a 100644 --- a/lua/core/skill_type/cardskill.lua +++ b/lua/core/skill_type/cardskill.lua @@ -309,6 +309,8 @@ function CardSkill:preEffect(room, cardEffectData) if s.pattern and Exppattern:Parse("nullification"):matchExp(s.pattern) and + s:filterNullification(p, cardEffectData) and + s:enabledAtResponse(p) and ( cardEffectData.use == nil or not ( diff --git a/lua/core/skill_type/view_as.lua b/lua/core/skill_type/view_as.lua index c5da38a..c490c8f 100644 --- a/lua/core/skill_type/view_as.lua +++ b/lua/core/skill_type/view_as.lua @@ -63,4 +63,11 @@ function ViewAsSkill:afterResponse(player, response) end ---@param extra_data any function ViewAsSkill:prompt(player, selected_cards, selected_targets, extra_data) return "" end +---@param player Player +---@param data CardEffectData +---@return boolean? +function ViewAsSkill:filterNullification(player, data) + return true +end + return ViewAsSkill diff --git a/lua/fk_ex.lua b/lua/fk_ex.lua index c1844f5..b641ca9 100644 --- a/lua/fk_ex.lua +++ b/lua/fk_ex.lua @@ -147,6 +147,7 @@ end ---@field public handly_pile? boolean @ 是否能够选择“如手牌使用或打出”的牌 ---@field public mute_card? boolean @ 是否不播放卡牌特效和语音 ---@field public click_count? boolean @ 是否在点击按钮瞬间就计数并播放特效和语音 +---@field public filter_nullification? fun(self: ViewAsSkill, player: Player, data: CardEffectData): boolean? @ 判断一张牌是否能被此技能转化无懈来响应 ---@class DistanceSpec: StatusSkillSpec ---@field public correct_func? fun(self: DistanceSkill, from: Player, to: Player): integer? -- Gitee From f518ba54ebecf4e74e1b76e3924e2bdad8221044 Mon Sep 17 00:00:00 2001 From: Newaser Date: Tue, 27 May 2025 15:14:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=86filterNullification=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=B8=BAenabledAtNullification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/core/skill_skeleton.lua | 2 +- lua/core/skill_type/cardskill.lua | 2 +- lua/core/skill_type/view_as.lua | 5 +++-- lua/fk_ex.lua | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lua/core/skill_skeleton.lua b/lua/core/skill_skeleton.lua index c2bba3c..fa99f1c 100644 --- a/lua/core/skill_skeleton.lua +++ b/lua/core/skill_skeleton.lua @@ -520,7 +520,7 @@ function SkillSkeleton:createViewAsSkill(_skill, idx, key, attr, spec) if spec.click_count then skill.click_count = spec.click_count end - skill.filterNullification = spec.filter_nullification + skill.enabledAtNullification = spec.enabled_at_nullification skill.handly_pile = spec.handly_pile skill.mute_card = spec.mute_card diff --git a/lua/core/skill_type/cardskill.lua b/lua/core/skill_type/cardskill.lua index 465001a..98723be 100644 --- a/lua/core/skill_type/cardskill.lua +++ b/lua/core/skill_type/cardskill.lua @@ -309,7 +309,7 @@ function CardSkill:preEffect(room, cardEffectData) if s.pattern and Exppattern:Parse("nullification"):matchExp(s.pattern) and - s:filterNullification(p, cardEffectData) and + s:enabledAtNullification(p, cardEffectData) and s:enabledAtResponse(p) and ( cardEffectData.use == nil or diff --git a/lua/core/skill_type/view_as.lua b/lua/core/skill_type/view_as.lua index c490c8f..3a7893a 100644 --- a/lua/core/skill_type/view_as.lua +++ b/lua/core/skill_type/view_as.lua @@ -63,10 +63,11 @@ function ViewAsSkill:afterResponse(player, response) end ---@param extra_data any function ViewAsSkill:prompt(player, selected_cards, selected_targets, extra_data) return "" end +--- 转化无懈是否对特定的牌有效 ---@param player Player ----@param data CardEffectData +---@param data CardEffectData @ 被响应的牌的数据 ---@return boolean? -function ViewAsSkill:filterNullification(player, data) +function ViewAsSkill:enabledAtNullification(player, data) return true end diff --git a/lua/fk_ex.lua b/lua/fk_ex.lua index b641ca9..6a142ba 100644 --- a/lua/fk_ex.lua +++ b/lua/fk_ex.lua @@ -147,7 +147,7 @@ end ---@field public handly_pile? boolean @ 是否能够选择“如手牌使用或打出”的牌 ---@field public mute_card? boolean @ 是否不播放卡牌特效和语音 ---@field public click_count? boolean @ 是否在点击按钮瞬间就计数并播放特效和语音 ----@field public filter_nullification? fun(self: ViewAsSkill, player: Player, data: CardEffectData): boolean? @ 判断一张牌是否能被此技能转化无懈来响应 +---@field public enabled_at_nullification? fun(self: ViewAsSkill, player: Player, data: CardEffectData): boolean? @ 判断一张牌是否能被此技能转化无懈来响应 ---@class DistanceSpec: StatusSkillSpec ---@field public correct_func? fun(self: DistanceSkill, from: Player, to: Player): integer? -- Gitee