1+ -- 運命の介在
12-- Intervention of Fate
23local s ,id = GetID ()
34function s .initial_effect (c )
45 -- Activate
56 local e1 = Effect .CreateEffect (c )
67 e1 :SetDescription (aux .Stringid (id ,0 ))
78 e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
8- e1 :SetRange (LOCATION_HAND )
99 e1 :SetCode (EVENT_SUMMON_SUCCESS )
10- e1 :SetCondition (s .con )
11- e1 :SetCost (s .cost )
12- e1 :SetTarget (s .tg )
13- e1 :SetOperation (s .op )
10+ e1 :SetRange (LOCATION_HAND )
11+ e1 :SetCondition (function (e ,tp ,eg ) return eg :IsExists (aux .FilterEqualFunction (Card .GetSummonPlayer ,1 - tp ),1 ,nil ) end )
12+ e1 :SetCost (Cost .SelfToGrave )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .activate )
1415 c :RegisterEffect (e1 )
15- local e2 = e1 :Clone ()
16- e2 :SetCode (EVENT_FLIP_SUMMON_SUCCESS )
17- c :RegisterEffect (e2 )
18- local e3 = e1 :Clone ()
19- e3 :SetCode (EVENT_SPSUMMON_SUCCESS )
20- c :RegisterEffect (e3 )
21- end
22- function s .con (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
23- return eg :IsExists (aux .FilterEqualFunction (Card .GetSummonPlayer ,1 - tp ),1 ,nil )
24- end
25- function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
26- if chk == 0 then return e :GetHandler ():IsAbleToGraveAsCost () end
27- Duel .SendtoGrave (e :GetHandler (),REASON_COST )
2816end
2917function s .filter (c ,tp )
3018 local te = c :GetActivateEffect ()
@@ -36,12 +24,12 @@ function s.filter(c,tp)
3624 if type (prev )~= ' function' or prev (eff ,te ,tp ) then return false end
3725 end
3826 end
39- return c :GetType () == TYPE_SPELL and c :CheckActivateEffect (false ,false ,false )~= nil
27+ return c :IsNormalSpell () and c :CheckActivateEffect (false ,false ,false )~= nil
4028end
41- function s .tg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
29+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
4230 if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0 and Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_HAND ,0 ,1 ,nil ,tp ) end
4331end
44- function s .op (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
32+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
4533 local tc = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil ,tp ):GetFirst ()
4634 local tpe = tc :GetType ()
4735 local te = tc :GetActivateEffect ()
@@ -77,4 +65,4 @@ function s.op(e,tp,eg,ep,ev,re,r,rp)
7765 etc = g :GetNext ()
7866 end
7967 end
80- end
68+ end
0 commit comments