1+ -- パワーアップゲージ
2+ -- Power Meter
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ local params = {s .fusfilter ,s .matfilter }
7+ -- Add 1 monster from the grave to the hand
8+ local e1 = Effect .CreateEffect (c )
9+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
10+ e1 :SetCategory (CATEGORY_TOHAND )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetCost (s .cost )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .operation (Fusion .SummonEffTG (table.unpack (params )),Fusion .SummonEffOP (table.unpack (params ))))
15+ c :RegisterEffect (e1 )
16+ end
17+ function s .fusfilter (c )
18+ return c :IsRace (RACE_MACHINE ) and c :IsLevel (4 ) and c :IsDefense (800 )
19+ end
20+ function s .matfilter (c )
21+ return c :IsLocation (LOCATION_HAND |LOCATION_MZONE ) and c :IsAbleToGrave ()
22+ end
23+ function s .cfilter (c )
24+ return c :IsFaceup () and c :IsAbleToDeckOrExtraAsCost ()
25+ end
26+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
27+ if chk == 0 then return Duel .IsExistingMatchingCard (s .cfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ) end
28+ end
29+ function s .thfilter (c )
30+ return c :IsAttribute (ATTRIBUTE_LIGHT ) and c :IsRace (RACE_MACHINE ) and c :IsDefense (800 ) and c :IsAbleToHand ()
31+ end
32+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
33+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ) end
34+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_GRAVE )
35+ end
36+ function s .operation (fustg ,fusop )
37+ return function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
38+ -- Requirement
39+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
40+ local g = Duel .SelectMatchingCard (tp ,s .cfilter ,tp ,LOCATION_MZONE ,0 ,1 ,1 ,nil )
41+ if Duel .SendtoDeck (g ,nil ,SEQ_DECKBOTTOM ,REASON_COST )< 1 then return end
42+ -- Effect
43+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
44+ local dg = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
45+ if # dg > 0 then
46+ Duel .SendtoHand (dg ,nil ,REASON_EFFECT )
47+ Duel .ConfirmCards (1 - tp ,dg )
48+ if Duel .IsExistingMatchingCard (Card .IsCode ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,160023056 ) and fustg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
49+ Duel .BreakEffect ()
50+ fusop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
51+ end
52+ end
53+ end
54+ end
0 commit comments