1+ -- ダークネス・リゾネーター
2+ -- Darkness Resonator
3+ -- Scripted by Eerie Code
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon this card from your hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_HAND )
12+ e1 :SetCountLimit (1 ,{id ,0 })
13+ e1 :SetCost (Cost .Reveal (function (c ) return c :IsCode (CARD_RED_DRAGON_ARCHFIEND ) end ,nil ,1 ,1 ,nil ,LOCATION_EXTRA ))
14+ e1 :SetTarget (s .sptg )
15+ e1 :SetOperation (s .spop )
16+ c :RegisterEffect (e1 )
17+ -- Apply a "during your Main Phase this turn, you can Normal Summon 1 "Resonator" monster in addition to your Normal Summon/Set (you can only gain this effect once per turn)" effect
18+ local e2 = Effect .CreateEffect (c )
19+ e2 :SetDescription (aux .Stringid (id ,1 ))
20+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
21+ e2 :SetProperty (EFFECT_FLAG_DELAY )
22+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
23+ e2 :SetCountLimit (1 ,{id ,1 })
24+ e2 :SetCondition (function (e ,tp ) return Duel .IsPlayerCanAdditionalSummon (tp ) end )
25+ e2 :SetTarget (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ) if chk == 0 then return Duel .IsPlayerCanSummon (tp ) end end )
26+ e2 :SetOperation (s .extransop )
27+ c :RegisterEffect (e2 )
28+ -- Change the Levels of any number of Tuners you control to 1
29+ local e3 = Effect .CreateEffect (c )
30+ e3 :SetDescription (aux .Stringid (id ,2 ))
31+ e3 :SetCategory (CATEGORY_LVCHANGE )
32+ e3 :SetType (EFFECT_TYPE_IGNITION )
33+ e3 :SetProperty (EFFECT_FLAG_CARD_TARGET )
34+ e3 :SetRange (LOCATION_MZONE )
35+ e3 :SetCountLimit (1 ,{id ,2 })
36+ e3 :SetTarget (s .lvtg )
37+ e3 :SetOperation (s .lvop )
38+ c :RegisterEffect (e3 )
39+ end
40+ s .listed_names = {CARD_RED_DRAGON_ARCHFIEND }
41+ s .listed_series = {SET_RESONATOR }
42+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
43+ local c = e :GetHandler ()
44+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
45+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
46+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
47+ end
48+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
49+ local c = e :GetHandler ()
50+ if c :IsRelateToEffect (e ) then
51+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
52+ end
53+ -- You cannot Special Summon from the Extra Deck for the rest of this turn, except Synchro Monsters
54+ local e1 = Effect .CreateEffect (c )
55+ e1 :SetDescription (aux .Stringid (id ,3 ))
56+ e1 :SetType (EFFECT_TYPE_FIELD )
57+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
58+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
59+ e1 :SetTargetRange (1 ,0 )
60+ e1 :SetTarget (function (e ,c ) return c :IsLocation (LOCATION_EXTRA ) and not c :IsSynchroMonster () end )
61+ e1 :SetReset (RESET_PHASE |PHASE_END )
62+ Duel .RegisterEffect (e1 ,tp )
63+ -- "Clock Lizard" check
64+ aux .addTempLizardCheck (c ,tp ,function (e ,c ) return not c :IsOriginalType (TYPE_SYNCHRO ) end )
65+ end
66+ function s .extransop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
67+ local c = e :GetHandler ()
68+ aux .RegisterClientHint (c ,nil ,tp ,1 ,0 ,aux .Stringid (id ,4 ))
69+ -- During your Main Phase this turn, you can Normal Summon 1 "Resonator" monster in addition to your Normal Summon/Set (you can only gain this effect once per turn)
70+ local e1 = Effect .CreateEffect (c )
71+ e1 :SetDescription (aux .Stringid (id ,5 ))
72+ e1 :SetType (EFFECT_TYPE_FIELD )
73+ e1 :SetCode (EFFECT_EXTRA_SUMMON_COUNT )
74+ e1 :SetTargetRange (LOCATION_HAND |LOCATION_MZONE ,0 )
75+ e1 :SetTarget (function (e ,c ) return c :IsSetCard (SET_RESONATOR ) end )
76+ e1 :SetReset (RESET_PHASE |PHASE_END )
77+ Duel .RegisterEffect (e1 ,tp )
78+ end
79+ function s .lvfilter (c )
80+ return c :IsType (TYPE_TUNER ) and not c :IsLevel (1 ) and c :IsFaceup ()
81+ end
82+ function s .lvtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
83+ if chkc then return chkc :IsControler (tp ) and chkc :IsLocation (LOCATION_MZONE ) and s .lvfilter (chkc ) end
84+ if chk == 0 then return Duel .IsExistingTarget (s .lvfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ) end
85+ local max_ct = Duel .GetTargetCount (s .lvfilter ,tp ,LOCATION_MZONE ,0 ,nil )
86+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
87+ local g = Duel .SelectTarget (tp ,s .lvfilter ,tp ,LOCATION_MZONE ,0 ,1 ,max_ct ,nil )
88+ Duel .SetOperationInfo (0 ,CATEGORY_LVCHANGE ,g ,# g ,tp ,1 )
89+ end
90+ function s .lvop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
91+ local c = e :GetHandler ()
92+ local tg = Duel .GetTargetCards (e )
93+ for tc in tg :Iter () do
94+ -- Their Levels become 1
95+ local e1 = Effect .CreateEffect (c )
96+ e1 :SetType (EFFECT_TYPE_SINGLE )
97+ e1 :SetCategory (EFFECT_FLAG_CANNOT_DISABLE )
98+ e1 :SetCode (EFFECT_CHANGE_LEVEL )
99+ e1 :SetValue (1 )
100+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
101+ tc :RegisterEffect (e1 )
102+ end
103+ end
0 commit comments