33-- Scripted by ahtelel
44local s ,id = GetID ()
55function s .initial_effect (c )
6- -- Special Summon 1 "Witchcrafter" from your Deck
6+ -- Special Summon 1 "Witchcrafter" monster from your Deck
77 local e1 = Effect .CreateEffect (c )
88 e1 :SetDescription (aux .Stringid (id ,0 ))
99 e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
1010 e1 :SetType (EFFECT_TYPE_QUICK_O )
1111 e1 :SetCode (EVENT_FREE_CHAIN )
1212 e1 :SetRange (LOCATION_MZONE )
1313 e1 :SetCountLimit (1 ,id )
14- e1 :SetHintTiming (0 ,TIMING_MAIN_END )
14+ e1 :SetHintTiming (0 ,TIMING_MAIN_END | TIMINGS_CHECK_MONSTER )
1515 e1 :SetCondition (function () return Duel .IsMainPhase () end )
1616 e1 :SetCost (aux .WitchcrafterDiscardAndReleaseCost )
1717 e1 :SetTarget (s .sptg )
@@ -23,8 +23,8 @@ function s.initial_effect(c)
2323 e2 :SetType (EFFECT_TYPE_IGNITION )
2424 e2 :SetRange (LOCATION_GRAVE )
2525 e2 :SetCountLimit (1 ,{id ,1 })
26- e2 :SetTarget (s .target )
27- e2 :SetOperation (s .operation )
26+ e2 :SetTarget (s .efftg )
27+ e2 :SetOperation (s .effop )
2828 c :RegisterEffect (e2 )
2929end
3030s .listed_names = {id }
@@ -47,37 +47,30 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
4747end
4848function s .copyfilter (c )
4949 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
50+ and c :CheckActivateEffect (true ,true ,false )~= nil
51+ and c :CheckActivateEffect (true ,true ,false ):GetOperation ()~= nil
5252end
53- function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
54- if chkc then
55- local te = e :GetLabelObject ()
56- return tg and tg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 ,chkc )
57- end
53+ function s .efftg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
5854 local c = e :GetHandler ()
5955 if chk == 0 then return c :IsAbleToRemoveAsCost () and Duel .IsExistingMatchingCard (s .copyfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ) end
6056 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
61- local tc = Duel .SelectMatchingCard (tp ,s .copyfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ):GetFirst ()
62- Duel .Remove (Group .FromCards (tc ,c ),POS_FACEUP ,REASON_COST )
63- local te = tc :CheckActivateEffect (true ,true ,false )
64- e :SetLabel (te :GetLabel ())
65- e :SetLabelObject (te :GetLabelObject ())
57+ local sc = Duel .SelectTarget (tp ,s .copyfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ):GetFirst ()
58+ Duel .Remove (Group .FromCards (sc ,c ),POS_FACEUP ,REASON_COST )
59+ local te ,ceg ,cep ,cev ,cre ,cr ,crp = sc :CheckActivateEffect (false ,true ,true )
60+ Duel .ClearTargetCard ()
6661 local tg = te :GetTarget ()
67- if tg then tg ( e , tp , eg , ep , ev , re , r , rp , 1 ) end
68- te : SetLabel ( e : GetLabel ())
62+ e : SetProperty ( te : GetProperty ())
63+ if tg then tg ( e , tp , ceg , cep , cev , cre , cr , crp , 1 ) end
6964 te :SetLabelObject (e :GetLabelObject ())
7065 e :SetLabelObject (te )
7166 Duel .ClearOperationInfo (0 )
7267end
73- function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
68+ function s .effop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
7469 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 ())
70+ if not te then return end
71+ e :SetLabelObject (te :GetLabelObject ())
72+ local op = te :GetOperation ()
73+ if op then
74+ op (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
8275 end
83- end
76+ end
0 commit comments