1+ -- 幻惑の操手
2+ -- Nightmare Hand
3+ local s ,id = GetID ()
4+ function s .initial_effect (c )
5+ -- Send 1 Illusion monster from your Deck to the GY
6+ local e1 = Effect .CreateEffect (c )
7+ e1 :SetDescription (aux .Stringid (id ,0 ))
8+ e1 :SetCategory (CATEGORY_TOGRAVE )
9+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
10+ e1 :SetCode (EVENT_FREE_CHAIN )
11+ e1 :SetCountLimit (1 ,id )
12+ e1 :SetTarget (s .tgtg )
13+ e1 :SetOperation (s .tgop )
14+ e1 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
15+ c :RegisterEffect (e1 )
16+ -- Special Summon 1 monster from your opponent's GY to your field, but banish it during the End Phase of the next turn
17+ local e2 = Effect .CreateEffect (c )
18+ e2 :SetDescription (aux .Stringid (id ,1 ))
19+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_REMOVE )
20+ e2 :SetType (EFFECT_TYPE_IGNITION )
21+ e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
22+ e2 :SetRange (LOCATION_GRAVE )
23+ e2 :SetCountLimit (1 ,id )
24+ e2 :SetCondition (s .spcon )
25+ e2 :SetCost (Cost .SelfBanish )
26+ e2 :SetTarget (s .sptg )
27+ e2 :SetOperation (s .spop )
28+ c :RegisterEffect (e2 )
29+ end
30+ function s .tgfilter (c )
31+ return c :IsRace (RACE_ILLUSION ) and c :IsAbleToGrave ()
32+ end
33+ function s .tgtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
34+ if chk == 0 then return Duel .IsExistingMatchingCard (s .tgfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
35+ Duel .SetOperationInfo (0 ,CATEGORY_TOGRAVE ,nil ,1 ,tp ,LOCATION_DECK )
36+ end
37+ function s .tgop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
38+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
39+ local g = Duel .SelectMatchingCard (tp ,s .tgfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
40+ if # g > 0 then
41+ Duel .SendtoGrave (g ,REASON_EFFECT )
42+ end
43+ end
44+ function s .spconfilter (c )
45+ return c :IsLevelAbove (5 ) and c :IsRace (RACE_ILLUSION ) and c :IsFaceup ()
46+ end
47+ function s .spcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
48+ return Duel .IsExistingMatchingCard (s .spconfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil )
49+ end
50+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
51+ if chkc then return chkc :IsControler (1 - tp ) and chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
52+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
53+ and Duel .IsExistingTarget (Card .IsCanBeSpecialSummoned ,tp ,0 ,LOCATION_GRAVE ,1 ,nil ,e ,0 ,tp ,false ,false ) end
54+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
55+ local g = Duel .SelectTarget (tp ,Card .IsCanBeSpecialSummoned ,tp ,0 ,LOCATION_GRAVE ,1 ,1 ,nil ,e ,0 ,tp ,false ,false )
56+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,1 ,tp ,0 )
57+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_REMOVE ,nil ,1 ,tp ,LOCATION_MZONE )
58+ end
59+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
60+ local tc = Duel .GetFirstTarget ()
61+ if tc :IsRelateToEffect (e ) and Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 then
62+ local turn_summoned = Duel .GetTurnCount ()
63+ -- Banish it during the End Phase of the next turn
64+ aux .DelayedOperation (tc ,PHASE_END ,id ,e ,tp ,
65+ function (tc ) Duel .Remove (tc ,POS_FACEUP ,REASON_EFFECT ) end ,
66+ function () return Duel .GetTurnCount ()== turn_summoned + 1 end ,
67+ nil ,2 ,aux .Stringid (id ,2 )
68+ )
69+ end
70+ end
0 commit comments