1+ -- ボーン・スパイン・ウィップ
2+ -- Bone Spine Whip
3+ -- Scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Set 1 "Fusion" or "Fusion Cancel"
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
10+ e1 :SetCode (EVENT_SUMMON_SUCCESS )
11+ e1 :SetProperty (EFFECT_FLAG_DELAY )
12+ e1 :SetCondition (s .condition )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .activate )
15+ c :RegisterEffect (e1 )
16+ local e2 = e1 :Clone ()
17+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
18+ c :RegisterEffect (e2 )
19+ end
20+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
21+ return eg :IsExists (Card .IsSummonPlayer ,1 ,nil ,1 - tp )
22+ end
23+ function s .filter (c ,e ,tp )
24+ return c :IsRace (RACE_ZOMBIE ) and c :IsLevelBelow (5 )
25+ and (c :IsAbleToHand () or (Duel .GetMZoneCount (tp )> 0 and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )))
26+ end
27+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
28+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
29+ Duel .SetOperationInfo (0 ,CATEGORY_LEAVE_GRAVE ,nil ,1 ,tp ,0 )
30+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_GRAVE )
31+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_GRAVE )
32+ end
33+ function s .cfilter2 (c )
34+ return c :IsFaceup () and c :IsAttribute (ATTRIBUTE_WIND )
35+ end
36+ function s .thfilter (c )
37+ return c :IsLevelAbove (8 ) and c :IsAbleToHand () and not c :IsMaximumModeSide ()
38+ end
39+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
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 ,2 )
52+ )
53+ if not Duel .IsExistingMatchingCard (s .cfilter2 ,tp ,LOCATION_MZONE ,0 ,1 ,nil ) then return end
54+ local g2 = Duel .GetMatchingGroup (s .thfilter ,tp ,0 ,LOCATION_MZONE ,nil )
55+ if # g2 > 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
56+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
57+ local sg = g2 :Select (tp ,1 ,1 ,nil )
58+ sg = sg :AddMaximumCheck ()
59+ Duel .HintSelection (sg )
60+ if # sg > 0 then
61+ Duel .SendtoHand (sg ,nil ,REASON_EFFECT )
62+ end
63+ end
64+ end
65+ end
0 commit comments