22-- Super Quantal Mech Beast Aeroboros
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- xyz summon
6- Xyz .AddProcedure (c ,nil ,4 ,2 )
75 c :EnableReviveLimit ()
8- -- cannot attack
6+ -- Xyz Summon procedure: 2 Level 4 monsters
7+ Xyz .AddProcedure (c ,nil ,4 ,2 )
8+ -- Cannot attack unless it has Xyz Material
99 local e1 = Effect .CreateEffect (c )
1010 e1 :SetType (EFFECT_TYPE_SINGLE )
1111 e1 :SetCode (EFFECT_CANNOT_ATTACK )
12- e1 :SetCondition (s . atcon )
12+ e1 :SetCondition (function ( e ) return e : GetHandler (): GetOverlayCount () == 0 end )
1313 c :RegisterEffect (e1 )
14- -- pos
14+ -- Change 1 monster to face-down Defense Position
1515 local e2 = Effect .CreateEffect (c )
1616 e2 :SetDescription (aux .Stringid (id ,0 ))
1717 e2 :SetCategory (CATEGORY_POSITION )
1818 e2 :SetType (EFFECT_TYPE_IGNITION )
1919 e2 :SetProperty (EFFECT_FLAG_CARD_TARGET )
2020 e2 :SetRange (LOCATION_MZONE )
2121 e2 :SetCountLimit (1 ,0 ,EFFECT_COUNT_CODE_SINGLE )
22- e2 :SetCondition (s . setcon1 )
23- e2 :SetCost (s . setcost )
22+ e2 :SetCondition (aux . NOT ( s . quickeffcond ) )
23+ e2 :SetCost (Cost . Detach ( 1 ) )
2424 e2 :SetTarget (s .settg )
2525 e2 :SetOperation (s .setop )
2626 c :RegisterEffect (e2 ,false ,REGISTER_FLAG_DETACH_XMAT )
27+ -- This is a Quick effect if this card has "Super Quantum Green Layer" as Xyz Material
2728 local e3 = e2 :Clone ()
2829 e3 :SetType (EFFECT_TYPE_QUICK_O )
2930 e3 :SetCode (EVENT_FREE_CHAIN )
3031 e3 :SetHintTiming (0 ,TIMINGS_CHECK_MONSTER_E )
31- e3 :SetCondition (s .setcon2 )
32+ e3 :SetCondition (s .quickeffcond )
3233 c :RegisterEffect (e3 )
33- -- material
34+ -- Attach 1 "Super Quantum" monster from your hand or field to this card
3435 local e4 = Effect .CreateEffect (c )
3536 e4 :SetDescription (aux .Stringid (id ,1 ))
3637 e4 :SetType (EFFECT_TYPE_IGNITION )
3738 e4 :SetRange (LOCATION_MZONE )
3839 e4 :SetCountLimit (1 )
39- e4 :SetTarget (s .mttg )
40- e4 :SetOperation (s .mtop )
40+ e4 :SetTarget (s .attachtg )
41+ e4 :SetOperation (s .attachop )
4142 c :RegisterEffect (e4 )
4243end
43- s .listed_series = {0x10dc }
44- s .listed_names = {85374678 }
45- function s .atcon (e )
46- return e :GetHandler ():GetOverlayCount ()== 0
47- end
48- function s .setcon1 (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
49- return not e :GetHandler ():GetOverlayGroup ():IsExists (Card .IsCode ,1 ,nil ,85374678 )
50- end
51- function s .setcon2 (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
44+ s .listed_series = {SET_SUPER_QUANTUM }
45+ s .listed_names = {85374678 } -- "Super Quantum Green Layer"
46+ function s .quickeffcond (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
5247 return e :GetHandler ():GetOverlayGroup ():IsExists (Card .IsCode ,1 ,nil ,85374678 )
5348end
54- function s .setcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
55- if chk == 0 then return e :GetHandler ():CheckRemoveOverlayCard (tp ,1 ,REASON_COST ) end
56- e :GetHandler ():RemoveOverlayCard (tp ,1 ,1 ,REASON_COST )
57- end
58- function s .setfilter (c )
59- return c :IsFaceup () and c :IsCanTurnSet ()
60- end
6149function s .settg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
62- if chkc then return chkc :IsLocation (LOCATION_MZONE ) and s . setfilter ( chkc ) and chkc ~= e :GetHandler () end
63- if chk == 0 then return Duel .IsExistingTarget (s . setfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,e :GetHandler ()) end
50+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc : IsCanTurnSet ( ) and chkc ~= e :GetHandler () end
51+ if chk == 0 then return Duel .IsExistingTarget (Card . IsCanTurnSet ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,e :GetHandler ()) end
6452 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_POSCHANGE )
65- local g = Duel .SelectTarget (tp ,s . setfilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,e :GetHandler ())
66- Duel .SetOperationInfo (0 ,CATEGORY_POSITION ,g ,1 ,0 ,0 )
53+ local g = Duel .SelectTarget (tp ,Card . IsCanTurnSet ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,e :GetHandler ())
54+ Duel .SetOperationInfo (0 ,CATEGORY_POSITION ,g ,1 ,tp ,0 )
6755end
6856function s .setop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
6957 local tc = Duel .GetFirstTarget ()
7058 if tc :IsFaceup () and tc :IsRelateToEffect (e ) then
7159 Duel .ChangePosition (tc ,POS_FACEDOWN_DEFENSE )
7260 end
7361end
74- function s .mtfilter (c ,e )
75- return (c :IsLocation (LOCATION_HAND ) or c :IsFaceup ()) and not c :IsType (TYPE_TOKEN ) and c :IsSetCard (0x10dc ) and not c :IsImmuneToEffect (e )
62+ function s .attachfilter (c ,e ,tp ,xc )
63+ return c :IsSetCard (SET_SUPER_QUANTUM ) and c :IsMonster () and not c :IsType (TYPE_TOKEN )
64+ and (c :IsLocation (LOCATION_HAND ) or c :IsFaceup ()) and c :IsCanBeXyzMaterial (xc ,tp ,REASON_EFFECT )
7665end
77- function s .mttg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
78- if chk == 0 then return e :GetHandler ():IsType (TYPE_XYZ )
79- and Duel .IsExistingMatchingCard (s .mtfilter ,tp ,LOCATION_HAND + LOCATION_MZONE ,0 ,1 ,nil ,e ) end
66+ function s .attachtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
67+ local c = e :GetHandler ()
68+ if chk == 0 then return c :IsType (TYPE_XYZ )
69+ and Duel .IsExistingMatchingCard (s .attachfilter ,tp ,LOCATION_HAND |LOCATION_MZONE ,0 ,1 ,nil ,e ,tp ,c ) end
8070end
81- function s .mtop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
71+ function s .attachop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
8272 local c = e :GetHandler ()
8373 if not c :IsRelateToEffect (e ) or c :IsFacedown () then return end
8474 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_XMATERIAL )
85- local tc = Duel .SelectMatchingCard (tp ,s .mtfilter ,tp ,LOCATION_HAND + LOCATION_MZONE ,0 ,1 ,1 ,nil ,e ):GetFirst ()
86- if tc then
75+ local tc = Duel .SelectMatchingCard (tp ,s .attachfilter ,tp ,LOCATION_HAND | LOCATION_MZONE ,0 ,1 ,1 ,nil ,e , tp , c ):GetFirst ()
76+ if tc and not tc : IsImmuneToEffect ( e ) then
8777 Duel .Overlay (c ,tc ,true )
8878 end
89- end
79+ end
0 commit comments