@@ -7,47 +7,43 @@ function s.initial_effect(c)
77 e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_FUSION_SUMMON )
88 e1 :SetType (EFFECT_TYPE_ACTIVATE )
99 e1 :SetCode (EVENT_FREE_CHAIN )
10- e1 :SetCondition (s .condition )
1110 e1 :SetTarget (s .target )
1211 e1 :SetOperation (s .activate )
1312 c :RegisterEffect (e1 )
1413end
15- function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
16- return Duel .GetFieldGroupCount (tp ,LOCATION_MZONE ,0 )== 0
17- end
18- function s .filter1 (c ,e )
14+ function s .matfilter (c ,e )
1915 return c :IsCanBeFusionMaterial () and c :IsAbleToRemove () and not c :IsImmuneToEffect (e ) and aux .SpElimFilter (c ,true )
2016end
21- function s .filter2 (c ,e ,tp ,m )
22- return c :IsType ( TYPE_FUSION ) and c :IsCanBeSpecialSummoned (e ,SUMMON_TYPE_FUSION ,tp ,false ,false )
17+ function s .fusfilter (c ,e ,tp ,m )
18+ return c :IsFusionMonster ( ) and c :IsCanBeSpecialSummoned (e ,SUMMON_TYPE_FUSION ,tp ,false ,false )
2319 and c :CheckFusionMaterial (m ,nil ,tp )
2420end
2521function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
2622 if chk == 0 then
27- local mg1 = Duel .GetMatchingGroup (s .filter1 ,tp ,0 ,LOCATION_MZONE |LOCATION_GRAVE ,nil ,e )
28- local res = Duel .IsExistingMatchingCard (s .filter2 ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,1 ,nil ,e ,tp ,mg1 )
23+ local mg1 = Duel .GetMatchingGroup (s .matfilter ,tp ,0 ,LOCATION_MZONE |LOCATION_GRAVE ,nil ,e )
24+ local res = Duel .IsExistingMatchingCard (s .fusfilter ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,1 ,nil ,e ,tp ,mg1 )
2925 if not res then
3026 local ce = Duel .GetChainMaterial (tp )
3127 if ce ~= nil then
3228 local fgroup = ce :GetTarget ()
3329 local mg2 = fgroup (ce ,e ,tp )
34- res = Duel .IsExistingMatchingCard (s .filter2 ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,1 ,nil ,e ,tp ,mg2 )
30+ res = Duel .IsExistingMatchingCard (s .fusfilter ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,1 ,nil ,e ,tp ,mg2 )
3531 end
3632 end
3733 return res
3834 end
3935 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_EXTRA )
4036end
4137function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
42- local mg1 = Duel .GetMatchingGroup (s .filter1 ,tp ,0 ,LOCATION_MZONE |LOCATION_GRAVE ,nil ,e )
43- local sg1 = Duel .GetMatchingGroup (s .filter2 ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,nil ,e ,tp ,mg1 )
38+ local mg1 = Duel .GetMatchingGroup (s .matfilter ,tp ,0 ,LOCATION_MZONE |LOCATION_GRAVE ,nil ,e )
39+ local sg1 = Duel .GetMatchingGroup (s .fusfilter ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,nil ,e ,tp ,mg1 )
4440 local mg2 = nil
4541 local sg2 = nil
4642 local ce = Duel .GetChainMaterial (tp )
4743 if ce ~= nil then
4844 local fgroup = ce :GetTarget ()
4945 mg2 = fgroup (ce ,e ,tp )
50- sg2 = Duel .GetMatchingGroup (s .filter2 ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,nil ,e ,tp ,mg2 )
46+ sg2 = Duel .GetMatchingGroup (s .fusfilter ,tp ,LOCATION_EXTRA ,LOCATION_EXTRA ,nil ,e ,tp ,mg2 )
5147 end
5248 if # sg1 > 0 or (sg2 ~= nil and # sg2 > 0 ) then
5349 local sg = sg1 :Clone ()
@@ -58,7 +54,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
5854 if sg1 :IsContains (tc ) and (sg2 == nil or not sg2 :IsContains (tc ) or not Duel .SelectYesNo (tp ,ce :GetDescription ())) then
5955 local mat1 = Duel .SelectFusionMaterial (tp ,tc ,mg1 ,nil ,tp )
6056 tc :SetMaterial (mat1 )
61- Duel .Remove (mat1 ,POS_FACEUP ,REASON_EFFECT + REASON_MATERIAL + REASON_FUSION )
57+ Duel .Remove (mat1 ,POS_FACEUP ,REASON_EFFECT | REASON_MATERIAL | REASON_FUSION )
6258 Duel .BreakEffect ()
6359 Duel .SpecialSummon (tc ,SUMMON_TYPE_FUSION ,tp ,tp ,false ,false ,POS_FACEUP )
6460 else
@@ -68,4 +64,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
6864 end
6965 tc :CompleteProcedure ()
7066 end
71- end
67+ end
0 commit comments