1+ -- ユニオン・サポーター
2+ -- Union Supporter
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Name change
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,1 ))
9+ e1 :SetCategory (CATEGORY_ATKCHANGE )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetCountLimit (1 )
13+ e1 :SetCost (s .cost )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .operation )
16+ c :RegisterEffect (e1 )
17+ end
18+ s .listed_names = {62651957 ,65622692 ,64500000 }
19+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
20+ if chk == 0 then return Duel .IsPlayerCanDiscardDeckAsCost (tp ,1 ) end
21+ end
22+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
23+ local c = e :GetHandler ()
24+ if chk == 0 then return not c :IsCode (62651957 ,65622692 ,64500000 ) end
25+ end
26+ function s .spfilter (c ,e ,tp )
27+ return c :IsLevel (6 ) and c :IsAttribute (ATTRIBUTE_LIGHT ) and c :IsRace (RACE_MACHINE ) and c :IsType (TYPE_FUSION )
28+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP_DEFENSE )
29+ end
30+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
31+ local c = e :GetHandler ()
32+ -- Requirement
33+ if Duel .DiscardDeck (tp ,1 ,REASON_COST )< 1 then return end
34+ -- Effect
35+ local mats = {}
36+ if c :IsCode (62651957 ) then
37+ mats = {65622692 ,64500000 }
38+ elseif c :IsCode (65622692 ) then
39+ mats = {62651957 ,64500000 }
40+ elseif c :IsCode (64500000 ) then
41+ mats = {65622692 ,62651957 }
42+ else
43+ mats = {62651957 ,65622692 ,64500000 }
44+ end
45+ local announceFilter = {}
46+ for _ ,name in pairs (mats ) do
47+ if # announceFilter == 0 then
48+ table.insert (announceFilter ,name )
49+ table.insert (announceFilter ,OPCODE_ISCODE )
50+ else
51+ table.insert (announceFilter ,name )
52+ table.insert (announceFilter ,OPCODE_ISCODE )
53+ table.insert (announceFilter ,OPCODE_OR )
54+ end
55+ end
56+ local code = Duel .AnnounceCard (tp ,announceFilter )
57+ -- Name change
58+ local e1 = Effect .CreateEffect (c )
59+ e1 :SetType (EFFECT_TYPE_SINGLE )
60+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
61+ e1 :SetCode (EFFECT_CHANGE_CODE )
62+ e1 :SetValue (code )
63+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
64+ c :RegisterEffect (e1 )
65+ local g = Duel .GetMatchingGroup (aux .NecroValleyFilter (s .spfilter ),tp ,LOCATION_GRAVE ,0 ,nil ,e ,tp )
66+ if # g > 0 and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
67+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
68+ local sg = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
69+ if # sg > 0 then
70+ Duel .BreakEffect ()
71+ Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP_DEFENSE )
72+ end
73+ end
74+ end
0 commit comments