22-- Armory Arm
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- synchro summon
6- Synchro .AddProcedure (c ,nil ,1 ,1 ,Synchro .NonTuner (nil ),1 ,99 )
75 c :EnableReviveLimit ()
8- -- equip
6+ -- Synchro Summon procedure: 1 Tuner + 1+ non-Tuner monsters
7+ Synchro .AddProcedure (c ,nil ,1 ,1 ,Synchro .NonTuner (nil ),1 ,99 )
8+ -- Equip this card to 1 monster on the field
99 local e1 = Effect .CreateEffect (c )
1010 e1 :SetDescription (aux .Stringid (id ,0 ))
11- e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
1211 e1 :SetCategory (CATEGORY_EQUIP )
1312 e1 :SetType (EFFECT_TYPE_IGNITION )
13+ e1 :SetProperty (EFFECT_FLAG_CARD_TARGET )
1414 e1 :SetRange (LOCATION_MZONE )
1515 e1 :SetTarget (s .eqtg )
1616 e1 :SetOperation (s .eqop )
1717 c :RegisterEffect (e1 )
18+ -- Unequip this card and Special Summon it in Attack Position
19+ local e2 = Effect .CreateEffect (c )
20+ e2 :SetDescription (aux .Stringid (id ,1 ))
21+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
22+ e2 :SetType (EFFECT_TYPE_IGNITION )
23+ e2 :SetRange (LOCATION_SZONE )
24+ e2 :SetTarget (s .sptg )
25+ e2 :SetOperation (s .spop )
26+ c :RegisterEffect (e2 )
27+ -- While equipped by its effect, the equipped monster gains 1000 ATK
28+ local e3 = Effect .CreateEffect (c )
29+ e3 :SetType (EFFECT_TYPE_EQUIP )
30+ e3 :SetCode (EFFECT_UPDATE_ATTACK )
31+ e3 :SetValue (1000 )
32+ e3 :SetCondition (function (e ) return e :GetHandler ():HasFlagEffect (id + 1 ) end )
33+ c :RegisterEffect (e3 )
34+ -- Inflict damage to your opponent equalto the ATK of the monster in the GY destroyed by battle with the equipped monster
35+ local e4 = Effect .CreateEffect (c )
36+ e4 :SetDescription (aux .Stringid (id ,2 ))
37+ e4 :SetCategory (CATEGORY_DAMAGE )
38+ e4 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F )
39+ e4 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
40+ e4 :SetCode (EVENT_BATTLE_DESTROYED )
41+ e4 :SetRange (LOCATION_SZONE )
42+ e4 :SetCondition (s .damcon )
43+ e4 :SetTarget (s .damtg )
44+ e4 :SetOperation (s .damop )
45+ c :RegisterEffect (e4 )
1846end
1947function s .eqtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
20- if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsFaceup () and chkc ~= e :GetHandler () end
21- if chk == 0 then return e :GetHandler ():GetFlagEffect (id )== 0 and Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0
22- and Duel .IsExistingTarget (Card .IsFaceup ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,e :GetHandler ()) end
48+ local c = e :GetHandler ()
49+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc :IsFaceup () and chkc ~= c end
50+ if chk == 0 then return not c :HasFlagEffect (id ) and Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0
51+ and Duel .IsExistingTarget (Card .IsFaceup ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,c ) end
52+ c :RegisterFlagEffect (id ,RESETS_STANDARD_PHASE_END &~(RESET_TOFIELD |RESET_LEAVE ),0 ,1 )
2353 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_EQUIP )
24- local g = Duel .SelectTarget (tp ,Card .IsFaceup ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,e :GetHandler ())
25- Duel .SetOperationInfo (0 ,CATEGORY_EQUIP ,g ,1 ,0 ,0 )
26- e :GetHandler ():RegisterFlagEffect (id ,RESET_EVENT |RESETS_REDIRECT - RESET_OVERLAY |RESET_PHASE |PHASE_END ,0 ,1 )
54+ Duel .SelectTarget (tp ,Card .IsFaceup ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,c )
55+ Duel .SetOperationInfo (0 ,CATEGORY_EQUIP ,c ,1 ,tp ,0 )
2756end
2857function s .eqop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
2958 local c = e :GetHandler ()
59+ if not (c :IsRelateToEffect (e ) and c :IsFaceup ()) then return end
3060 local tc = Duel .GetFirstTarget ()
31- if not c :IsRelateToEffect (e ) or c :IsFacedown () then return end
32- if not tc :IsRelateToEffect (e ) or tc :IsFacedown () then
33- Duel .SendtoGrave (c ,REASON_EFFECT )
34- return
61+ if not (tc :IsRelateToEffect (e ) and tc :IsFaceup () and Duel .GetLocationCount (tp ,LOCATION_SZONE )> 0 ) then
62+ return Duel .SendtoGrave (c ,REASON_RULE )
63+ end
64+ if Duel .Equip (tp ,c ,tc ) then
65+ c :RegisterFlagEffect (id + 1 ,RESET_EVENT |RESETS_STANDARD ,0 ,1 )
66+ -- Equip limit
67+ local e1 = Effect .CreateEffect (c )
68+ e1 :SetType (EFFECT_TYPE_SINGLE )
69+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
70+ e1 :SetCode (EFFECT_EQUIP_LIMIT )
71+ e1 :SetValue (function (e ,c ) return c == tc end )
72+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
73+ c :RegisterEffect (e1 )
3574 end
36- if not Duel .Equip (tp ,c ,tc ,false ) then return end
37- -- unequip
38- local e1 = Effect .CreateEffect (c )
39- e1 :SetDescription (aux .Stringid (id ,1 ))
40- e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
41- e1 :SetType (EFFECT_TYPE_IGNITION )
42- e1 :SetRange (LOCATION_SZONE )
43- e1 :SetTarget (s .sptg )
44- e1 :SetOperation (s .spop )
45- e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
46- c :RegisterEffect (e1 )
47- -- Atk up
48- local e2 = Effect .CreateEffect (c )
49- e2 :SetType (EFFECT_TYPE_EQUIP )
50- e2 :SetCode (EFFECT_UPDATE_ATTACK )
51- e2 :SetValue (1000 )
52- e2 :SetReset (RESET_EVENT |RESETS_STANDARD )
53- c :RegisterEffect (e2 )
54- -- damage
55- local e3 = Effect .CreateEffect (c )
56- e3 :SetDescription (aux .Stringid (id ,2 ))
57- e3 :SetCategory (CATEGORY_DAMAGE )
58- e3 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F )
59- e3 :SetCode (EVENT_BATTLE_DESTROYED )
60- e3 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
61- e3 :SetRange (LOCATION_SZONE )
62- e3 :SetCondition (s .damcon )
63- e3 :SetTarget (s .damtg )
64- e3 :SetOperation (s .damop )
65- e3 :SetReset (RESET_EVENT |RESETS_STANDARD )
66- c :RegisterEffect (e3 )
67- -- eqlimit
68- local e4 = Effect .CreateEffect (c )
69- e4 :SetType (EFFECT_TYPE_SINGLE )
70- e4 :SetCode (EFFECT_EQUIP_LIMIT )
71- e4 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
72- e4 :SetValue (s .eqlimit )
73- e4 :SetReset (RESET_EVENT |RESETS_STANDARD )
74- e4 :SetLabelObject (tc )
75- c :RegisterEffect (e4 )
76- end
77- function s .eqlimit (e ,c )
78- return c == e :GetLabelObject ()
7975end
8076function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
81- if chk == 0 then return e :GetHandler ():GetFlagEffect (id )== 0 and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
82- and e :GetHandler ():IsCanBeSpecialSummoned (e ,0 ,tp ,true ,false ) end
83- Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,e :GetHandler (),1 ,0 ,0 )
84- e :GetHandler ():RegisterFlagEffect (id ,RESET_EVENT |RESETS_REDIRECT - RESET_OVERLAY |RESET_PHASE |PHASE_END ,0 ,1 )
77+ local c = e :GetHandler ()
78+ if chk == 0 then return not c :HasFlagEffect (id ) and c :HasFlagEffect (id + 1 )
79+ and Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
80+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP_ATTACK ) end
81+ c :RegisterFlagEffect (id ,RESETS_STANDARD_PHASE_END &~(RESET_TOFIELD |RESET_LEAVE ),0 ,1 )
82+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
8583end
8684function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
8785 local c = e :GetHandler ()
88- if not c :IsRelateToEffect (e ) then return end
89- Duel .SpecialSummon (c ,0 ,tp ,tp ,true ,false ,POS_FACEUP_ATTACK )
86+ if c :IsRelateToEffect (e ) then
87+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP_ATTACK )
88+ end
9089end
9190function s .damcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
92- local eqc = e :GetHandler ():GetEquipTarget ()
93- local des = eg :GetFirst ()
94- return des :IsLocation (LOCATION_GRAVE ) and des :GetReasonCard ()== eqc and des :IsMonster ()
91+ local bc = eg :GetFirst ()
92+ local c = e :GetHandler ()
93+ local eqc = c :GetEquipTarget ()
94+ return c :HasFlagEffect (id + 1 ) and eqc and eqc :IsReasonCard (bc ) and bc :IsLocation (LOCATION_GRAVE ) and bc :IsMonster ()
9595end
9696function s .damtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
9797 if chk == 0 then return true end
98- eg :GetFirst ():CreateEffectRelation (e )
98+ local bc = eg :GetFirst ()
99+ bc :CreateEffectRelation (e )
99100 Duel .SetTargetPlayer (1 - tp )
100- Duel .SetOperationInfo (0 ,CATEGORY_DAMAGE ,nil ,0 ,1 - tp ,0 )
101+ Duel .SetOperationInfo (0 ,CATEGORY_DAMAGE ,nil ,0 ,1 - tp ,bc : GetAttack () )
101102end
102103function s .damop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
103- local des = eg :GetFirst ()
104- local p = Duel . GetChainInfo ( 0 , CHAININFO_TARGET_PLAYER )
105- if des : IsRelateToEffect ( e ) then
106- local dam = des : GetAttack ()
107- if dam < 0 then dam = 0 end
108- Duel .Damage (p ,dam ,REASON_EFFECT )
104+ local bc = eg :GetFirst ()
105+ if bc : IsRelateToEffect ( e ) then
106+ local atk = bc : GetAttack ()
107+ if atk <= 0 then return end
108+ local p = Duel . GetChainInfo ( 0 , CHAININFO_TARGET_PLAYER )
109+ Duel .Damage (p ,atk ,REASON_EFFECT )
109110 end
110- end
111+ end
0 commit comments