1+ -- トリガード・ライトニング
2+ -- Triggered Lightning
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Increase ATK
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_ATKCHANGE )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetCost (s .cost )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .activate )
15+ c :RegisterEffect (e1 )
16+ end
17+ s .listed_names = {160008031 }
18+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
19+ if chk == 0 then return Duel .IsPlayerCanDiscardDeckAsCost (tp ,2 ) end
20+ end
21+ function s .filter (c )
22+ return c :IsFaceup () and c :IsType (TYPE_EFFECT ) and c :IsNotMaximumModeSide ()
23+ end
24+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
25+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ) end
26+ end
27+ function s .spfilter (c ,e ,tp )
28+ return c :IsCode (160008031 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP )
29+ end
30+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
31+ local c = e :GetHandler ()
32+ -- Requirement
33+ if Duel .DiscardDeck (tp ,2 ,REASON_COST )< 1 then return end
34+ -- Effect
35+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil )
36+ if # g > 0 then
37+ Duel .HintSelection (g )
38+ local tc = g :GetFirst ()
39+ local e1 = Effect .CreateEffect (c )
40+ e1 :SetType (EFFECT_TYPE_SINGLE )
41+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
42+ e1 :SetValue (300 )
43+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
44+ tc :RegisterEffect (e1 )
45+ -- piercing
46+ tc :AddPiercing (RESETS_STANDARD_PHASE_END ,c )
47+ local g2 = Duel .GetMatchingGroup (aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_GRAVE ,0 ,nil ,e ,tp )
48+ if # g2 > 0 and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and Duel .GetFieldGroupCount (e :GetHandlerPlayer (),LOCATION_HAND ,LOCATION_HAND )== 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
49+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
50+ local sg = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
51+ if # sg > 0 then
52+ Duel .BreakEffect ()
53+ Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
54+ end
55+ end
56+ end
57+ end
0 commit comments