1+ -- 御巫奉サナキ
2+ -- Sanaki the Mikanko Devotee
3+ -- Scripted by Hatter
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Return 1 "Mikanko" card you control to the hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_TOHAND )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
12+ e1 :SetRange (LOCATION_MZONE )
13+ e1 :SetCountLimit (1 ,id )
14+ e1 :SetTarget (s .thtg )
15+ e1 :SetOperation (s .thop )
16+ c :RegisterEffect (e1 )
17+ -- Special Summon 1 non-Illusion "Mikanko" monster from your Deck
18+ local e2 = Effect .CreateEffect (c )
19+ e2 :SetDescription (aux .Stringid (id ,1 ))
20+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
21+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
22+ e2 :SetProperty (EFFECT_FLAG_DELAY )
23+ e2 :SetCode (EVENT_EQUIP )
24+ e2 :SetCountLimit (1 ,{id ,1 })
25+ e2 :SetTarget (s .sptg )
26+ e2 :SetOperation (s .spop )
27+ c :RegisterEffect (e2 )
28+ -- Equip this card to 1 face-up monster on the field as an Equip Spell
29+ local e3 = Effect .CreateEffect (c )
30+ e3 :SetDescription (aux .Stringid (id ,2 ))
31+ e3 :SetCategory (CATEGORY_EQUIP )
32+ e3 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
33+ e3 :SetProperty (EFFECT_FLAG_DELAY + EFFECT_FLAG_CARD_TARGET )
34+ e3 :SetCode (EVENT_TO_GRAVE )
35+ e3 :SetCountLimit (1 ,{id ,2 })
36+ e3 :SetTarget (s .eqtg )
37+ e3 :SetOperation (s .eqop )
38+ c :RegisterEffect (e3 )
39+ end
40+ s .listed_series = {SET_MIKANKO }
41+ function s .thfilter (c )
42+ return c :IsSetCard (SET_MIKANKO ) and c :IsFaceup () and c :IsAbleToHand ()
43+ end
44+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
45+ if chkc then return chkc :IsControler (tp ) and chkc :IsOnField () and s .thfilter (chkc ) end
46+ if chk == 0 then return Duel .IsExistingTarget (s .thfilter ,tp ,LOCATION_ONFIELD ,0 ,1 ,nil ) end
47+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
48+ local g = Duel .SelectTarget (tp ,s .thfilter ,tp ,LOCATION_ONFIELD ,0 ,1 ,1 ,nil )
49+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,g ,1 ,tp ,0 )
50+ end
51+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
52+ local tc = Duel .GetFirstTarget ()
53+ if tc :IsRelateToEffect (e ) then
54+ Duel .SendtoHand (tc ,nil ,REASON_EFFECT )
55+ end
56+ end
57+ function s .spfilter (c ,e ,tp )
58+ return not c :IsRace (RACE_ILLUSION ) and c :IsSetCard (SET_MIKANKO ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
59+ end
60+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
61+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
62+ and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ) end
63+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
64+ end
65+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
66+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 then
67+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
68+ local g = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp )
69+ if # g > 0 then
70+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
71+ end
72+ end
73+ -- You cannot Special Summon from the Extra Deck for the rest of this turn, except "Mikanko" monsters
74+ local e1 = Effect .CreateEffect (e :GetHandler ())
75+ e1 :SetDescription (aux .Stringid (id ,3 ))
76+ e1 :SetType (EFFECT_TYPE_FIELD )
77+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
78+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
79+ e1 :SetTargetRange (1 ,0 )
80+ e1 :SetTarget (function (e ,c ) return c :IsLocation (LOCATION_EXTRA ) and not c :IsSetCard (SET_MIKANKO ) end )
81+ e1 :SetReset (RESET_PHASE |PHASE_END )
82+ Duel .RegisterEffect (e1 ,tp )
83+ end
84+ function s .eqtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
85+ local c = e :GetHandler ()
86+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsFaceup () end
87+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0
88+ and Duel .IsExistingTarget (Card .IsFaceup ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,nil ) end
89+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_EQUIP )
90+ local g = Duel .SelectTarget (tp ,Card .IsFaceup ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,nil )
91+ Duel .SetOperationInfo (0 ,CATEGORY_EQUIP ,c ,1 ,tp ,0 )
92+ end
93+ function s .eqop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
94+ local c = e :GetHandler ()
95+ local tc = Duel .GetFirstTarget ()
96+ if c :IsRelateToEffect (e ) and tc :IsFaceup () and tc :IsRelateToEffect (e ) and Duel .Equip (tp ,c ,tc ) then
97+ -- Equip limit
98+ local e1 = Effect .CreateEffect (c )
99+ e1 :SetType (EFFECT_TYPE_SINGLE )
100+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
101+ e1 :SetCode (EFFECT_EQUIP_LIMIT )
102+ e1 :SetValue (function (e ,c ) return c == tc end )
103+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
104+ c :RegisterEffect (e1 )
105+ end
106+ end
0 commit comments