1+ -- 総剣司令 ソウザ
2+ -- Commander Souza, Swordmaster
3+ -- Scripted by the Razgriz
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ -- Synchro Summon procedure: 1 Tuner + 1+ EARTH monsters
8+ Synchro .AddProcedure (c ,nil ,1 ,1 ,aux .FilterBoolFunctionEx (Card .IsAttribute ,ATTRIBUTE_EARTH ),1 ,99 )
9+ -- Multiple Tuner check
10+ local e0 = Effect .CreateEffect (c )
11+ e0 :SetType (EFFECT_TYPE_SINGLE )
12+ e0 :SetCode (EFFECT_MATERIAL_CHECK )
13+ e0 :SetValue (s .valcheck )
14+ c :RegisterEffect (e0 )
15+ -- Gains 200 ATK for each banished monster
16+ local e1 = Effect .CreateEffect (c )
17+ e1 :SetType (EFFECT_TYPE_SINGLE )
18+ e1 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
19+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
20+ e1 :SetRange (LOCATION_MZONE )
21+ e1 :SetValue (function (e ,c ) return 200 * Duel .GetMatchingGroupCount (aux .FaceupFilter (Card .IsMonster ),0 ,LOCATION_REMOVED ,LOCATION_REMOVED ,nil ) end )
22+ c :RegisterEffect (e1 )
23+ -- Draw 1 card
24+ local e2 = Effect .CreateEffect (c )
25+ e2 :SetDescription (aux .Stringid (id ,0 ))
26+ e2 :SetCategory (CATEGORY_DRAW )
27+ e2 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
28+ e2 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
29+ e2 :SetCode (EVENT_BATTLE_DESTROYING )
30+ e2 :SetCondition (aux .bdocon )
31+ e2 :SetTarget (s .drtg )
32+ e2 :SetOperation (s .drop )
33+ c :RegisterEffect (e2 )
34+ -- Destroy 1 card your opponent controls
35+ local e3 = Effect .CreateEffect (c )
36+ e3 :SetDescription (aux .Stringid (id ,1 ))
37+ e3 :SetCategory (CATEGORY_DESTROY )
38+ e3 :SetType (EFFECT_TYPE_QUICK_O )
39+ e3 :SetCode (EVENT_CHAINING )
40+ e3 :SetRange (LOCATION_MZONE )
41+ e3 :SetCountLimit (1 )
42+ e3 :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) return ep == 1 - tp end )
43+ e3 :SetCost (s .descost )
44+ e3 :SetTarget (s .destg )
45+ e3 :SetOperation (s .desop )
46+ c :RegisterEffect (e3 )
47+ -- If this card would be destroyed by battle or card effect, you can banish 1 "Saber" card from your GY instead
48+ local e4 = Effect .CreateEffect (c )
49+ e4 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS )
50+ e4 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
51+ e4 :SetCode (EFFECT_DESTROY_REPLACE )
52+ e4 :SetRange (LOCATION_MZONE )
53+ e4 :SetTarget (s .desreptg )
54+ c :RegisterEffect (e4 )
55+ end
56+ s .listed_series = {SET_X_SABER ,SET_SABER }
57+ s .listed_names = {id }
58+ function s .valcheck (e ,c )
59+ local g = c :GetMaterial ()
60+ if g :IsExists (Card .IsType ,2 ,nil ,TYPE_TUNER ) then
61+ local e1 = Effect .CreateEffect (c )
62+ e1 :SetType (EFFECT_TYPE_SINGLE )
63+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE )
64+ e1 :SetCode (EFFECT_MULTIPLE_TUNERS )
65+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD &~(RESET_TOFIELD )|RESET_PHASE |PHASE_END )
66+ c :RegisterEffect (e1 )
67+ end
68+ end
69+ function s .drtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
70+ if chk == 0 then return Duel .IsPlayerCanDraw (tp ,1 ) end
71+ Duel .SetTargetPlayer (tp )
72+ Duel .SetTargetParam (1 )
73+ Duel .SetOperationInfo (0 ,CATEGORY_DRAW ,nil ,0 ,tp ,1 )
74+ end
75+ function s .drop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
76+ local p ,d = Duel .GetChainInfo (0 ,CHAININFO_TARGET_PLAYER ,CHAININFO_TARGET_PARAM )
77+ Duel .Draw (p ,d ,REASON_EFFECT )
78+ end
79+ function s .descostfilter (c ,tp )
80+ return c :IsSetCard (SET_X_SABER ) and Duel .IsExistingMatchingCard (nil ,tp ,0 ,LOCATION_ONFIELD ,1 ,c )
81+ end
82+ function s .descost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
83+ if chk == 0 then return Duel .CheckReleaseGroupCost (tp ,s .descostfilter ,1 ,false ,nil ,nil ,tp ) end
84+ local g = Duel .SelectReleaseGroupCost (tp ,s .descostfilter ,1 ,1 ,false ,nil ,nil ,tp )
85+ Duel .Release (g ,REASON_COST )
86+ end
87+ function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
88+ local g = Duel .GetFieldGroup (tp ,0 ,LOCATION_ONFIELD )
89+ if chk == 0 then return # g > 0 end
90+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g ,1 ,tp ,0 )
91+ end
92+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
93+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
94+ local g = Duel .SelectMatchingCard (tp ,nil ,tp ,0 ,LOCATION_ONFIELD ,1 ,1 ,nil )
95+ if # g > 0 then
96+ Duel .HintSelection (g )
97+ Duel .Destroy (g ,REASON_EFFECT )
98+ end
99+ end
100+ function s .desrepfilter (c )
101+ return c :IsSetCard (SET_SABER ) and c :IsAbleToRemove () and aux .SpElimFilter (c ,true )
102+ end
103+ function s .desreptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
104+ local c = e :GetHandler ()
105+ if chk == 0 then return not c :IsReason (REASON_REPLACE )
106+ and Duel .IsExistingMatchingCard (s .desrepfilter ,tp ,LOCATION_MZONE |LOCATION_GRAVE ,0 ,1 ,c ) end
107+ if Duel .SelectEffectYesNo (tp ,c ) then
108+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESREPLACE )
109+ local g = Duel .SelectMatchingCard (tp ,s .desrepfilter ,tp ,LOCATION_MZONE |LOCATION_GRAVE ,0 ,1 ,1 ,c )
110+ return Duel .Remove (g ,POS_FACEUP ,REASON_EFFECT )> 0
111+ end
112+ return false
113+ end
0 commit comments