Commit f63c954e authored by wind2009's avatar wind2009

Fix 二重融合

parent 287c71ec
Pipeline #30247 passed with stages
in 2 minutes
...@@ -23,25 +23,26 @@ function s.filter2(c,e,tp,m,f,chkf) ...@@ -23,25 +23,26 @@ function s.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.fcon(e,tp)
if chk==0 then local chkf=tp
local chkf=tp local mg1=Duel.GetFusionMaterial(tp)
local mg1=Duel.GetFusionMaterial(tp) local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) if not res then
if not res then local ce=Duel.GetChainMaterial(tp)
local ce=Duel.GetChainMaterial(tp) if ce~=nil then
if ce~=nil then local fgroup=ce:GetTarget()
local fgroup=ce:GetTarget() local mg2=fgroup(ce,e,tp)
local mg2=fgroup(ce,e,tp) local mf=ce:GetValue()
local mf=ce:GetValue() res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end end
return res
end end
return res
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return s.fcon(e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.fop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
...@@ -72,15 +73,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,15 +73,13 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
end end
tc:CompleteProcedure() tc:CompleteProcedure()
local mg2=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e) return 1
if Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,nil,chkf) end
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then return 0
local tc2=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg2,nil,chkf):GetFirst() end
local mat2=Duel.SelectFusionMaterial(tp,tc2,mg2,nil,chkf) function s.activate(e,tp,eg,ep,ev,re,r,rp)
tc2:SetMaterial(mat2) if s.fop(e,tp,eg,ep,ev,re,r,rp)>0 and s.fcon(e,tp) and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.BreakEffect()
Duel.BreakEffect() s.fop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc2,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
end
end end
end end
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