1+ -- DDスケール・サーベイヤー
2+ -- D/D Scale Surveyor
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Pendulum Summon procedure
7+ Pendulum .AddProcedure (c )
8+ -- Change up to 2 Pendulum Scales to 0
9+ local e1 = Effect .CreateEffect (c )
10+ e1 :SetDescription (aux .Stringid (id ,0 ))
11+ e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
12+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
13+ e1 :SetCode (EVENT_PHASE + PHASE_STANDBY )
14+ e1 :SetRange (LOCATION_PZONE )
15+ e1 :SetCountLimit (1 ,id )
16+ e1 :SetTarget (s .scaletg )
17+ e1 :SetOperation (s .scaleop )
18+ c :RegisterEffect (e1 )
19+ -- Special Summon this card from your hand
20+ local e2 = Effect .CreateEffect (c )
21+ e2 :SetDescription (aux .Stringid (id ,1 ))
22+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
23+ e2 :SetType (EFFECT_TYPE_IGNITION )
24+ e2 :SetRange (LOCATION_HAND )
25+ e2 :SetCountLimit (1 ,{id ,1 })
26+ e2 :SetCondition (s .spcon )
27+ e2 :SetTarget (s .sptg )
28+ e2 :SetOperation (s .spop )
29+ c :RegisterEffect (e2 )
30+ -- Make this card's Level become 4
31+ local e3 = Effect .CreateEffect (c )
32+ e3 :SetDescription (aux .Stringid (id ,2 ))
33+ e3 :SetCategory (CATEGORY_LVCHANGE )
34+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
35+ e3 :SetProperty (EFFECT_FLAG_DELAY )
36+ e3 :SetCode (EVENT_SUMMON_SUCCESS )
37+ e3 :SetCountLimit (1 ,{id ,2 })
38+ e3 :SetTarget (s .lvtg )
39+ e3 :SetOperation (s .lvop )
40+ c :RegisterEffect (e3 )
41+ local e4 = e3 :Clone ()
42+ e4 :SetCode (EVENT_SPSUMMON_SUCCESS )
43+ c :RegisterEffect (e4 )
44+ -- Return 1 "D/D" Pendulum Monster Card you control to the hand
45+ local e5 = Effect .CreateEffect (c )
46+ e5 :SetDescription (aux .Stringid (id ,3 ))
47+ e5 :SetCategory (CATEGORY_TOHAND )
48+ e5 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
49+ e5 :SetProperty (EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET )
50+ e5 :SetCode (EVENT_TO_GRAVE )
51+ e5 :SetCountLimit (1 ,{id ,3 })
52+ e5 :SetTarget (s .thtg )
53+ e5 :SetOperation (s .thop )
54+ c :RegisterEffect (e5 )
55+ local e6 = e5 :Clone ()
56+ e6 :SetCode (EVENT_TO_DECK )
57+ e6 :SetCondition (s .thcon )
58+ c :RegisterEffect (e6 )
59+ end
60+ s .listed_series = {SET_DD }
61+ function s .scaletg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
62+ if chkc then return chkc :IsLocation (LOCATION_PZONE ) and not chkc :IsScale (0 ) end
63+ if chk == 0 then return Duel .IsExistingTarget (aux .NOT (Card .IsScale ),tp ,LOCATION_PZONE ,LOCATION_PZONE ,1 ,nil ,0 ) end
64+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
65+ Duel .SelectTarget (tp ,aux .NOT (Card .IsScale ),tp ,LOCATION_PZONE ,LOCATION_PZONE ,1 ,2 ,nil ,0 )
66+ end
67+ function s .scaleop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
68+ local tg = Duel .GetTargetCards (e )
69+ if # tg == 0 then return end
70+ local c = e :GetHandler ()
71+ for tc in tg :Iter () do
72+ -- Their Scales become 0 until the end of this turn
73+ local e1 = Effect .CreateEffect (c )
74+ e1 :SetType (EFFECT_TYPE_SINGLE )
75+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
76+ e1 :SetCode (EFFECT_CHANGE_LSCALE )
77+ e1 :SetValue (0 )
78+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
79+ tc :RegisterEffect (e1 )
80+ local e2 = e1 :Clone ()
81+ e2 :SetCode (EFFECT_CHANGE_RSCALE )
82+ e2 :SetValue (0 )
83+ tc :RegisterEffect (e2 )
84+ end
85+ end
86+ function s .ddpendmonfilter (c )
87+ return c :IsSetCard (SET_DD ) and c :IsOriginalType (TYPE_PENDULUM ) and c :IsMonsterCard () and c :IsFaceup ()
88+ end
89+ function s .spcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
90+ return Duel .IsExistingMatchingCard (s .ddpendmonfilter ,tp ,LOCATION_ONFIELD ,0 ,1 ,nil )
91+ end
92+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
93+ local c = e :GetHandler ()
94+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
95+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
96+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
97+ end
98+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
99+ local c = e :GetHandler ()
100+ if c :IsRelateToEffect (e ) then
101+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
102+ end
103+ end
104+ function s .lvtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
105+ if chk == 0 then return not e :GetHandler ():IsLevel (4 ) end
106+ Duel .SetOperationInfo (0 ,CATEGORY_LVCHANGE ,c ,1 ,tp ,4 )
107+ end
108+ function s .lvop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
109+ local c = e :GetHandler ()
110+ if c :IsRelateToEffect (e ) and c :IsFaceup () then
111+ -- This card's Level becomes 4
112+ local e1 = Effect .CreateEffect (c )
113+ e1 :SetType (EFFECT_TYPE_SINGLE )
114+ e1 :SetCode (EFFECT_CHANGE_LEVEL )
115+ e1 :SetValue (4 )
116+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD_DISABLE )
117+ c :RegisterEffect (e1 )
118+ end
119+ end
120+ function s .thfilter (c )
121+ return s .ddpendmonfilter (c ) and c :IsAbleToHand ()
122+ end
123+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
124+ if chkc then return chkc :IsOnField () and chkc :IsControler (tp ) and s .thfilter (chkc ) end
125+ if chk == 0 then return Duel .IsExistingTarget (s .thfilter ,tp ,LOCATION_ONFIELD ,0 ,1 ,nil ) end
126+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
127+ local g = Duel .SelectTarget (tp ,s .thfilter ,tp ,LOCATION_ONFIELD ,0 ,1 ,1 ,nil )
128+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,g ,1 ,tp ,0 )
129+ end
130+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
131+ local tc = Duel .GetFirstTarget ()
132+ if tc :IsRelateToEffect (e ) then
133+ Duel .SendtoHand (tc ,nil ,REASON_EFFECT )
134+ end
135+ end
136+ function s .thcon (e )
137+ local c = e :GetHandler ()
138+ return c :IsLocation (LOCATION_EXTRA ) and c :IsFaceup ()
139+ end
0 commit comments