1+ -- パワー・ショックボーグ
2+ -- Power Shockborg
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- 1 monster gains 1000 ATK and gains piercing
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (CATEGORY_ATKCHANGE )
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+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
20+ return e :GetHandler ():IsStatus (STATUS_SUMMON_TURN )
21+ end
22+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
23+ if chk == 0 then return Duel .IsPlayerCanDiscardDeckAsCost (tp ,1 ) end
24+ end
25+ function s .filter (c )
26+ return c :IsFaceup () and c :IsRace (RACE_MACHINE )
27+ end
28+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
29+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ) end
30+ end
31+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
32+ local c = e :GetHandler ()
33+ -- Requirement
34+ if Duel .DiscardDeck (tp ,1 ,REASON_COST )< 1 then return end
35+ -- Effect
36+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATKDEF )
37+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil )
38+ if # g > 0 then
39+ Duel .HintSelection (g )
40+ local tc = g :GetFirst ()
41+ -- Gains 1000 ATK
42+ local e1 = Effect .CreateEffect (c )
43+ e1 :SetType (EFFECT_TYPE_SINGLE )
44+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
45+ e1 :SetValue (1000 )
46+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
47+ tc :RegisterEffect (e1 )
48+ local e2 = Effect .CreateEffect (c )
49+ e2 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
50+ e2 :SetRange (LOCATION_MZONE )
51+ e2 :SetCode (EVENT_PHASE + PHASE_END )
52+ e2 :SetOperation (s .desop )
53+ e2 :SetReset (RESETS_STANDARD_PHASE_END )
54+ e2 :SetCountLimit (1 )
55+ tc :RegisterEffect (e2 )
56+ end
57+ end
58+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
59+ Duel .Destroy (e :GetHandler (),REASON_EFFECT )
60+ end
0 commit comments