1+ -- ワイト・マスター
2+ -- Wight Master
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Activate
7+ local e0 = Effect .CreateEffect (c )
8+ e0 :SetType (EFFECT_TYPE_ACTIVATE )
9+ e0 :SetCode (EVENT_FREE_CHAIN )
10+ c :RegisterEffect (e0 )
11+ -- If your "King of the Skull Servants" attacks a Defense Position monster, inflict piercing battle damage to your opponent
12+ local e1 = Effect .CreateEffect (c )
13+ e1 :SetType (EFFECT_TYPE_FIELD )
14+ e1 :SetCode (EFFECT_PIERCE )
15+ e1 :SetRange (LOCATION_SZONE )
16+ e1 :SetTargetRange (LOCATION_MZONE ,0 )
17+ e1 :SetTarget (function (e ,c ) return c :IsCode (36021814 ) end )
18+ c :RegisterEffect (e1 )
19+ -- Send 1 "Skull Servant" or 1 monster that mentions it from your Deck to the GY and Special Summon 1 "Skull Servant" or "King of the Skull Servants" from your GY
20+ local e2 = Effect .CreateEffect (c )
21+ e2 :SetDescription (aux .Stringid (id ,0 ))
22+ e2 :SetCategory (CATEGORY_TOGRAVE + CATEGORY_SPECIAL_SUMMON )
23+ e2 :SetType (EFFECT_TYPE_IGNITION )
24+ e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
25+ e2 :SetRange (LOCATION_SZONE )
26+ e2 :SetCountLimit (1 )
27+ e2 :SetTarget (s .tgsptg )
28+ e2 :SetOperation (s .tgspop )
29+ c :RegisterEffect (e2 )
30+ end
31+ s .listed_names = {CARD_SKULL_SERVANT ,36021814 } -- "King of the Skull Servants"
32+ function s .spfilter (c ,e ,tp )
33+ return c :IsCode (CARD_SKULL_SERVANT ,36021814 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
34+ end
35+ function s .tgfilter (c )
36+ return (c :IsCode (CARD_SKULL_SERVANT ) or (c :IsMonster () and c :ListsCode (CARD_SKULL_SERVANT ))) and c :IsAbleToGrave ()
37+ end
38+ function s .tgsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
39+ if chkc then return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsControler (tp ) and s .spfilter (chkc ,e ,tp ) end
40+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
41+ and Duel .IsExistingTarget (s .spfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp )
42+ and Duel .IsExistingMatchingCard (s .tgfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
43+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
44+ local g = Duel .SelectTarget (tp ,s .spfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
45+ Duel .SetOperationInfo (0 ,CATEGORY_TOGRAVE ,nil ,1 ,tp ,LOCATION_DECK )
46+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,1 ,tp ,0 )
47+ end
48+ function s .tgspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
49+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
50+ local sc = Duel .SelectMatchingCard (tp ,s .tgfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ):GetFirst ()
51+ if sc and Duel .SendtoGrave (sc ,REASON_EFFECT )> 0 and sc :IsLocation (LOCATION_GRAVE ) then
52+ local tc = Duel .GetFirstTarget ()
53+ if tc :IsRelateToEffect (e ) then
54+ Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
55+ end
56+ end
57+ -- You cannot Special Summon for the rest of this turn, except Zombie monsters
58+ local e1 = Effect .CreateEffect (e :GetHandler ())
59+ e1 :SetDescription (aux .Stringid (id ,1 ))
60+ e1 :SetType (EFFECT_TYPE_FIELD )
61+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
62+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
63+ e1 :SetTargetRange (1 ,0 )
64+ e1 :SetTarget (function (e ,c ) return not c :IsRace (RACE_ZOMBIE ) end )
65+ e1 :SetReset (RESET_PHASE |PHASE_END )
66+ Duel .RegisterEffect (e1 ,tp )
67+ end
0 commit comments