1+ -- ジャンク・ウォリアー・エクストリーム
2+ -- Junk Warrior Extreme
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Synchro Summon procedure: "Junk Synchron" + 1+ non-Tuner monsters
8+ Synchro .AddProcedure (c ,s .tunerfilter ,1 ,1 ,Synchro .NonTuner (nil ),1 ,99 )
9+ -- Special Summon as many Level 2 or lower monsters from your GY as possible
10+ local e1 = Effect .CreateEffect (c )
11+ e1 :SetDescription (aux .Stringid (id ,0 ))
12+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
13+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
14+ e1 :SetProperty (EFFECT_FLAG_DELAY )
15+ e1 :SetCode (EVENT_SPSUMMON_SUCCESS )
16+ e1 :SetCountLimit (1 ,id )
17+ e1 :SetCondition (function (e ) return e :GetHandler ():IsSynchroSummoned () end )
18+ e1 :SetTarget (s .gysptg )
19+ e1 :SetOperation (s .gyspop )
20+ c :RegisterEffect (e1 )
21+ -- Special Summon 1 "Junk" Synchro Monster from your Extra Deck (this is treated as a Synchro Summon)
22+ local e2 = Effect .CreateEffect (c )
23+ e2 :SetDescription (aux .Stringid (id ,1 ))
24+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
25+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
26+ e2 :SetCode (EVENT_BATTLE_DESTROYING )
27+ e2 :SetCountLimit (1 ,{id ,1 })
28+ e2 :SetCondition (aux .bdocon )
29+ e2 :SetCost (Cost .SelfBanish )
30+ e2 :SetTarget (s .exsptg )
31+ e2 :SetOperation (s .exspop )
32+ c :RegisterEffect (e2 )
33+ end
34+ s .material = {CARD_JUNK_SYNCHRON }
35+ s .listed_names = {CARD_JUNK_SYNCHRON }
36+ s .listed_series = {SET_JUNK }
37+ s .material_setcode = SET_SYNCHRON
38+ function s .tunerfilter (c ,lc ,stype ,tp )
39+ return c :IsSummonCode (lc ,stype ,tp ,CARD_JUNK_SYNCHRON ) or c :IsHasEffect (20932152 )
40+ end
41+ function s .gyspfilter (c ,e ,tp )
42+ return c :IsLevelBelow (2 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
43+ end
44+ function s .gysptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
45+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
46+ and Duel .IsExistingMatchingCard (s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
47+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_GRAVE )
48+ end
49+ function s .gyspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
50+ local c = e :GetHandler ()
51+ local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
52+ if ft > 0 then
53+ local g = Duel .GetMatchingGroup (s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,nil ,e ,tp )
54+ ft = math.min (ft ,# g )
55+ if Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then ft = 1 end
56+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
57+ local sg = Duel .SelectMatchingCard (tp ,s .gyspfilter ,tp ,LOCATION_GRAVE ,0 ,ft ,ft ,nil ,e ,tp )
58+ if # sg > 0 and Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0 then
59+ local og = Duel .GetOperatedGroup ()
60+ for sc in og :Iter () do
61+ -- They cannot activate their effects this turn
62+ local e1 = Effect .CreateEffect (c )
63+ e1 :SetDescription (3302 )
64+ e1 :SetType (EFFECT_TYPE_SINGLE )
65+ e1 :SetProperty (EFFECT_FLAG_CLIENT_HINT )
66+ e1 :SetCode (EFFECT_CANNOT_TRIGGER )
67+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
68+ sc :RegisterEffect (e1 )
69+ end
70+ end
71+ end
72+ -- You can only Special Summon once for the rest of this turn
73+ local e1 = Effect .CreateEffect (c )
74+ e1 :SetDescription (aux .Stringid (id ,2 ))
75+ e1 :SetType (EFFECT_TYPE_FIELD )
76+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CLIENT_HINT )
77+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
78+ e1 :SetTargetRange (1 ,0 )
79+ e1 :SetTarget (function (e ,c ,tp ) return Duel .GetActivityCount (tp ,ACTIVITY_SPSUMMON )- e :GetLabel ()>= 1 end )
80+ e1 :SetLabel (Duel .GetActivityCount (tp ,ACTIVITY_SPSUMMON ))
81+ e1 :SetReset (RESET_PHASE |PHASE_END )
82+ Duel .RegisterEffect (e1 ,tp )
83+ local e2 = e1 :Clone ()
84+ e2 :SetCode (EFFECT_LEFT_SPSUMMON_COUNT )
85+ e2 :SetValue (s .countval )
86+ Duel .RegisterEffect (e2 ,tp )
87+ end
88+ function s .countval (e ,re ,tp )
89+ local label = e :GetLabel ()
90+ local sp = Duel .GetActivityCount (tp ,ACTIVITY_SPSUMMON )
91+ if sp - label >= 1 then
92+ return 0
93+ else
94+ return 1 - sp + label
95+ end
96+ end
97+ function s .exspfilter (c ,e ,tp ,mc )
98+ local pg = aux .GetMustBeMaterialGroup (tp ,Group .CreateGroup (),tp ,c ,nil ,REASON_SYNCHRO )
99+ return # pg <= 0 and c :IsSetCard (SET_JUNK ) and c :IsType (TYPE_SYNCHRO ) and Duel .GetLocationCountFromEx (tp ,tp ,mc ,c )> 0
100+ and c :IsCanBeSpecialSummoned (e ,SUMMON_TYPE_SYNCHRO ,tp ,false ,false )
101+ end
102+ function s .exsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
103+ if chk == 0 then return Duel .IsExistingMatchingCard (s .exspfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ,e ,tp ,e :GetHandler ()) end
104+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_EXTRA )
105+ end
106+ function s .exspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
107+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
108+ local sc = Duel .SelectMatchingCard (tp ,s .exspfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,1 ,nil ,e ,tp ):GetFirst ()
109+ if not sc then return end
110+ sc :SetMaterial (nil )
111+ if Duel .SpecialSummon (sc ,SUMMON_TYPE_SYNCHRO ,tp ,tp ,false ,false ,POS_FACEUP )> 0 then
112+ sc :CompleteProcedure ()
113+ end
114+ end
0 commit comments