@@ -23,15 +23,14 @@ function s.initial_effect(c)
2323 e2 :SetType (EFFECT_TYPE_IGNITION )
2424 e2 :SetRange (LOCATION_GRAVE )
2525 e2 :SetCountLimit (1 ,{id ,1 })
26- e2 :SetCost (s .cost )
2726 e2 :SetTarget (s .target )
2827 e2 :SetOperation (s .operation )
2928 c :RegisterEffect (e2 )
3029end
3130s .listed_names = {id }
32- s .listed_series = {0x128 }
31+ s .listed_series = {SET_WITCHCRAFTER }
3332function s .spfilter (c ,e ,tp )
34- return c :IsSetCard (0x128 ) and not c :IsCode (id ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
33+ return c :IsSetCard (SET_WITCHCRAFTER ) and not c :IsCode (id ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
3534end
3635function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
3736 if chk == 0 then return Duel .GetMZoneCount (tp ,e :GetHandler ())> 0
@@ -46,86 +45,39 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
4645 Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
4746 end
4847end
49- function s .filter (c )
50- return c :IsSetCard (0x128 ) and c :IsSpell () and c :IsAbleToRemoveAsCost ()
51- and c :CheckActivateEffect (false ,true ,false )~= nil and c :CheckActivateEffect (false ,true ,false ):GetOperation ()~= nil
52- end
53- function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
54- local c = e :GetHandler ()
55- local chain = Duel .GetCurrentChain ()
56- if chk == 0 then return c :IsAbleToRemoveAsCost ()
57- and Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ,chk ,chain ) end
58- chain = chain - 1
59- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
60- local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp ,chk ,chain )
61- local te ,teg ,tep ,tev ,tre ,tr ,trp = g :GetFirst ():CheckActivateEffect (false ,true ,true )
62- if not te then te = g :GetFirst ():GetActivateEffect () end
63- if te :GetCode ()== EVENT_CHAINING then
64- if chain <= 0 then return false end
65- local te2 ,p = Duel .GetChainInfo (chain ,CHAININFO_TRIGGERING_EFFECT ,CHAININFO_TRIGGERING_PLAYER )
66- local tc = te2 :GetHandler ()
67- local g = Group .FromCards (tc )
68- teg ,tep ,tev ,tre ,tr ,trp = g ,p ,chain ,te2 ,REASON_EFFECT ,p
69- end
70- s [Duel .GetCurrentChain ()]= te
71- g :AddCard (c )
72- Duel .Remove (g ,POS_FACEUP ,REASON_COST )
73- e :SetTarget (s .targetchk (teg ,tep ,tev ,tre ,tr ,trp ))
74- e :SetOperation (s .operationchk (teg ,tep ,tev ,tre ,tr ,trp ))
75- local e1 = Effect .CreateEffect (e :GetHandler ())
76- e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
77- e1 :SetCode (EVENT_CHAIN_SOLVED )
78- e1 :SetReset (RESET_CHAIN )
79- e1 :SetLabelObject (e )
80- e1 :SetOperation (s .resetop )
81- Duel .RegisterEffect (e1 ,tp )
82- end
83- function s .targetchk (teg ,tep ,tev ,tre ,tr ,trp )
84- return function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
85- local te = s [Duel .GetCurrentChain ()]
86- if chkc then
87- local tg = te :GetTarget ()
88- return tg (e ,tp ,teg ,tep ,tev ,tre ,tr ,trp ,0 ,true )
89- end
90- if chk == 0 then return true end
91- if not te then return end
92- e :SetCategory (te :GetCategory ())
93- e :SetProperty (te :GetProperty ())
94- local tg = te :GetTarget ()
95- if tg then tg (e ,tp ,teg ,tep ,tev ,tre ,tr ,trp ,1 ) end
96- end
97- end
98- function s .operationchk (teg ,tep ,tev ,tre ,tr ,trp )
99- return function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
100- local te = s [Duel .GetCurrentChain ()]
101- if not te then return end
102- local op = te :GetOperation ()
103- if op then op (e ,tp ,teg ,tep ,tev ,tre ,tr ,trp ) end
104- end
105- end
106- function s .resetop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
107- local te = e :GetLabelObject ()
108- if te then
109- te :SetTarget (s .target )
110- te :SetOperation (s .operation )
111- end
48+ function s .copyfilter (c )
49+ return c :IsSetCard (SET_WITCHCRAFTER ) and c :IsSpell () and c :IsAbleToRemoveAsCost ()
50+ and c :CheckActivateEffect (false ,true ,false )~= nil
51+ and c :CheckActivateEffect (false ,true ,false ):GetOperation ()~= nil
11252end
11353function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
114- local te = s [Duel .GetCurrentChain ()]
11554 if chkc then
116- local tg = te : GetTarget ()
117- return tg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 ,true )
55+ local te = e : GetLabelObject ()
56+ return tg and tg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 ,chkc )
11857 end
119- if chk == 0 then return true end
120- if not te then return end
121- e :SetProperty (te :GetProperty ())
58+ local c = e :GetHandler ()
59+ if chk == 0 then return c :IsAbleToRemoveAsCost () and Duel .IsExistingMatchingCard (s .copyfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ) end
60+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
61+ local g = Duel .SelectMatchingCard (tp ,s .copyfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
62+ Duel .Remove (Group .FromCards (tc ,c ),POS_FACEUP ,REASON_COST )
63+ local te = g :GetFirst ():CheckActivateEffect (true ,true ,false )
64+ e :SetLabel (te :GetLabel ())
65+ e :SetLabelObject (te :GetLabelObject ())
12266 local tg = te :GetTarget ()
12367 if tg then tg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,1 ) end
68+ te :SetLabel (e :GetLabel ())
69+ te :SetLabelObject (e :GetLabelObject ())
70+ e :SetLabelObject (te )
12471 Duel .ClearOperationInfo (0 )
12572end
12673function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
127- local te = s [Duel .GetCurrentChain ()]
128- if not te then return end
129- local op = te :GetOperation ()
130- if op then op (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) end
74+ local te = e :GetLabelObject ()
75+ if te then
76+ e :SetLabel (te :GetLabel ())
77+ e :SetLabelObject (te :GetLabelObject ())
78+ local op = te :GetOperation ()
79+ if op then op (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) end
80+ te :SetLabel (e :GetLabel ())
81+ te :SetLabelObject (e :GetLabelObject ())
82+ end
13183end
0 commit comments