1+ -- 磁石の戦士マグネット・テルスリオン
2+ -- Tellusrion the Magna Warrior
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ c :EnableReviveLimit ()
7+ c :AddMustBeSpecialSummoned ()
8+ -- Must be Special Summoned (from your GY) by banishing 1 "Magnet Warrior Σ+" and 1 "Magnet Warrior Σ-" from your hand, face-up Monster Zone, and/or GY
9+ local e0 = Effect .CreateEffect (c )
10+ e0 :SetDescription (aux .Stringid (id ,0 ))
11+ e0 :SetType (EFFECT_TYPE_FIELD )
12+ e0 :SetProperty (EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE )
13+ e0 :SetCode (EFFECT_SPSUMMON_PROC )
14+ e0 :SetRange (LOCATION_GRAVE )
15+ e0 :SetCondition (s .selfspcon )
16+ e0 :SetTarget (s .selfsptg )
17+ e0 :SetOperation (s .selfspop )
18+ c :RegisterEffect (e0 )
19+ -- Destroy 1 monster your opponent controlst, or if you targeted an EARTH monster at activation, you can take control of it instead
20+ local e1 = Effect .CreateEffect (c )
21+ e1 :SetDescription (aux .Stringid (id ,1 ))
22+ e1 :SetCategory (CATEGORY_DESTROY + CATEGORY_CONTROL )
23+ e1 :SetType (EFFECT_TYPE_QUICK_O )
24+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
25+ e1 :SetCode (EVENT_CHAINING )
26+ e1 :SetRange (LOCATION_MZONE )
27+ e1 :SetCountLimit (1 )
28+ e1 :SetCondition (function (e ,tp ,eg ,ep ,ev ,re ,r ,rp ) return rp == 1 - tp end )
29+ e1 :SetTarget (s .destg )
30+ e1 :SetOperation (s .desop )
31+ c :RegisterEffect (e1 )
32+ -- Special Summon 2 of your banished "Magnet Warrior Σ" monsters
33+ local e2 = Effect .CreateEffect (c )
34+ e2 :SetDescription (aux .Stringid (id ,1 ))
35+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
36+ e2 :SetType (EFFECT_TYPE_QUICK_O )
37+ e2 :SetCode (EVENT_FREE_CHAIN )
38+ e2 :SetRange (LOCATION_MZONE )
39+ e2 :SetCondition (function (e ,tp ) return Duel .IsTurnPlayer (1 - tp ) end )
40+ e2 :SetCost (Cost .SelfTribute )
41+ e2 :SetTarget (s .rmsptg )
42+ e2 :SetOperation (s .rmspop )
43+ e2 :SetHintTiming (0 ,TIMING_STANDBY_PHASE |TIMING_MAIN_END |TIMINGS_CHECK_MONSTER_E )
44+ c :RegisterEffect (e2 )
45+ end
46+ s .listed_names = {101303005 ,101303006 } -- "Magnet Warrior Σ+", "Magnet Warrior Σ-"
47+ s .listed_series = {SET_MAGNET_WARRIOR_SIGMA }
48+ function s .selfspcostfilter (c )
49+ return c :IsCode (101303005 ,101303006 ) and (c :IsFaceup () or not c :IsOnField ()) and c :IsAbleToRemoveAsCost () and aux .SpElimFilter (c ,true ,true )
50+ end
51+ function s .rescon (sg ,e ,tp ,mg )
52+ return Duel .GetMZoneCount (tp ,sg )> 0 and sg :IsExists (Card .IsCode ,1 ,nil ,101303005 ) and sg :IsExists (Card .IsCode ,1 ,nil ,101303006 )
53+ end
54+ function s .selfspcon (e ,c )
55+ if c == nil then return true end
56+ local tp = e :GetHandlerPlayer ()
57+ local g = Duel .GetMatchingGroup (s .selfspcostfilter ,tp ,LOCATION_HAND |LOCATION_MZONE |LOCATION_GRAVE ,0 ,nil )
58+ return # g >= 2 and Duel .GetMZoneCount (tp ,g )> 0 and aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon ,0 )
59+ end
60+ function s .selfsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,c )
61+ local g = Duel .GetMatchingGroup (s .selfspcostfilter ,tp ,LOCATION_HAND |LOCATION_MZONE |LOCATION_GRAVE ,0 ,nil )
62+ local sg = aux .SelectUnselectGroup (g ,e ,tp ,2 ,2 ,s .rescon ,1 ,tp ,HINTMSG_REMOVE ,nil ,nil ,true )
63+ if # sg > 0 then
64+ e :SetLabelObject (sg )
65+ return true
66+ end
67+ return false
68+ end
69+ function s .selfspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
70+ local sg = e :GetLabelObject ()
71+ if sg then
72+ Duel .Remove (sg ,POS_FACEUP ,REASON_COST )
73+ end
74+ end
75+ function s .destg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
76+ if chkc then return chkc :IsControler (1 - tp ) and chkc :IsLocation (LOCATION_MZONE ) end
77+ if chk == 0 then return Duel .IsExistingTarget (nil ,tp ,0 ,LOCATION_MZONE ,1 ,nil ) end
78+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
79+ local tc = Duel .SelectTarget (tp ,nil ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil ):GetFirst ()
80+ if tc :IsAttribute (ATTRIBUTE_EARTH ) and tc :IsFaceup () then
81+ e :SetLabel (100 )
82+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_DESTROY ,tc ,1 ,tp ,0 )
83+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_CONTROL ,tc ,1 ,tp ,0 )
84+ else
85+ e :SetLabel (0 )
86+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,tc ,1 ,tp ,0 )
87+ end
88+ end
89+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
90+ local tc = Duel .GetFirstTarget ()
91+ if not tc :IsRelateToEffect (e ) then return end
92+ local earth_chk = e :GetLabel ()== 100
93+ if earth_chk and tc :IsControlerCanBeChanged () and Duel .SelectYesNo (tp ,aux .Stringid (id ,3 )) then
94+ Duel .GetControl (tc ,tp )
95+ else
96+ Duel .Destroy (tc ,REASON_EFFECT )
97+ end
98+ end
99+ function s .rmspfilter (c ,e ,tp )
100+ return c :IsSetCard (SET_MAGNET_WARRIOR_SIGMA ) and c :IsFaceup () and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
101+ end
102+ function s .rmsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
103+ if chk == 0 then return Duel .GetMZoneCount (tp ,e :GetHandler ())>= 2
104+ and not Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT )
105+ and Duel .IsExistingMatchingCard (s .rmspfilter ,tp ,LOCATION_REMOVED ,0 ,2 ,nil ,e ,tp ) end
106+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,2 ,tp ,LOCATION_REMOVED )
107+ end
108+ function s .rmspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
109+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )< 2 or Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then return end
110+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
111+ local g = Duel .SelectMatchingCard (tp ,s .rmspfilter ,tp ,LOCATION_REMOVED ,0 ,2 ,2 ,nil ,e ,tp )
112+ if # g == 2 then
113+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
114+ end
115+ end
0 commit comments