1+ -- レッドアイズ・ダークネスメタルドラゴン
2+ -- Red-Eyes Darkness Metal Dragon
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon procedure
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (EFFECT_TYPE_FIELD )
10+ e1 :SetProperty (EFFECT_FLAG_UNCOPYABLE )
11+ e1 :SetCode (EFFECT_SPSUMMON_PROC )
12+ e1 :SetRange (LOCATION_HAND )
13+ e1 :SetCondition (s .spcon )
14+ e1 :SetTarget (s .sptg )
15+ e1 :SetOperation (s .spop )
16+ c :RegisterEffect (e1 )
17+ -- Special Summon 1 Dragon from the hand or GY
18+ local e1 = Effect .CreateEffect (c )
19+ e1 :SetDescription (aux .Stringid (id ,0 ))
20+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
21+ e1 :SetType (EFFECT_TYPE_IGNITION )
22+ e1 :SetRange (LOCATION_MZONE )
23+ e1 :SetCountLimit (1 )
24+ e1 :SetTarget (s .target )
25+ e1 :SetOperation (s .operation )
26+ c :RegisterEffect (e1 )
27+ end
28+ function s .spcostfilter (c )
29+ return c :IsFaceup () and c :IsRace (RACE_DRAGON ) and c :IsAbleToDeckAsCost ()
30+ end
31+ function s .spcon (e ,c )
32+ if c == nil then return true end
33+ local tp = c :GetControler ()
34+ return Duel .IsExistingMatchingCard (s .spcostfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil )
35+ end
36+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
37+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DISCARD )
38+ local g = Duel .GetMatchingGroup (s .spcostfilter ,tp ,LOCATION_MZONE ,0 ,nil )
39+ local sg = aux .SelectUnselectGroup (g ,e ,tp ,1 ,1 ,aux .ChkfMMZ (1 ),1 ,tp ,HINTMSG_TODECK ,nil ,nil ,true )
40+ if # sg > 0 then
41+ sg :KeepAlive ()
42+ e :SetLabelObject (sg )
43+ return true
44+ end
45+ return false
46+ end
47+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
48+ local g = e :GetLabelObject ()
49+ if not g then return end
50+ Duel .SendtoDeck (g ,nil ,SEQ_DECKBOTTOM ,REASON_COST )
51+ g :DeleteGroup ()
52+ end
53+ function s .spfilter (c ,e ,tp )
54+ return c :IsRace (RACE_DRAGON ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
55+ end
56+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
57+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
58+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_GRAVE |LOCATION_HAND ,0 ,1 ,nil ,e ,tp )
59+ end
60+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,0 ,tp ,LOCATION_GRAVE |LOCATION_HAND )
61+ end
62+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
63+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )< 1 then return end
64+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
65+ local g = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_GRAVE |LOCATION_HAND ,0 ,1 ,1 ,nil ,e ,tp )
66+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
67+ local e1 = Effect .CreateEffect (e :GetHandler ())
68+ e1 :SetDescription (aux .Stringid (id ,1 ))
69+ e1 :SetType (EFFECT_TYPE_FIELD )
70+ e1 :SetCode (EFFECT_CANNOT_ACTIVATE )
71+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
72+ e1 :SetTargetRange (1 ,0 )
73+ e1 :SetValue (s .aclimit )
74+ e1 :SetReset (RESET_PHASE |PHASE_END )
75+ Duel .RegisterEffect (e1 ,tp )
76+ end
77+ function s .aclimit (e ,re ,tp )
78+ return re :GetHandler ():IsCode (88264978 )
79+ end
0 commit comments