1+ -- 闇征竜-ネビュラス
2+ -- Nebulous, Dragon Ruler of Shadows
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon 2 of your banished "Dragon Ruler" monsters with different Attributes
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 :SetProperty (EFFECT_FLAG_CARD_TARGET )
12+ e1 :SetRange (LOCATION_HAND )
13+ e1 :SetCountLimit (1 ,id )
14+ e1 :SetCost (s .rmspcost )
15+ e1 :SetTarget (s .rmsptg )
16+ e1 :SetOperation (s .rmspop )
17+ c :RegisterEffect (e1 ,false ,REGISTER_FLAG_DRAGON_RULER )
18+ -- Special Summon 1 "Eclepsis, Dragon Ruler of Woes" from your GY
19+ local e2 = Effect .CreateEffect (c )
20+ e2 :SetDescription (aux .Stringid (id ,1 ))
21+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
22+ e2 :SetType (EFFECT_TYPE_IGNITION )
23+ e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
24+ e2 :SetRange (LOCATION_GRAVE )
25+ e2 :SetCountLimit (1 ,id )
26+ e2 :SetCost (s .gyspcost )
27+ e2 :SetTarget (s .gysptg )
28+ e2 :SetOperation (s .gyspop )
29+ c :RegisterEffect (e2 )
30+ end
31+ s .listed_series = {SET_DRAGON_RULER }
32+ s .listed_names = {id ,101208048 } -- "Eclepsis, Dragon Ruler of Woes"
33+ function s .rmcostfilter (c )
34+ return (c :IsAttribute (ATTRIBUTE_DARK ) or c :IsRace (RACE_DRAGON )) and c :IsDiscardable ()
35+ end
36+ function s .rmspcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
37+ local c = e :GetHandler ()
38+ if chk == 0 then return c :IsDiscardable () and Duel .IsExistingMatchingCard (s .rmcostfilter ,tp ,LOCATION_HAND ,0 ,1 ,c ) end
39+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DISCARD )
40+ local g = Duel .SelectMatchingCard (tp ,s .rmcostfilter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,c )
41+ g :AddCard (c )
42+ Duel .SendtoGrave (g ,REASON_COST |REASON_DISCARD )
43+ end
44+ function s .rmspfilter (c ,e ,tp )
45+ return c :IsSetCard (SET_DRAGON_RULER ) and c :IsFaceup () and c :IsCanBeEffectTarget (e ) and not c :IsCode (id )
46+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
47+ end
48+ function s .rmsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
49+ if chkc then return false end
50+ local g = Duel .GetMatchingGroup (s .rmspfilter ,tp ,LOCATION_REMOVED ,0 ,nil ,e ,tp )
51+ if chk == 0 then return not Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT )
52+ and Duel .GetLocationCount (tp ,LOCATION_MZONE )>= 2
53+ and g :GetClassCount (Card .GetAttribute )>= 2 end
54+ local tg = aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,aux .dpcheck (Card .GetAttribute ),1 ,tp ,HINTMSG_SPSUMMON )
55+ Duel .SetTargetCard (tg )
56+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,tg ,2 ,tp ,0 )
57+ end
58+ function s .rmspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
59+ local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
60+ if ft <= 0 then return end
61+ local tg = Duel .GetTargetCards (e )
62+ if # tg == 0 then return end
63+ if Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) and # tg > 1 then return end
64+ if # tg > ft then
65+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
66+ tg = tg :Select (tp ,ft ,ft ,nil )
67+ end
68+ local c = e :GetHandler ()
69+ for tc in tg :Iter () do
70+ if Duel .SpecialSummonStep (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP ) then
71+ -- It cannot attack this turn
72+ local e1 = Effect .CreateEffect (c )
73+ e1 :SetDescription (3206 )
74+ e1 :SetType (EFFECT_TYPE_SINGLE )
75+ e1 :SetProperty (EFFECT_FLAG_CLIENT_HINT )
76+ e1 :SetCode (EFFECT_CANNOT_ATTACK )
77+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
78+ tc :RegisterEffect (e1 )
79+ end
80+ end
81+ Duel .SpecialSummonComplete ()
82+ end
83+ function s .gyspcostfilter (c ,e ,tp )
84+ return (c :IsAttribute (ATTRIBUTE_DARK ) or c :IsRace (RACE_DRAGON )) and c :IsAbleToRemoveAsCost ()
85+ and Duel .IsExistingTarget (s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,c ,e ,tp )
86+ end
87+ function s .gyspfilter (c ,e ,tp )
88+ return c :IsCode (101208048 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
89+ end
90+ function s .gyspcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
91+ local c = e :GetHandler ()
92+ if chk == 0 then return c :IsAbleToRemoveAsCost ()
93+ and Duel .IsExistingMatchingCard (s .gyspcostfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,c ,e ,tp ) end
94+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
95+ local g = Duel .SelectMatchingCard (tp ,s .gyspcostfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,c ,e ,tp )
96+ g :AddCard (c )
97+ Duel .Remove (g ,POS_FACEUP ,REASON_COST )
98+ end
99+ function s .gysptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
100+ if chkc then return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsControler (tp ) and s .gyspfilter (chkc ,e ,tp ) end
101+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
102+ and Duel .IsExistingTarget (s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,c ,e ,tp ) end
103+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
104+ local g = Duel .SelectTarget (tp ,s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
105+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,1 ,tp ,0 )
106+ end
107+ function s .gyspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
108+ local tc = Duel .GetFirstTarget ()
109+ if tc :IsRelateToEffect (e ) then
110+ Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
111+ end
112+ end
0 commit comments