From 8b2c6eacd1a98a90beab83c2d9867ccaebb126f0 Mon Sep 17 00:00:00 2001 From: Ho-spair Date: Sun, 27 Oct 2024 00:41:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/client/client.lua | 2 ++ lua/core/request_type/response_card.lua | 8 ++++++-- lua/core/request_type/use_card.lua | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lua/client/client.lua b/lua/client/client.lua index 97cf128..3402b2d 100644 --- a/lua/client/client.lua +++ b/lua/client/client.lua @@ -879,6 +879,7 @@ fk.client_callback["AskForUseCard"] = function(data) h.prompt = data[3] h.cancelable = data[4] h.extra_data = data[5] + h.disabledSkillNames = data[6] h.change = {} h:setup() h.scene:notifyUI() @@ -894,6 +895,7 @@ fk.client_callback["AskForResponseCard"] = function(data) h.prompt = data[3] h.cancelable = data[4] h.extra_data = data[5] + h.disabledSkillNames = data[6] h.change = {} h:setup() h.scene:notifyUI() diff --git a/lua/core/request_type/response_card.lua b/lua/core/request_type/response_card.lua index b9898fd..99d7f3d 100644 --- a/lua/core/request_type/response_card.lua +++ b/lua/core/request_type/response_card.lua @@ -41,8 +41,12 @@ end function ReqResponseCard:skillButtonValidity(name) local player = self.player local skill = Fk.skills[name] - return skill:isInstanceOf(ViewAsSkill) and skill:enabledAtResponse(player, true) - and skill.pattern and Exppattern:Parse(self.pattern):matchExp(skill.pattern) + return + skill:isInstanceOf(ViewAsSkill) and + skill:enabledAtResponse(player, true) and + skill.pattern and + Exppattern:Parse(self.pattern):matchExp(skill.pattern) and + not table.contains(self.disabledSkillNames or {}, name) end function ReqResponseCard:cardValidity(cid) diff --git a/lua/core/request_type/use_card.lua b/lua/core/request_type/use_card.lua index 62a9e83..673acfd 100644 --- a/lua/core/request_type/use_card.lua +++ b/lua/core/request_type/use_card.lua @@ -7,8 +7,12 @@ local ReqUseCard = ReqResponseCard:subclass("ReqUseCard") function ReqUseCard:skillButtonValidity(name) local player = self.player local skill = Fk.skills[name] - return skill:isInstanceOf(ViewAsSkill) and skill:enabledAtResponse(player, false) - and skill.pattern and Exppattern:Parse(self.pattern):matchExp(skill.pattern) + return + skill:isInstanceOf(ViewAsSkill) and + skill:enabledAtResponse(player, false) and + skill.pattern and + Exppattern:Parse(self.pattern):matchExp(skill.pattern) and + not table.contains(self.disabledSkillNames or {}, name) end function ReqUseCard:cardValidity(cid) -- Gitee