1+ -- エクシーズ・ダブル・バック (Anime)
2+ -- Xyz Double Back (Anime)
3+ local s ,id = GetID ()
4+ function s .initial_effect (c )
5+ -- Activate
6+ local e1 = Effect .CreateEffect (c )
7+ e1 :SetDescription (aux .Stringid (id ,0 ))
8+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
9+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DAMAGE_STEP )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_DESTROYED )
12+ e1 :SetCondition (s .condition )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .activate )
15+ c :RegisterEffect (e1 )
16+ end
17+ function s .cfilter (c ,tp )
18+ return c :IsType (TYPE_XYZ ) and c :IsReason (REASON_BATTLE + REASON_EFFECT ) and c :GetPreviousControler ()== tp
19+ end
20+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
21+ return eg :IsExists (s .cfilter ,1 ,nil ,tp )
22+ end
23+ function s .filter1 (c ,e ,tp ,turn )
24+ return c :IsType (TYPE_XYZ ) and c :IsReason (REASON_DESTROY ) and c :IsPreviousControler (tp ) and c :IsPreviousLocation (LOCATION_MZONE )
25+ and c :IsPreviousPosition (POS_FACEUP ) and c :GetTurnID ()== turn and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
26+ and Duel .IsExistingTarget (s .filter2 ,tp ,LOCATION_GRAVE ,0 ,1 ,c ,e ,tp ,c :GetAttack ())
27+ end
28+ function s .filter2 (c ,e ,tp ,atk )
29+ return c :IsAttackBelow (atk ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
30+ end
31+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
32+ if chkc then return false end
33+ if chk == 0 then return not Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT )
34+ and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 1
35+ and Duel .IsExistingTarget (s .filter1 ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ,Duel .GetTurnCount ()) end
36+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
37+ local g1 = Duel .SelectTarget (tp ,s .filter1 ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp ,Duel .GetTurnCount ())
38+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
39+ local g2 = Duel .SelectTarget (tp ,s .filter2 ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,g1 :GetFirst (),e ,tp ,g1 :GetFirst ():GetAttack ())
40+ g1 :Merge (g2 )
41+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g1 ,2 ,0 ,0 )
42+ end
43+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
44+ if Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then return end
45+ local g = Duel .GetTargetCards (e )
46+ if # g ~= 2 or Duel .GetLocationCount (tp ,LOCATION_MZONE )< 2 then return end
47+ local fid = e :GetHandler ():GetFieldID ()
48+ local tc = g :GetFirst ()
49+ for tc in aux .Next (g ) do
50+ if Duel .SpecialSummonStep (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP ) then
51+ tc :RegisterFlagEffect (id ,RESET_EVENT |RESETS_STANDARD ,0 ,1 ,fid )
52+ end
53+ end
54+ Duel .SpecialSummonComplete ()
55+ g :KeepAlive ()
56+ local e1 = Effect .CreateEffect (e :GetHandler ())
57+ e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
58+ e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE )
59+ e1 :SetCode (EVENT_PHASE + PHASE_END )
60+ e1 :SetCountLimit (1 )
61+ e1 :SetLabel (Duel .GetTurnCount ())
62+ e1 :SetCondition (s .descon )
63+ e1 :SetOperation (s .desop )
64+ e1 :SetLabelObject (g )
65+ e1 :SetReset (RESET_PHASE + PHASE_END + RESET_SELF_TURN ,2 )
66+ Duel .RegisterEffect (e1 ,tp )
67+ end
68+ function s .descon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
69+ return Duel .GetTurnCount ()~= e :GetLabel () and Duel .GetTurnPlayer ()== tp
70+ end
71+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
72+ local tc = e :GetLabelObject ()
73+ Duel .Hint (HINT_CARD ,0 ,id )
74+ Duel .Destroy (tc ,REASON_EFFECT )
75+ end
0 commit comments