1+ -- ガガガガール-ゼロゼロコール
2+ -- Gagaga Girl - Cell Phone Subtraction
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- If your opponent Special Summons a monster(s) from the Extra Deck: You can target 1 face-up monster you control; Special Summon this card from your hand, then immediately after this effect resolves, Xyz Summon using only this card and the targeted monster. When you do, treat this card's Level as the same as the targeted monster's
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
11+ e1 :SetProperty (EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET )
12+ e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
13+ e1 :SetRange (LOCATION_HAND )
14+ e1 :SetCountLimit (1 ,{id ,0 })
15+ e1 :SetCondition (s .spcon )
16+ e1 :SetTarget (s .sptg )
17+ e1 :SetOperation (s .spop )
18+ c :RegisterEffect (e1 )
19+ -- If this card is detached from an Xyz Monster to activate that monster's effect: You can change the ATK of 1 face-up monster your opponent controls to 0
20+ local e2a = Effect .CreateEffect (c )
21+ e2a :SetDescription (aux .Stringid (id ,1 ))
22+ e2a :SetCategory (CATEGORY_ATKCHANGE )
23+ e2a :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
24+ e2a :SetProperty (EFFECT_FLAG_DELAY )
25+ e2a :SetCode (EVENT_TO_GRAVE )
26+ e2a :SetCountLimit (1 ,{id ,1 })
27+ e2a :SetCondition (s .atkcon )
28+ e2a :SetTarget (s .atktg )
29+ e2a :SetOperation (s .atkop )
30+ c :RegisterEffect (e2a )
31+ local e2b = e2a :Clone ()
32+ e2b :SetCode (EVENT_REMOVE )
33+ c :RegisterEffect (e2b )
34+ end
35+ function s .spconfilter (c ,opp )
36+ return c :IsSummonPlayer (opp ) and c :IsSummonLocation (LOCATION_EXTRA )
37+ end
38+ function s .spcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
39+ return eg :IsExists (s .spconfilter ,1 ,nil ,1 - tp )
40+ end
41+ function s .tgfilter (c ,tp ,hc )
42+ if not (c :IsFaceup () and c :HasLevel ()) then return false end
43+ -- When you do, treat this card's Level as the same as the targeted monster's
44+ local e1 = Effect .CreateEffect (hc )
45+ e1 :SetType (EFFECT_TYPE_SINGLE )
46+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
47+ e1 :SetCode (EFFECT_XYZ_LEVEL )
48+ e1 :SetValue (c :GetLevel ())
49+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
50+ hc :RegisterEffect (e1 ,true )
51+ local res = Duel .IsExistingMatchingCard (Card .IsXyzSummonable ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ,nil ,Group .FromCards (c ,hc ),2 ,2 )
52+ if e1 then e1 :Reset () end
53+ return res
54+ end
55+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
56+ local c = e :GetHandler ()
57+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsControler (tp ) and s .tgfilter (chkc ,tp ,c ) end
58+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
59+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
60+ and Duel .IsPlayerCanSpecialSummonCount (tp ,2 )
61+ and Duel .IsExistingTarget (s .tgfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ,tp ,c ) end
62+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
63+ local g = Duel .SelectTarget (tp ,s .tgfilter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil ,tp ,c )
64+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
65+ end
66+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
67+ local c = e :GetHandler ()
68+ local tc = Duel .GetFirstTarget ()
69+ if c :IsRelateToEffect (e ) and Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 and tc :IsRelateToEffect (e ) and tc :IsFaceup () then
70+ local mg = Group .FromCards (c ,tc )
71+ -- When you do, treat this card's Level as the same as the targeted monster's
72+ local e1 = Effect .CreateEffect (c )
73+ e1 :SetType (EFFECT_TYPE_SINGLE )
74+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
75+ e1 :SetCode (EFFECT_XYZ_LEVEL )
76+ e1 :SetValue (tc :GetLevel ())
77+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
78+ c :RegisterEffect (e1 ,true )
79+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
80+ local xyz = Duel .SelectMatchingCard (tp ,Card .IsXyzSummonable ,tp ,LOCATION_EXTRA ,0 ,1 ,1 ,nil ,nil ,mg ,2 ,2 ):GetFirst ()
81+ if xyz then
82+ Duel .XyzSummon (tp ,xyz ,mg ,nil ,2 ,2 )
83+ else
84+ if e1 then e1 :Reset () end
85+ end
86+ end
87+ end
88+ function s .atkcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
89+ local c = e :GetHandler ()
90+ return c :IsReason (REASON_COST ) and re :IsActivated () and re :IsActiveType (TYPE_XYZ ) and c :IsPreviousLocation (LOCATION_OVERLAY )
91+ end
92+ function s .atktg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
93+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .HasNonZeroAttack ,tp ,0 ,LOCATION_MZONE ,1 ,nil ) end
94+ Duel .SetOperationInfo (0 ,CATEGORY_ATKCHANGE ,nil ,1 ,1 - tp ,0 )
95+ end
96+ function s .atkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
97+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATKDEF )
98+ local sc = Duel .SelectMatchingCard (tp ,Card .HasNonZeroAttack ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil ):GetFirst ()
99+ if sc then
100+ Duel .HintSelection (sc )
101+ -- Its ATK becomes 0
102+ local e1 = Effect .CreateEffect (e :GetHandler ())
103+ e1 :SetType (EFFECT_TYPE_SINGLE )
104+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
105+ e1 :SetCode (EFFECT_SET_ATTACK_FINAL )
106+ e1 :SetValue (0 )
107+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
108+ sc :RegisterEffect (e1 )
109+ end
110+ end
0 commit comments