1+ -- 惑乱のスカル・デーモン
2+ -- Skull Archfiend of Confusion
3+ -- Scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Name becomes "Summoned Skull" in the hand or GY
7+ local e0 = Effect .CreateEffect (c )
8+ e0 :SetType (EFFECT_TYPE_SINGLE )
9+ e0 :SetCode (EFFECT_CHANGE_CODE )
10+ e0 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
11+ e0 :SetRange (LOCATION_HAND |LOCATION_GRAVE )
12+ e0 :SetValue (CARD_SUMMONED_SKULL )
13+ c :RegisterEffect (e0 )
14+ -- Change name to "Summoned Skull" and take control
15+ local e1 = Effect .CreateEffect (c )
16+ e1 :SetDescription (aux .Stringid (id ,0 ))
17+ e1 :SetCategory (CATEGORY_CONTROL )
18+ e1 :SetType (EFFECT_TYPE_IGNITION )
19+ e1 :SetRange (LOCATION_MZONE )
20+ e1 :SetCountLimit (1 )
21+ e1 :SetCost (s .cost )
22+ e1 :SetTarget (s .target )
23+ e1 :SetOperation (s .operation )
24+ c :RegisterEffect (e1 )
25+ end
26+ s .listed_names = {CARD_SUMMONED_SKULL }
27+ function s .costfilter (c )
28+ return c :IsMonster () and c :IsAttribute (ATTRIBUTE_DARK ) and c :IsRace (RACE_FIEND ) and c :IsAbleToGraveAsCost ()
29+ end
30+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
31+ if chk == 0 then return Duel .IsExistingMatchingCard (s .costfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil ) end
32+ end
33+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
34+ if chk == 0 then return true end
35+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_CONTROL ,nil ,1 ,0 ,0 )
36+ end
37+ function s .ctrlfilter (c )
38+ return c :IsFaceup () and c :IsLevelBelow (8 ) and not c :IsType (TYPE_MAXIMUM ) and c :IsControlerCanBeChanged (true )
39+ end
40+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
41+ local c = e :GetHandler ()
42+ -- Requirement
43+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
44+ local g = Duel .SelectMatchingCard (tp ,s .costfilter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil )
45+ if Duel .SendtoGrave (g ,REASON_COST )< 1 then return end
46+ -- Effect
47+ -- Change name to "Summoned Skull"
48+ local e1 = Effect .CreateEffect (c )
49+ e1 :SetType (EFFECT_TYPE_SINGLE )
50+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
51+ e1 :SetCode (EFFECT_CHANGE_CODE )
52+ e1 :SetValue (CARD_SUMMONED_SKULL )
53+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
54+ c :RegisterEffect (e1 )
55+ local g = Duel .GetMatchingGroup (s .ctrlfilter ,tp ,0 ,LOCATION_MZONE ,nil ,e ,tp )
56+ if # g > 0 and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
57+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_CONTROL )
58+ local dg = Duel .SelectMatchingCard (tp ,s .ctrlfilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
59+ if # dg > 0 then
60+ Duel .HintSelection (dg )
61+ Duel .GetControl (dg ,tp )
62+ end
63+ end
64+ end
0 commit comments