Commit d017cca6 authored by 未闻皂名's avatar 未闻皂名

2024/11/7 新增:KP19新卡,宣言融合素材逻辑修改

parent 76268a04
Pipeline #31017 passed with stages
in 11 minutes and 30 seconds
No preview for this file type
No preview for this file type
...@@ -160,6 +160,21 @@ function RushDuel.SetFusionMaterial(card, codes, min, max) ...@@ -160,6 +160,21 @@ function RushDuel.SetFusionMaterial(card, codes, min, max)
RushDuel._private_set_fusion_material_data(card, mat, min, max) RushDuel._private_set_fusion_material_data(card, mat, min, max)
end end
-- 手动添加传说卡融合素材列表
function RushDuel.SetFusionLegendMaterial(card, codes, descs)
if card:IsStatus(STATUS_COPYING_EFFECT) then
return
end
local mt = getmetatable(card)
if mt.legend_material_codes == nil then
local legends = {}
for i in ipairs(codes) do
table.insert(legends, {codes[i], descs[i]})
end
mt.legend_material_codes = legends
end
end
-- 获取融合素材的卡名 -- 获取融合素材的卡名
function RushDuel.GetFusionMaterialCodes(card) function RushDuel.GetFusionMaterialCodes(card)
return card.material_codes or {} return card.material_codes or {}
...@@ -423,3 +438,36 @@ end ...@@ -423,3 +438,36 @@ end
function RushDuel.ContactFusionMaterialFilter(card) function RushDuel.ContactFusionMaterialFilter(card)
return card:IsFaceup() and card:IsAbleToDeckOrExtraAsCost() return card:IsFaceup() and card:IsAbleToDeckOrExtraAsCost()
end end
-- 宣言融合素材的卡名
function RushDuel.AnnounceFusionMaterialCode(player, card)
local legends = card.legend_material_codes or {}
local codes = card.material_codes or {}
local normal_count = #codes - #legends
local type = 0
if normal_count == 0 then
-- 只有传说怪兽素材
type = 2
elseif #legends == 0 then
-- 只有常规怪兽素材
type = 1
elseif #codes > 0 then
-- 选择宣言的种类
type = Duel.SelectOption(player, aux.Stringid(120000001, 0), aux.Stringid(120000001, 1)) + 1
end
if type == 1 then
-- 宣言常规怪兽
return RushDuel.AnnounceCodes(player, codes)
elseif type == 2 then
-- 宣言传说怪兽
local legend, desc = {}, {}
for _, value in ipairs(legends) do
table.insert(legend, value[1])
table.insert(desc, value[2])
end
Duel.Hint(HINT_SELECTMSG, player, HINTMSG_CODE)
local index = Duel.SelectOption(player, table.unpack(desc)) + 1
return legend[index]
end
return nil
end
...@@ -6,4 +6,5 @@ function cm.initial_effect(c) ...@@ -6,4 +6,5 @@ function cm.initial_effect(c)
RD.AddCodeList(c,list) RD.AddCodeList(c,list)
--Fusion Material --Fusion Material
RD.AddFusionProcedure(c,list[1],list[2]) RD.AddFusionProcedure(c,list[1],list[2])
RD.SetFusionLegendMaterial(c,{list[1]},{aux.Stringid(m,1)})
end end
\ No newline at end of file
...@@ -6,4 +6,5 @@ function cm.initial_effect(c) ...@@ -6,4 +6,5 @@ function cm.initial_effect(c)
RD.AddCodeList(c,list) RD.AddCodeList(c,list)
--Fusion Material --Fusion Material
RD.AddFusionProcedure(c,list[1],list[2]) RD.AddFusionProcedure(c,list[1],list[2])
RD.SetFusionLegendMaterial(c,{list[1]},{aux.Stringid(m,1)})
end end
\ No newline at end of file
...@@ -7,6 +7,7 @@ function cm.initial_effect(c) ...@@ -7,6 +7,7 @@ function cm.initial_effect(c)
--Fusion Material --Fusion Material
RD.AddFusionProcedureSP(c,cm.matfilter,cm.check,2,3) RD.AddFusionProcedureSP(c,cm.matfilter,cm.check,2,3)
RD.SetFusionMaterial(c,{list[1]},3,3) RD.SetFusionMaterial(c,{list[1]},3,3)
RD.SetFusionLegendMaterial(c,{list[1]},{aux.Stringid(m,1)})
end end
--Fusion Material --Fusion Material
function cm.matfilter(c,fc,sub) function cm.matfilter(c,fc,sub)
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
RD.AddCodeList(c,list) RD.AddCodeList(c,list)
--Fusion Material --Fusion Material
RD.AddFusionProcedure(c,list[1],list[2]) RD.AddFusionProcedure(c,list[1],list[2])
RD.SetFusionLegendMaterial(c,{list[1]},{aux.Stringid(m,3)})
--Indes --Indes
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
RD.AddCodeList(c,list) RD.AddCodeList(c,list)
--Fusion Material --Fusion Material
RD.AddFusionProcedure(c,list[1],list[2]) RD.AddFusionProcedure(c,list[1],list[2])
RD.SetFusionLegendMaterial(c,{list[1]},{aux.Stringid(m,3)})
--Atk Up --Atk Up
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
......
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
RD.AddCodeList(c,list) RD.AddCodeList(c,list)
--Fusion Material --Fusion Material
RD.AddFusionProcedure(c,list[1],list[2]) RD.AddFusionProcedure(c,list[1],list[2])
RD.SetFusionLegendMaterial(c,{list[1],list[2]},{aux.Stringid(m,3),aux.Stringid(m,4)})
--Atk Up --Atk Up
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
......
...@@ -6,4 +6,5 @@ function cm.initial_effect(c) ...@@ -6,4 +6,5 @@ function cm.initial_effect(c)
RD.AddCodeList(c,list) RD.AddCodeList(c,list)
--Fusion Material --Fusion Material
RD.AddFusionProcedure(c,list[1],list[2]) RD.AddFusionProcedure(c,list[1],list[2])
RD.SetFusionLegendMaterial(c,{list[1],list[2]},{aux.Stringid(m,1),aux.Stringid(m,2)})
end end
\ No newline at end of file
...@@ -6,6 +6,7 @@ function cm.initial_effect(c) ...@@ -6,6 +6,7 @@ function cm.initial_effect(c)
RD.AddCodeList(c,list) RD.AddCodeList(c,list)
--Fusion Material --Fusion Material
RD.AddFusionProcedure(c,list[1],cm.matfilter) RD.AddFusionProcedure(c,list[1],cm.matfilter)
RD.SetFusionLegendMaterial(c,{list[1]},{aux.Stringid(m,3)})
--Atk Up --Atk Up
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
......
...@@ -21,8 +21,7 @@ cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst) ...@@ -21,8 +21,7 @@ cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
local codes=RD.GetFusionMaterialCodes(tc) local ac=RD.AnnounceFusionMaterialCode(tp,tc)
local ac=RD.AnnounceCodes(tp,codes)
Duel.SetTargetParam(ac) Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end end
......
local m=120272010
local list={120196021,120257024}
local cm=_G["c"..m]
cm.name="道星魔剑士"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Change Code
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Change Code
function cm.spfilter(c,e,tp)
return c:IsCode(list[2]) and RD.IsCanBeSpecialSummoned(c,e,tp,POS_FACEUP)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsCode(list[1])
end
cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.ChangeCode(e,c,list[1],RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
RD.CanSelectAndSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP,true)
end
end
\ No newline at end of file
local m=120272042
local list={120105001,120196021}
local cm=_G["c"..m]
cm.name="道星暗变机齿车"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Contact Fusion
RD.EnableContactFusion(c,aux.Stringid(m,0))
--Multi-Choose Effect
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,2),cm.target1,cm.operation1,aux.Stringid(m,3),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_ATKCHANGE)
end
--Multi-Choose Effect
cm.cost=RD.CostSendDeckTopToGrave(1)
--Atk Down
function cm.atkfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER) and c:IsLevelAbove(1)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_GRAVE,0,nil)
local val=g:GetClassCount(Card.GetLevel)*400
RD.SelectAndDoAction(aux.Stringid(m,4),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
RD.AttachAtkDef(e,sg:GetFirst(),-val,-val,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end)
end
--Pierce
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsAbleToEnterBP() and RD.IsCanAttachPierce(e:GetHandler()) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachPierce(e,c,aux.Stringid(m,5),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end
\ No newline at end of file
local m=120272065
local cm=_G["c"..m]
cm.name="元素英雄 棱镜侠"
function cm.initial_effect(c)
--Change Code
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Change Code
function cm.costfilter(c)
local codes=RD.GetFusionMaterialCodes(c)
return c:IsType(TYPE_FUSION) and #codes>0
end
cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject()
local ac=RD.AnnounceFusionMaterialCode(tp,tc)
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
RD.ChangeCode(e,c,ac,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment