1+ -- WAKE CUP! アル
2+ -- WAKE CUP! Erl
3+ -- Scripted by The Razgriz
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- FLIP: You can send face-up cards your opponent controls to the GY, up to the number of Flip monsters you control
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_TOGRAVE )
10+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_FLIP + EFFECT_TYPE_TRIGGER_O )
11+ e1 :SetProperty (EFFECT_FLAG_DELAY )
12+ e1 :SetCountLimit (1 ,id )
13+ e1 :SetTarget (s .tgtg )
14+ e1 :SetOperation (s .tgop )
15+ c :RegisterEffect (e1 )
16+ -- Discard 1 other Flip monster, and if you do, Special Summon this card in Attack Position or face-down Defense Position
17+ local e2 = Effect .CreateEffect (c )
18+ e2 :SetDescription (aux .Stringid (id ,1 ))
19+ e2 :SetCategory (CATEGORY_HANDES + CATEGORY_SPECIAL_SUMMON )
20+ e2 :SetType (EFFECT_TYPE_IGNITION )
21+ e2 :SetRange (LOCATION_HAND )
22+ e2 :SetCountLimit (1 ,{id ,1 })
23+ e2 :SetTarget (s .selfsptg )
24+ e2 :SetOperation (s .selfspop )
25+ c :RegisterEffect (e2 )
26+ -- Special Summon 1 Flip monster from your GY in face-down Defense Position
27+ local e3 = Effect .CreateEffect (c )
28+ e3 :SetDescription (aux .Stringid (id ,2 ))
29+ e3 :SetCategory (CATEGORY_SPECIAL_SUMMON )
30+ e3 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O )
31+ e3 :SetProperty (EFFECT_FLAG_CARD_TARGET )
32+ e3 :SetCode (EVENT_PHASE + PHASE_END )
33+ e3 :SetRange (LOCATION_MZONE )
34+ e3 :SetCountLimit (1 ,{id ,2 })
35+ e3 :SetCondition (function (e ,tp ) return Duel .IsTurnPlayer (tp ) end )
36+ e3 :SetTarget (s .gysptg )
37+ e3 :SetOperation (s .gyspop )
38+ c :RegisterEffect (e3 )
39+ end
40+ function s .tgtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
41+ if chk == 0 then return Duel .IsExistingMatchingCard (aux .FaceupFilter (Card .IsType ,TYPE_FLIP ),tp ,LOCATION_MZONE ,0 ,1 ,nil )
42+ and Duel .IsExistingMatchingCard (aux .FaceupFilter (Card .IsAbleToGrave ),tp ,0 ,LOCATION_ONFIELD ,1 ,nil ) end
43+ Duel .SetOperationInfo (0 ,CATEGORY_TOGRAVE ,nil ,1 ,1 - tp ,LOCATION_ONFIELD )
44+ end
45+ function s .tgop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
46+ local ct = Duel .GetMatchingGroupCount (aux .FaceupFilter (Card .IsType ,TYPE_FLIP ),tp ,LOCATION_MZONE ,0 ,nil )
47+ if ct == 0 then return end
48+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
49+ local g = Duel .SelectMatchingCard (tp ,aux .FaceupFilter (Card .IsAbleToGrave ),tp ,0 ,LOCATION_ONFIELD ,1 ,ct ,nil )
50+ if # g > 0 then
51+ Duel .HintSelection (g )
52+ Duel .SendtoGrave (g ,REASON_EFFECT )
53+ end
54+ end
55+ function s .selfspdiscardfilter (c )
56+ return c :IsType (TYPE_FLIP ) and c :IsDiscardable (REASON_EFFECT )
57+ end
58+ function s .selfsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
59+ local c = e :GetHandler ()
60+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
61+ and Duel .IsExistingMatchingCard (s .selfspdiscardfilter ,tp ,LOCATION_HAND ,0 ,1 ,c )
62+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP_ATTACK |POS_FACEDOWN_DEFENSE )
63+ end
64+ Duel .SetOperationInfo (0 ,CATEGORY_HANDES ,nil ,0 ,tp ,1 )
65+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
66+ end
67+ function s .selfspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
68+ local c = e :GetHandler ()
69+ local exc = c :IsRelateToEffect (e ) and c or nil
70+ if Duel .DiscardHand (tp ,s .selfspdiscardfilter ,1 ,1 ,REASON_DISCARD |REASON_EFFECT ,exc )> 0 and c :IsRelateToEffect (e )
71+ and Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP_ATTACK |POS_FACEDOWN_DEFENSE )> 0
72+ and c :IsFacedown () then
73+ Duel .ConfirmCards (1 - tp ,c )
74+ end
75+ end
76+ function s .gyspfilter (c ,e ,tp )
77+ return c :IsType (TYPE_FLIP ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEDOWN_DEFENSE )
78+ end
79+ function s .gysptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
80+ if chkc then return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsControler (tp ) and s .gyspfilter (chkc ,e ,tp ) end
81+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
82+ and Duel .IsExistingTarget (s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
83+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
84+ local g = Duel .SelectTarget (tp ,s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
85+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,1 ,tp ,0 )
86+ end
87+ function s .gyspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
88+ local tc = Duel .GetFirstTarget ()
89+ if tc :IsRelateToEffect (e ) and Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEDOWN_DEFENSE )> 0 then
90+ Duel .ConfirmCards (1 - tp ,tc )
91+ end
92+ end
0 commit comments