Commit 73c8dc8f authored by nanahira's avatar nanahira

sync

parent 5df48c67
...@@ -52,35 +52,35 @@ end ...@@ -52,35 +52,35 @@ end
function cm.flimit(tp,g,fc) function cm.flimit(tp,g,fc)
return not g:IsExists(Senya.NOT(Senya.check_fusion_set_3L),1,nil) return not g:IsExists(Senya.NOT(Senya.check_fusion_set_3L),1,nil)
end end
function cm.fcheck(c,mg,chkf) function cm.fcheck(c,mg)
aux.FCheckAdditional=cm.flimit aux.FCheckAdditional=cm.flimit
local res=c:CheckFusionMaterial(mg,nil,chkf) local res=c:CheckFusionMaterial(mg,nil,PLAYER_NONE)
aux.FCheckAdditional=nil aux.FCheckAdditional=nil
return res return res
end end
function cm.fselect(tp,tc,mg,chkf) function cm.fselect(tp,tc,mg)
aux.FCheckAdditional=cm.flimit aux.FCheckAdditional=cm.flimit
local g=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf) local g=Duel.SelectFusionMaterial(tp,tc,mg,nil,PLAYER_NONE)
aux.FCheckAdditional=nil aux.FCheckAdditional=nil
return g return g
end end
function cm.filter2(c,e,tp,m,f,chkf) function cm.filter2(c,e,tp,m,f)
return c:IsType(TYPE_FUSION) and Senya.check_set_3L(c) and (not f or f(c)) and c:GetLevel()==7 return c:IsType(TYPE_FUSION) and Senya.check_set_3L(c) and (not f or f(c)) and c:GetLevel()==7
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and cm.fcheck(c,m,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and cm.fcheck(c,m)
end end
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 if chk==0 then
local chkf=tp if Duel.GetLocationCountFromEx(tp)<=0 then return false end
local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil) local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil)
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(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf) res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf)
end end
end end
return res return res
...@@ -88,10 +88,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -88,10 +88,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
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 cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local chkf=tp
local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil,e) local mg1=Senya.GetFusionMaterial(tp,LOCATION_DECK,nil,cm.mfilter,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -99,7 +99,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -99,7 +99,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp) mg2=fgroup(ce,e,tp)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf) sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf)
end end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone() local sg=sg1:Clone()
...@@ -109,7 +109,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,7 +109,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=tg:GetFirst() local tc=tg:GetFirst()
tc:RegisterFlagEffect(m,RESET_CHAIN,0,1) tc:RegisterFlagEffect(m,RESET_CHAIN,0,1)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=cm.fselect(tp,tc,mg1,chkf) local mat1=cm.fselect(tp,tc,mg1)
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
...@@ -158,4 +158,4 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -158,4 +158,4 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
Senya.GainEffect_3L(fc,tc) Senya.GainEffect_3L(fc,tc)
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT) Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tc:GetControler()) end if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tc:GetControler()) 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