1+ -- テールスイング
2+ -- Tail Swipe
3+ -- Scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Grant piercing damage
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_POSITION )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetTarget (s .target )
13+ e1 :SetOperation (s .operation )
14+ c :RegisterEffect (e1 )
15+ end
16+ function s .filter (c ,tp )
17+ return c :IsFaceup () and c :IsRace (RACE_DINOSAUR ) and c :IsLevelAbove (5 )
18+ and Duel .IsExistingMatchingCard (s .thfilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil ,c :GetLevel ())
19+ end
20+ function s .thfilter (c ,lv )
21+ return (c :IsFacedown () or c :IsLevelBelow (lv - 1 )) and c :IsNotMaximumModeSide () and c :IsAbleToHand ()
22+ end
23+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
24+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ,tp ) end
25+ end
26+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
27+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_FACEUP )
28+ local tc = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil ,tp ):GetFirst ()
29+ if not tc then return end
30+ Duel .HintSelection (tc )
31+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
32+ local sg = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,0 ,LOCATION_MZONE ,1 ,2 ,nil ,tc :GetLevel ())
33+ sg = sg :AddMaximumCheck ()
34+ Duel .HintSelection (sg )
35+ Duel .SendtoHand (sg ,nil ,REASON_EFFECT )
36+ end
0 commit comments