1+ -- 羊界フワフィー
2+ -- Wooly Wonderland Fluffy
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Add to hand or Special Summon
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_TOHAND )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetCountLimit (1 )
13+ e1 :SetCondition (s .condition )
14+ e1 :SetCost (s .cost )
15+ e1 :SetTarget (s .target )
16+ e1 :SetOperation (s .operation )
17+ c :RegisterEffect (e1 )
18+ end
19+ s .listed_names = {CARD_MEEEG_CHAN }
20+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
21+ return Duel .IsExistingMatchingCard (Card .IsCode ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,CARD_MEEEG_CHAN )
22+ end
23+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
24+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToGraveAsCost ,tp ,LOCATION_HAND ,0 ,1 ,nil ) end
25+ end
26+ function s .filter (c ,e ,tp )
27+ return c :IsCode (CARD_MEEEG_CHAN ) and (c :IsAbleToHand () or (Duel .GetMZoneCount (tp )> 0 and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )))
28+ end
29+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
30+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
31+ Duel .SetOperationInfo (0 ,CATEGORY_LEAVE_GRAVE ,nil ,1 ,tp ,0 )
32+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_GRAVE )
33+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_GRAVE )
34+ end
35+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
36+ -- Requirement
37+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
38+ local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToGraveAsCost ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil )
39+ if Duel .SendtoGrave (g ,REASON_COST )< 1 then return end
40+ -- Effect
41+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
42+ local tc = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp ):GetFirst ()
43+ if tc then
44+ aux .ToHandOrElse (tc ,tp ,
45+ function ()
46+ return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and tc :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
47+ end ,
48+ function ()
49+ Duel .SpecialSummon (tc ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
50+ end ,
51+ aux .Stringid (id ,1 )
52+ )
53+ end
54+ end
0 commit comments