@@ -10,14 +10,13 @@ function s.initial_effect(c)
1010 e1 :SetType (EFFECT_TYPE_ACTIVATE )
1111 e1 :SetCode (EVENT_FREE_CHAIN )
1212 e1 :SetCountLimit (1 ,id ,EFFECT_COUNT_CODE_OATH )
13- e1 :SetCost (s .cost )
1413 e1 :SetTarget (s .target )
1514 e1 :SetOperation (s .activate )
1615 c :RegisterEffect (e1 )
1716 -- Add this card to hand if its activation is negated
1817 local e2 = Effect .CreateEffect (c )
19- e2 :SetCategory (CATEGORY_TOHAND )
2018 e2 :SetDescription (aux .Stringid (id ,1 ))
19+ e2 :SetCategory (CATEGORY_TOHAND )
2120 e2 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
2221 e2 :SetCode (EVENT_CHAIN_NEGATED )
2322 e2 :SetRange (LOCATION_GRAVE )
@@ -27,42 +26,8 @@ function s.initial_effect(c)
2726 e2 :SetTarget (s .thtg )
2827 e2 :SetOperation (s .thop )
2928 c :RegisterEffect (e2 )
30- local e3 = e2 :Clone ()
31- e3 :SetCode (EVENT_CUSTOM + id )
32- e3 :SetCondition (s .thcustomcond )
33- c :RegisterEffect (e3 )
3429end
3530s .listed_series = {SET_CYBER_DRAGON }
36- function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
37- if chk == 0 then return true end
38- if not e :IsHasType (EFFECT_TYPE_ACTIVATE ) then return end
39- -- Detect if this chain is negated
40- local e1 = Effect .CreateEffect (e :GetHandler ())
41- e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
42- e1 :SetCode (EVENT_CHAIN_NEGATED )
43- e1 :SetLabelObject (e )
44- e1 :SetOperation (s .negop )
45- e1 :SetReset (RESET_CHAIN )
46- Duel .RegisterEffect (e1 ,tp )
47- end
48- function s .negop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
49- local te = e :GetLabelObject ()
50- local de ,dp = Duel .GetChainInfo (ev ,CHAININFO_DISABLE_REASON ,CHAININFO_DISABLE_PLAYER )
51- if rp == tp and de and dp == 1 - tp and re == te then
52- -- Raise a custom event if the activation is negated
53- local e1 = Effect .CreateEffect (e :GetHandler ())
54- e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
55- e1 :SetCode (EVENT_CHAIN_END )
56- e1 :SetOperation (s .raisevent )
57- e1 :SetLabelObject (te )
58- Duel .RegisterEffect (e1 ,tp )
59- end
60- end
61- function s .raisevent (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
62- local te = e :GetLabelObject ()
63- Duel .RaiseEvent (te :GetHandler (),EVENT_CUSTOM + id ,te ,0 ,tp ,tp ,0 )
64- e :Reset ()
65- end
6631function s .filter (c )
6732 return c :IsMonster () and c :IsAbleToHand ()
6833 and (c :IsSetCard (SET_CYBER_DRAGON ) or (c :IsAttribute (ATTRIBUTE_LIGHT ) and c :IsRace (RACE_MACHINE ) and not c :IsSummonableCard ()))
@@ -80,6 +45,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
8045 end
8146end
8247function s .thcond (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
48+ local de ,dp = Duel .GetChainInfo (ev ,CHAININFO_DISABLE_REASON ,CHAININFO_DISABLE_PLAYER )
8349 return re :GetHandler ()== e :GetHandler () and re :IsHasType (EFFECT_TYPE_ACTIVATE ) and rp == tp and de and dp ~= tp
8450end
8551function s .thcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
@@ -97,8 +63,4 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
9763 Duel .SendtoHand (c ,nil ,REASON_EFFECT )
9864 Duel .ConfirmCards (1 - tp ,c )
9965 end
100- end
101- function s .thcustomcond (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
102- local c = e :GetHandler ()
103- return c == re :GetHandler () and c :GetReasonEffect ()== nil
10466end
0 commit comments