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

2023/8/15 添加特殊的融合素材手续

parent 1fdfdd9b
Pipeline #23129 passed with stages
in 6 minutes and 56 seconds
......@@ -3,7 +3,80 @@ RushDuel = RushDuel or {}
-- 添加 融合术/结合 素材
function RushDuel.AddFusionProcedure(card, ...)
Auxiliary.AddFusionProcMix(card, true, true, table.unpack({...}))
Auxiliary.AddFusionProcMix(card, true, true, ...)
end
-- 添加 融合术/结合 素材 (特殊的素材要求)
function RushDuel.AddFusionProcedureSP(card, matfilter, matcheck, min, max, insf, sub)
local insf = insf ~= false
local sub = sub ~= false
if not card:IsStatus(STATUS_COPYING_EFFECT) then
local e1 = Effect.CreateEffect(card)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(RushDuel.FusionProcCondition(matfilter, matcheck, min, max, insf, sub))
e1:SetOperation(RushDuel.FusionProcOperation(matfilter, matcheck, min, max, insf, sub))
card:RegisterEffect(e1)
end
end
function RushDuel.FusionProcCheck(sg, tp, fc, sub, chkfnf, matfilter, matcheck)
local chkf = chkfnf & 0xff
local concat_fusion = chkfnf & 0x200 > 0
if not concat_fusion and sg:IsExists(Auxiliary.TuneMagicianCheckX, 1, nil, sg, EFFECT_TUNE_MAGICIAN_F) then
return false
end
if not Auxiliary.MustMaterialCheck(sg, tp, EFFECT_MUST_BE_FMATERIAL) then
return false
end
Debug.Message(sg and sg:GetCount())
return RushDuel.FusionSubCheck(sg, fc, sub, matfilter) and matcheck(sg, tp, fc, chkf)
and (chkf == PLAYER_NONE or Duel.GetLocationCountFromEx(tp, tp, sg, fc) > 0)
and (not Auxiliary.FCheckAdditional or Auxiliary.FCheckAdditional(tp, sg, fc))
and (not Auxiliary.FGoalCheckAdditional or Auxiliary.FGoalCheckAdditional(tp, sg, fc))
end
function RushDuel.FusionSubCheck(sg, fc, sub, matfilter)
local ct = sg:FilterCount(matfilter, nil, fc, false)
if not sub then
return ct == sg:GetCount()
else
return ct >= sg:GetCount() - 1
end
end
function RushDuel.FusionProcCondition(matfilter, matcheck, min, max, insf, sub)
return function(e, g, gc, chkfnf)
if g == nil then
return insf and Auxiliary.MustMaterialCheck(nil, e:GetHandlerPlayer(), EFFECT_MUST_BE_FMATERIAL)
end
local c = e:GetHandler()
local tp = c:GetControler()
local notfusion = chkfnf & 0x100 > 0
local concat_fusion = chkfnf & 0x200 > 0
local sub = (sub or notfusion) and not concat_fusion
local mg = g:Filter(Auxiliary.FConditionFilterMix, c, c, sub, concat_fusion, matfilter)
if gc then
if not mg:IsContains(gc) then
return false
end
Duel.SetSelectedCard(Group.FromCards(gc))
end
return mg:CheckSubGroup(RushDuel.FusionProcCheck, min, max, tp, c, sub, chkfnf, matfilter, matcheck)
end
end
function RushDuel.FusionProcOperation(matfilter, matcheck, min, max, insf, sub)
return function(e, tp, eg, ep, ev, re, r, rp, gc, chkfnf)
local c = e:GetHandler()
local tp = c:GetControler()
local notfusion = chkfnf & 0x100 > 0
local concat_fusion = chkfnf & 0x200 > 0
local sub = (sub or notfusion) and not concat_fusion
local mg = eg:Filter(Auxiliary.FConditionFilterMix, c, c, sub, concat_fusion, matfilter)
if gc then
Duel.SetSelectedCard(Group.FromCards(gc))
end
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FMATERIAL)
local sg = mg:SelectSubGroup(tp, RushDuel.FusionProcCheck, false, min, max, tp, c, sub, chkfnf, matfilter, matcheck)
Duel.SetFusionMaterial(sg)
end
end
-- 创建效果: 融合术/结合 召唤
......
......@@ -4,23 +4,19 @@ local cm=_G["c"..m]
cm.name="青眼究极龙"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
local mt=getmetatable(c)
if mt.material==nil then
mat={}
mat[120120000]=true
mt.material=mat
end
if mt.material_count==nil then
mt.material_count={3,3}
if not c:IsStatus(STATUS_COPYING_EFFECT) then
local mt=getmetatable(c)
if mt.material==nil then
mat={}
mat[120120000]=true
mt.material=mat
end
if mt.material_count==nil then
mt.material_count={3,3}
end
end
--Fusion Material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
RD.AddFusionProcedureSP(c,cm.material,cm.check,2,3)
end
--Fusion Material
function cm.material(c,fc,sub)
......@@ -29,29 +25,6 @@ end
function cm.exfilter(c)
return c:IsHasEffect(120252004)
end
function cm.check(g,tp,fc,chkf,gc)
if not (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,g,fc)>0) then return false end
if gc and not g:IsContains(gc) then return false end
function cm.check(g,tp,fc,chkf)
return g:GetCount()==3 or g:IsExists(cm.exfilter,1,nil)
end
function cm.target(e,g,gc,chkfnf)
if g==nil then return Auxiliary.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=chkfnf&0x100>0
local concat_fusion=chkfnf&0x200>0
local sub=not concat_fusion
local mg=g:Filter(Auxiliary.FConditionFilterMix,c,c,sub,concat_fusion,cm.material)
return mg:CheckSubGroup(cm.check,2,3,tp,c,chkfnf,gc)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=chkfnf&0x100>0
local concat_fusion=chkfnf&0x200>0
local sub=not concat_fusion
local mg=eg:Filter(Auxiliary.FConditionFilterMix,c,c,sub,concat_fusion,cm.material)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:SelectSubGroup(tp,cm.check,false,2,3,tp,c,chkfnf,gc)
Duel.SetFusionMaterial(sg)
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