@@ -10,107 +10,105 @@ function s.initial_effect(c)
1010 local e1 = Effect .CreateEffect (c )
1111 e1 :SetType (EFFECT_TYPE_SINGLE )
1212 e1 :SetCode (EFFECT_INDESTRUCTABLE_BATTLE )
13- e1 :SetValue (aux .NOT (aux .TargetBoolFunction (Card .IsSetCard ,SET_NUMBER )))
13+ e1 :SetValue (aux .NOT (aux .TargetBoolFunction (Card .IsSetCard ,SET_NUMBER )))
1414 c :RegisterEffect (e1 )
1515 -- Choose 1 of these effects (Attack Change, Effect Gain, Name Gain)
16- local e2 = Effect .CreateEffect (c )
17- e2 :SetDescription (aux .Stringid (id ,0 ))
18- e2 :SetType (EFFECT_TYPE_QUICK_O )
16+ local e2 = Effect .CreateEffect (c )
17+ e2 :SetDescription (aux .Stringid (id ,0 ))
18+ e2 :SetType (EFFECT_TYPE_QUICK_O )
1919 e2 :SetCode (EVENT_FREE_CHAIN )
20- e2 :SetRange (LOCATION_MZONE )
21- e2 :SetHintTiming (TIMING_BATTLE_PHASE ,TIMING_BATTLE_PHASE )
22- e2 :SetCost (aux .dxmcostgen (1 ,1 ,nil ))
23- e2 :SetTarget (s .efftg )
24- e2 :SetOperation (s .effop )
25- c :RegisterEffect (e2 ,false ,REGISTER_FLAG_DETACH_XMAT )
20+ e2 :SetRange (LOCATION_MZONE )
21+ e2 :SetHintTiming (TIMING_BATTLE_PHASE ,TIMING_BATTLE_PHASE )
22+ e2 :SetCost (aux .dxmcostgen (1 ,1 ,nil ))
23+ e2 :SetTarget (s .efftg )
24+ e2 :SetOperation (s .effop )
25+ c :RegisterEffect (e2 ,false ,REGISTER_FLAG_DETACH_XMAT )
2626end
2727s .listed_series = {SET_NUMBER }
2828s .xyz_number = 8
2929function s .efffilter (c )
30- return c :IsNegatableMonster () and c :IsAttackPos ()
30+ return c :IsNegatableMonster () and c :IsAttackPos ()
3131end
3232function s .efftg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
33- if chk == 0 then return true end
34- local b1 = true
35- local b2 = Duel .IsExistingMatchingCard (s .efffilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil )
36- local tchk ,teg = Duel .CheckEvent (EVENT_ATTACK_ANNOUNCE ,true )
37- local b3 = tchk and teg :GetFirst ():IsControler (1 - tp ) and not teg :GetFirst ():IsCode (511001375 )
38- local op = Duel .SelectEffect (tp ,{b1 ,aux .Stringid (id ,1 )},{b2 ,aux .Stringid (id ,2 )},{b3 ,aux .Stringid (id ,3 )})
39- e :SetLabel (op )
40- if op == 2 then
41- Duel .SetOperationInfo (0 ,CATEGORY_DISABLE ,nil ,1 ,1 - tp ,LOCATION_MZONE )
42- end
33+ if chk == 0 then return true end
34+ local b1 = true
35+ local b2 = Duel .IsExistingMatchingCard (s .efffilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil )
36+ local tchk ,teg = Duel .CheckEvent (EVENT_ATTACK_ANNOUNCE ,true )
37+ local b3 = tchk and teg :GetFirst ():IsControler (1 - tp ) and not teg :GetFirst ():IsCode (511001375 )
38+ local op = Duel .SelectEffect (tp ,{b1 ,aux .Stringid (id ,1 )},{b2 ,aux .Stringid (id ,2 )},{b3 ,aux .Stringid (id ,3 )})
39+ e :SetLabel (op )
40+ if op == 2 then
41+ Duel .SetOperationInfo (0 ,CATEGORY_DISABLE ,nil ,1 ,1 - tp ,LOCATION_MZONE )
42+ end
4343end
4444function s .effop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
45- local c = e :GetHandler ()
46- local op = e :GetLabel ()
47- if op == 1 then
48- -- Change opponent monster's ATK to 0 and the ATK of this card to that original ATK
49- local e1 = Effect .CreateEffect (c )
50- e1 :SetDescription (aux .Stringid (id ,1 ))
51- e1 :SetCategory (CATEGORY_ATKCHANGE )
52- e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
53- e1 :SetCode (EVENT_BATTLE_START )
54- e1 :SetCondition (s .atkcon )
55- e1 :SetOperation (s .atkop )
56- e1 :SetReset (RESETS_STANDARD_PHASE_END )
57- c :RegisterEffect (e1 )
58- elseif op == 2 then
59- -- Negate the effects of 1 opponent's Attack Position monster and this card gains those effects
60- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_NEGATE )
61- local sc = Duel .SelectMatchingCard (tp ,s .efffilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil ):GetFirst ()
62- if sc and not sc :IsStatus (STATUS_DISABLED ) then
63- local code = sc :GetOriginalCode ()
64- sc :NegateEffects (c ,RESETS_STANDARD_PHASE_END )
65- c :CopyEffect (code ,RESETS_STANDARD_PHASE_END )
66- end
67- elseif op == 3 then
68- local a = Duel .GetAttacker ()
69- local code = a :GetOriginalCode ()
70- if a :IsFaceup () and a :IsRelateToBattle () and not a :IsImmuneToEffect (e ) then
71- -- Attacker's name becomes "Unknown"
72- local e1 = Effect .CreateEffect (c )
73- e1 :SetType (EFFECT_TYPE_SINGLE )
74- e1 :SetCode (EFFECT_CHANGE_CODE )
75- e1 :SetValue (511001375 ) -- "Unknown"
76- e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
77- a :RegisterEffect (e1 )
78- if c :IsFaceup () and c :IsRelateToEffect (e ) then
79- -- This card's name gains the name of the attacking monster
80- local e2 = Effect .CreateEffect (c )
81- e2 :SetType (EFFECT_TYPE_SINGLE )
82- e2 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
83- e2 :SetCode (EFFECT_ADD_CODE )
84- e2 :SetValue (code )
85- e2 :SetReset (RESET_EVENT |RESETS_STANDARD )
86- c :RegisterEffect (e2 )
45+ local c = e :GetHandler ()
46+ local op = e :GetLabel ()
47+ if op == 1 then
48+ -- Change opponent monster's ATK to 0 and the ATK of this card to that original ATK
49+ local e1 = Effect .CreateEffect (c )
50+ e1 :SetDescription (aux .Stringid (id ,1 ))
51+ e1 :SetCategory (CATEGORY_ATKCHANGE )
52+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
53+ e1 :SetCode (EVENT_BATTLE_START )
54+ e1 :SetCondition (s .atkcon )
55+ e1 :SetOperation (s .atkop )
56+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
57+ c :RegisterEffect (e1 )
58+ elseif op == 2 then
59+ -- Negate the effects of 1 opponent's Attack Position monster and this card gains those effects
60+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_NEGATE )
61+ local sc = Duel .SelectMatchingCard (tp ,s .efffilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil ):GetFirst ()
62+ if sc and not sc :IsStatus (STATUS_DISABLED ) then
63+ local code = sc :GetOriginalCode ()
64+ sc :NegateEffects (c ,RESETS_STANDARD_PHASE_END )
65+ c :CopyEffect (code ,RESETS_STANDARD_PHASE_END )
66+ end
67+ elseif op == 3 then
68+ local a = Duel .GetAttacker ()
69+ local code = a :GetOriginalCode ()
70+ if a :IsFaceup () and a :IsRelateToBattle () and not a :IsImmuneToEffect (e ) then
71+ -- Attacker's name becomes "Unknown"
72+ local e1 = Effect .CreateEffect (c )
73+ e1 :SetType (EFFECT_TYPE_SINGLE )
74+ e1 :SetCode (EFFECT_CHANGE_CODE )
75+ e1 :SetValue (511001375 ) -- "Unknown"
76+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
77+ a :RegisterEffect (e1 )
78+ if c :IsFaceup () and c :IsRelateToEffect (e ) then
79+ -- This card's name gains the name of the attacking monster
80+ local e2 = Effect .CreateEffect (c )
81+ e2 :SetType (EFFECT_TYPE_SINGLE )
82+ e2 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
83+ e2 :SetCode (EFFECT_ADD_CODE )
84+ e2 :SetValue (code )
85+ e2 :SetReset (RESET_EVENT |RESETS_STANDARD )
86+ c :RegisterEffect (e2 )
8787 end
88- end
88+ end
8989 end
90- end
90+ end
9191function s .atkcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
92- local c = e :GetHandler ()
93- local bc = c :GetBattleTarget ()
94- return c :IsRelateToBattle () and bc and bc :IsFaceup () and bc :IsRelateToBattle ()
92+ local c = e :GetHandler ()
93+ local bc = c :GetBattleTarget ()
94+ return c :IsRelateToBattle () and bc and bc :IsFaceup () and bc :IsRelateToBattle ()
9595 and bc :GetBaseAttack ()~= c :GetAttack () and bc :HasNonZeroAttack ()
9696end
9797function s .atkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
98- local c = e :GetHandler ()
99- local bc = c :GetBattleTarget ()
100- if c :IsFaceup () and c :IsRelateToBattle () and bc :IsFaceup () and bc :IsRelateToBattle () then
101- local e1 = Effect .CreateEffect (c )
102- e1 :SetType (EFFECT_TYPE_SINGLE )
103- e1 :SetCode (EFFECT_SET_ATTACK_FINAL )
104- e1 :SetValue (bc :GetBaseAttack ())
105- e1 :SetReset (RESETS_STANDARD_PHASE_END )
106- c :RegisterEffect (e1 )
107- local e1 = Effect .CreateEffect (c )
108- e1 :SetType (EFFECT_TYPE_SINGLE )
109- e1 :SetCode (EFFECT_SET_ATTACK_FINAL )
110- e1 :SetValue (0 )
111- e1 :SetReset (RESETS_STANDARD_PHASE_END )
112- bc :RegisterEffect (e1 )
113- end
114- end
115-
116-
98+ local c = e :GetHandler ()
99+ local bc = c :GetBattleTarget ()
100+ if c :IsFaceup () and c :IsRelateToBattle () and bc :IsFaceup () and bc :IsRelateToBattle () then
101+ local e1 = Effect .CreateEffect (c )
102+ e1 :SetType (EFFECT_TYPE_SINGLE )
103+ e1 :SetCode (EFFECT_SET_ATTACK_FINAL )
104+ e1 :SetValue (bc :GetBaseAttack ())
105+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
106+ c :RegisterEffect (e1 )
107+ local e1 = Effect .CreateEffect (c )
108+ e1 :SetType (EFFECT_TYPE_SINGLE )
109+ e1 :SetCode (EFFECT_SET_ATTACK_FINAL )
110+ e1 :SetValue (0 )
111+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
112+ bc :RegisterEffect (e1 )
113+ end
114+ end
0 commit comments