From ac4cf13e5db79db0f1798ca10d1304ef385cde87 Mon Sep 17 00:00:00 2001 From: Diuse <123@qq.com> Date: Fri, 17 Mar 2023 20:13:52 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=AD=A6=E5=B0=86?= =?UTF-8?q?=E9=AA=86=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/init.lua b/init.lua index 7b20257..2761450 100644 --- a/init.lua +++ b/init.lua @@ -676,4 +676,73 @@ Fk:loadTranslationTable{ "与其他角色计算距离-X且可以多使用X张杀。", } +local qinzheng = fk.CreateTriggerSkill{ + name = "qinzheng", + anim_type = "drawcard", + frequency = Skill.Compulsory, + events = {fk.AfterCardUseDeclared, fk.CardResponding}, + on_use = function(self, event, player, target, data) + player.room:addPlayerMark(player, "@qinzheng", 1) + + local randCard = function(cardName) + local cardNum = #player.room.draw_pile + local randNum = math.random(1, cardNum) + + for i = randNum, cardNum do + local card = Fk:getCardById(player.room.draw_pile[i]) + + if table.contains(cardName, card.name) then + return card + end + end + + for i = 1, randNum do + local card = Fk:getCardById(player.room.draw_pile[i]) + + if table.contains(cardName, card.name) then + return card + end + end + + return nil + end + local num = player:getMark("@qinzheng") + + if num % 3 == 0 then + local card = randCard({"slash", "jink"}) + + if card ~= nil then + player.room:obtainCard(player.id, card, true, fk.ReasonPrey) + end + end + + if num % 5 == 0 then + local card = randCard({"peach", "analeptic"}) + + if card ~= nil then + player.room:obtainCard(player.id, card, true, fk.ReasonPrey) + end + end + + if num % 8 == 0 then + local card = randCard({"ex_nihilo", "duel"}) + + if card ~= nil then + player.room:obtainCard(player.id, card, true, fk.ReasonPrey) + end + end + end, +} + +local luotong = General:new(extension, "luotong", "wu", 4) +luotong:addSkill(qinzheng) + +Fk:loadTranslationTable{ + ["luotong"] = "骆统", + ["qinzheng"] = "勤政", + [":qinzheng"] = "锁定技,你每使用或打出:三张牌时,你随机获得一张【杀】或【闪】;五张牌时,你随机获得一张【桃】或【酒】;八张牌时,你随机获得一张【无中生有】或【决斗】。", + ["@qinzheng"] = "勤政", +} + + return {extension} -- Gitee From da0c5a5607aeff8aa18d939562a65c34bbe6c00e Mon Sep 17 00:00:00 2001 From: Diuse <1754798088@qq.com> Date: Fri, 17 Mar 2023 20:44:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?update=20=E9=AA=86=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 2761450..702a6fd 100644 --- a/init.lua +++ b/init.lua @@ -681,9 +681,27 @@ local qinzheng = fk.CreateTriggerSkill{ anim_type = "drawcard", frequency = Skill.Compulsory, events = {fk.AfterCardUseDeclared, fk.CardResponding}, + on_trigger = function(self, event, target, player, data) + self.cancel_cost = false + local num = player:getMark("@qinzheng") + local skillNum = 0 + + if num % 3 == 0 then skillNum = skillNum + 1 end + if num % 5 == 0 then skillNum = skillNum + 1 end + if num % 8 == 0 then skillNum = skillNum + 1 end + + for i = 1, skillNum do + self:doCost(event, target, player, data) + end + end, + can_trigger = function(self, event, target, player, data) + if player:hasSkill(self.name) and target == player then + local num = player:getMark("@qinzheng") + + return num % 3 == 0 or num % 5 == 0 or num % 8 == 0 + end + end, on_use = function(self, event, player, target, data) - player.room:addPlayerMark(player, "@qinzheng", 1) - local randCard = function(cardName) local cardNum = #player.room.draw_pile local randNum = math.random(1, cardNum) @@ -732,6 +750,14 @@ local qinzheng = fk.CreateTriggerSkill{ end end end, + + refresh_events = {fk.AfterCardUseDeclared, fk.CardResponding}, + can_refresh = function(self, event, target, player, data) + return player:hasSkill(self.name) and target == player + end, + on_refresh = function(self, event, target, player, data) + player.room:addPlayerMark(player, "@qinzheng", 1) + end, } local luotong = General:new(extension, "luotong", "wu", 4) -- Gitee From ad0ccacc54ef54a86f2985ee1240ced2e0cb20f1 Mon Sep 17 00:00:00 2001 From: Diuse <1754798088@qq.com> Date: Fri, 17 Mar 2023 21:05:21 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AA=86=E7=BB=9F?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=91=B8=E7=89=8CBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index 702a6fd..d70981a 100644 --- a/init.lua +++ b/init.lua @@ -698,7 +698,20 @@ local qinzheng = fk.CreateTriggerSkill{ if player:hasSkill(self.name) and target == player then local num = player:getMark("@qinzheng") - return num % 3 == 0 or num % 5 == 0 or num % 8 == 0 + if num % 3 == 0 then + self.cost_data = 3 + return true + end + + if num % 5 == 0 then + self.cost_data = 5 + return true + end + + if num % 8 == 0 then + self.cost_data = 8 + return true + end end end, on_use = function(self, event, player, target, data) @@ -726,23 +739,19 @@ local qinzheng = fk.CreateTriggerSkill{ end local num = player:getMark("@qinzheng") - if num % 3 == 0 then + if self.cost_data == 3 then local card = randCard({"slash", "jink"}) if card ~= nil then player.room:obtainCard(player.id, card, true, fk.ReasonPrey) end - end - - if num % 5 == 0 then + elseif self.cost_data == 5 then local card = randCard({"peach", "analeptic"}) if card ~= nil then player.room:obtainCard(player.id, card, true, fk.ReasonPrey) end - end - - if num % 8 == 0 then + else local card = randCard({"ex_nihilo", "duel"}) if card ~= nil then -- Gitee From 3370fa61a33cf5d943e002b18bd9fb6551705a21 Mon Sep 17 00:00:00 2001 From: Diuse <1754798088@qq.com> Date: Fri, 17 Mar 2023 21:29:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AA=86=E7=BB=9FBUG(?= =?UTF-8?q?=E5=B8=8C=E6=9C=9B=E6=98=AF=E6=9C=80=E5=90=8E=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/init.lua b/init.lua index d70981a..48df723 100644 --- a/init.lua +++ b/init.lua @@ -684,34 +684,20 @@ local qinzheng = fk.CreateTriggerSkill{ on_trigger = function(self, event, target, player, data) self.cancel_cost = false local num = player:getMark("@qinzheng") - local skillNum = 0 + local skillNum = {} - if num % 3 == 0 then skillNum = skillNum + 1 end - if num % 5 == 0 then skillNum = skillNum + 1 end - if num % 8 == 0 then skillNum = skillNum + 1 end + if num % 3 == 0 then table.insert(skillNum, 3) end + if num % 5 == 0 then table.insert(skillNum, 5) end + if num % 8 == 0 then table.insert(skillNum, 8) end - for i = 1, skillNum do + for _, i in ipairs(skillNum) do + self.cost_data = i self:doCost(event, target, player, data) end end, can_trigger = function(self, event, target, player, data) if player:hasSkill(self.name) and target == player then - local num = player:getMark("@qinzheng") - - if num % 3 == 0 then - self.cost_data = 3 - return true - end - - if num % 5 == 0 then - self.cost_data = 5 - return true - end - - if num % 8 == 0 then - self.cost_data = 8 - return true - end + return self.cost_data == 3 or self.cost_data == 5 or self.cost_data == 8 end end, on_use = function(self, event, player, target, data) @@ -743,19 +729,19 @@ local qinzheng = fk.CreateTriggerSkill{ local card = randCard({"slash", "jink"}) if card ~= nil then - player.room:obtainCard(player.id, card, true, fk.ReasonPrey) + player.room:obtainCard(player.id, card, true, fk.ReasonDraw) end elseif self.cost_data == 5 then local card = randCard({"peach", "analeptic"}) if card ~= nil then - player.room:obtainCard(player.id, card, true, fk.ReasonPrey) + player.room:obtainCard(player.id, card, true, fk.ReasonDraw) end else local card = randCard({"ex_nihilo", "duel"}) if card ~= nil then - player.room:obtainCard(player.id, card, true, fk.ReasonPrey) + player.room:obtainCard(player.id, card, true, fk.ReasonDraw) end end end, -- Gitee From 4502f5bb92cbcbad89853df3076299e98252e821 Mon Sep 17 00:00:00 2001 From: Diuse <1754798088@qq.com> Date: Fri, 17 Mar 2023 21:37:42 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- init.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/init.lua b/init.lua index 48df723..2fbb52b 100644 --- a/init.lua +++ b/init.lua @@ -723,7 +723,6 @@ local qinzheng = fk.CreateTriggerSkill{ return nil end - local num = player:getMark("@qinzheng") if self.cost_data == 3 then local card = randCard({"slash", "jink"}) -- Gitee