1+ -- レイズ・ムーンの翼 ラピ
2+ -- Raise Moon Wings Rapi
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- When you draw this card: You can reveal it; Special Summon it
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
11+ e1 :SetCode (EVENT_DRAW )
12+ e1 :SetCost (Cost .SelfReveal )
13+ e1 :SetTarget (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
14+ local c = e :GetHandler ()
15+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
16+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
17+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
18+ end )
19+ e1 :SetOperation (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
20+ local c = e :GetHandler ()
21+ if c :IsRelateToEffect (e ) then
22+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
23+ end
24+ end )
25+ c :RegisterEffect (e1 )
26+ -- If this card is Normal or Special Summoned from the hand: You can draw 1 card, also you cannot Special Summon from the Extra Deck for the rest of this turn, except LIGHT Xyz Monsters. You cannot add cards from the Deck to the hand the turn you activate this effect, except by drawing them
27+ local e2a = Effect .CreateEffect (c )
28+ e2a :SetDescription (aux .Stringid (id ,1 ))
29+ e2a :SetCategory (CATEGORY_DRAW )
30+ e2a :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
31+ e2a :SetProperty (EFFECT_FLAG_DELAY )
32+ e2a :SetCode (EVENT_SUMMON_SUCCESS )
33+ e2a :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
34+ return e :GetHandler ():IsSummonLocation (LOCATION_HAND )
35+ end )
36+ e2a :SetCost (s .drcost )
37+ e2a :SetTarget (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
38+ if chk == 0 then return Duel .IsPlayerCanDraw (tp ,1 ) end
39+ Duel .SetOperationInfo (0 ,CATEGORY_DRAW ,nil ,0 ,tp ,1 )
40+ end )
41+ e2a :SetOperation (s .drop )
42+ c :RegisterEffect (e2a )
43+ local e2b = e2a :Clone ()
44+ e2b :SetCode (EVENT_SPSUMMON_SUCCESS )
45+ c :RegisterEffect (e2b )
46+ -- Keep track of cards being added to a player's hand, except by drawing them
47+ aux .GlobalCheck (s ,function ()
48+ local ge1 = Effect .CreateEffect (c )
49+ ge1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
50+ ge1 :SetCode (EVENT_TO_HAND )
51+ ge1 :SetOperation (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
52+ for ec in eg :Iter () do
53+ if ec :IsPreviousLocation (LOCATION_DECK ) and not ec :IsReason (REASON_DRAW ) then
54+ Duel .RegisterFlagEffect (ec :GetReasonPlayer (),id ,RESET_PHASE |PHASE_END ,0 ,1 )
55+ end
56+ end
57+ end )
58+ Duel .RegisterEffect (ge1 ,0 )
59+ end )
60+ -- Once per opponent's turn, you can (Quick Effect): Immediately after this effect resolves, Xyz Summon 1 Rank 7 LIGHT monster
61+ local e3 = Effect .CreateEffect (c )
62+ e3 :SetDescription (aux .Stringid (id ,2 ))
63+ e3 :SetCategory (CATEGORY_SPECIAL_SUMMON )
64+ e3 :SetType (EFFECT_TYPE_QUICK_O )
65+ e3 :SetCode (EVENT_FREE_CHAIN )
66+ e3 :SetRange (LOCATION_MZONE )
67+ e3 :SetCountLimit (1 )
68+ e3 :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
69+ return Duel .IsTurnPlayer (1 - tp )
70+ end )
71+ e3 :SetTarget (s .xyztg )
72+ e3 :SetOperation (s .xyzop )
73+ e3 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
74+ c :RegisterEffect (e3 )
75+ end
76+ function s .drcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
77+ if chk == 0 then return not Duel .HasFlagEffect (tp ,id ) end
78+ -- You cannot add cards from the Deck to the hand the turn you activate this effect, except by drawing them
79+ local e1 = Effect .CreateEffect (e :GetHandler ())
80+ e1 :SetDescription (aux .Stringid (id ,3 ))
81+ e1 :SetType (EFFECT_TYPE_FIELD )
82+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH + EFFECT_FLAG_CLIENT_HINT )
83+ e1 :SetCode (EFFECT_CANNOT_TO_HAND )
84+ e1 :SetTargetRange (1 ,0 )
85+ e1 :SetTarget (function (e ,c ,tp ,re )
86+ return c :IsLocation (LOCATION_DECK )
87+ end )
88+ e1 :SetReset (RESET_PHASE |PHASE_END )
89+ Duel .RegisterEffect (e1 ,tp )
90+ end
91+ function s .drop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
92+ Duel .Draw (tp ,1 ,REASON_EFFECT )
93+ -- You cannot Special Summon from the Extra Deck for the rest of this turn, except LIGHT Xyz Monsters
94+ local e1 = Effect .CreateEffect (e :GetHandler ())
95+ e1 :SetDescription (aux .Stringid (id ,4 ))
96+ e1 :SetType (EFFECT_TYPE_FIELD )
97+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
98+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
99+ e1 :SetTargetRange (1 ,0 )
100+ e1 :SetTarget (function (e ,c )
101+ return c :IsLocation (LOCATION_EXTRA ) and not (c :IsAttribute (ATTRIBUTE_LIGHT ) and c :IsXyzMonster ())
102+ end )
103+ e1 :SetReset (RESET_PHASE |PHASE_END )
104+ Duel .RegisterEffect (e1 ,tp )
105+ end
106+ function s .xyzfilter (c )
107+ return c :IsRank (7 ) and c :IsAttribute (ATTRIBUTE_LIGHT ) and c :IsXyzSummonable ()
108+ end
109+ function s .xyztg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
110+ if chk == 0 then return Duel .IsExistingMatchingCard (s .xyzfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ) end
111+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_EXTRA )
112+ end
113+ function s .xyzop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
114+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
115+ local sc = Duel .SelectMatchingCard (tp ,s .xyzfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,1 ,nil ):GetFirst ()
116+ if sc then
117+ Duel .XyzSummon (tp ,sc )
118+ end
119+ end
0 commit comments