11-- 方界曼荼羅
22-- Cubic Mandala
3+ local COUNTER_CUBIC = 0x1038
34local s ,id = GetID ()
45function s .initial_effect (c )
56 -- Activate
@@ -13,14 +14,14 @@ function s.initial_effect(c)
1314 e1 :SetTarget (s .target )
1415 e1 :SetOperation (s .activate )
1516 c :RegisterEffect (e1 )
16- -- disable
17+ -- While your opponent controls any of the monsters Summoned by this effect, negate any monster effects your opponent activates
1718 local e2 = Effect .CreateEffect (c )
1819 e2 :SetType (EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD )
1920 e2 :SetRange (LOCATION_SZONE )
2021 e2 :SetCode (EVENT_CHAIN_ACTIVATING )
2122 e2 :SetOperation (s .disop )
2223 c :RegisterEffect (e2 )
23- -- destroy
24+ -- When the last of the monsters Summoned by this effect leaves the field, destroy this card
2425 local e3 = Effect .CreateEffect (c )
2526 e3 :SetType (EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_FIELD )
2627 e3 :SetRange (LOCATION_SZONE )
@@ -29,24 +30,24 @@ function s.initial_effect(c)
2930 e3 :SetOperation (s .desop )
3031 c :RegisterEffect (e3 )
3132end
32- s .counter_place_list = {0x1038 }
33+ s .counter_place_list = {COUNTER_CUBIC }
3334s .listed_series = {SET_CUBIC }
3435function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
3536 return Duel .IsExistingMatchingCard (aux .FaceupFilter (Card .IsSetCard ,SET_CUBIC ),tp ,LOCATION_MZONE ,0 ,1 ,nil )
3637end
3738function s .spfilter (c ,e ,tp ,tid )
3839 return c :IsReason (REASON_DESTROY ) and c :IsMonster () and c :GetTurnID ()== tid
3940 and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP ,1 - tp )
40- and Duel .IsCanAddCounter (tp ,0x1038 ,1 ,c )
41+ and Duel .IsCanAddCounter (tp ,COUNTER_CUBIC ,1 ,c )
4142end
4243function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
4344 local tid = Duel .GetTurnCount ()
4445 if chkc then return chkc :IsLocation (LOCATION_GRAVE ) and chkc :IsControler (1 - tp ) and s .spfilter (chkc ,e ,tp ,tid ) end
4546 local ft = Duel .GetLocationCount (1 - tp ,LOCATION_MZONE ,tp )
4647 if chk == 0 then return ft > 0
4748 and Duel .IsExistingTarget (s .spfilter ,tp ,0 ,LOCATION_GRAVE ,1 ,nil ,e ,tp ,tid ) end
48- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
4949 if Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then ft = 1 end
50+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
5051 local g = Duel .SelectTarget (tp ,s .spfilter ,tp ,0 ,LOCATION_GRAVE ,1 ,ft ,nil ,e ,tp ,tid )
5152 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,g ,# g ,0 ,0 )
5253end
@@ -60,8 +61,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
6061 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
6162 sg = sg :Select (tp ,ft ,ft ,nil )
6263 end
63- local sc = sg :GetFirst ()
64- for sc in aux .Next (sg ) do
64+ for sc in sg :Iter () do
6565 if Duel .SpecialSummonStep (sc ,0 ,tp ,1 - tp ,false ,false ,POS_FACEUP ) then
6666 c :SetCardTarget (sc )
6767 local e1 = Effect .CreateEffect (c )
@@ -74,29 +74,25 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
7474 end
7575 Duel .SpecialSummonComplete ()
7676 local og = Duel .GetOperatedGroup ()
77- local oc = og :GetFirst ()
78- for oc in aux .Next (og ) do
79- oc :AddCounter (0x1038 ,1 )
77+ for oc in og :Iter () do
78+ oc :AddCounter (COUNTER_CUBIC ,1 )
8079 local e2 = Effect .CreateEffect (c )
8180 e2 :SetType (EFFECT_TYPE_SINGLE )
8281 e2 :SetCode (EFFECT_CANNOT_ATTACK )
83- e2 :SetCondition (s . disable )
82+ e2 :SetCondition (function ( e ) return e : GetHandler (): GetCounter ( COUNTER_CUBIC ) > 0 end )
8483 e2 :SetReset (RESET_EVENT |RESETS_STANDARD )
8584 oc :RegisterEffect (e2 )
8685 local e3 = e2 :Clone ()
8786 e3 :SetCode (EFFECT_DISABLE )
8887 oc :RegisterEffect (e3 )
8988 end
9089end
91- function s .disable (e )
92- return e :GetHandler ():GetCounter (0x1038 )> 0
93- end
9490function s .dfilter (c ,g )
9591 return g :IsContains (c )
9692end
9793function s .disop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
9894 local g = e :GetHandler ():GetCardTarget ()
99- if re :IsMonsterEffect () and rp ~= tp
95+ if re :IsMonsterEffect () and rp == 1 - tp
10096 and Duel .IsExistingMatchingCard (s .dfilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil ,g ) then
10197 Duel .NegateEffect (ev )
10298 end
0 commit comments