1+ -- JP name
2+ -- Disguise, the Copycat Hero
3+ -- Scripted by the Razgriz
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon this card from your hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_HAND )
12+ e1 :SetCountLimit (1 ,id )
13+ e1 :SetCondition (s .spcon )
14+ e1 :SetTarget (s .sptg )
15+ e1 :SetOperation (s .spop )
16+ c :RegisterEffect (e1 )
17+ -- Add 1 "Cursed Copycat Noble Arms" from your Deck to your hand
18+ local e2a = Effect .CreateEffect (c )
19+ e2a :SetDescription (aux .Stringid (id ,1 ))
20+ e2a :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
21+ e2a :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
22+ e2a :SetProperty (EFFECT_FLAG_DELAY )
23+ e2a :SetCode (EVENT_SUMMON_SUCCESS )
24+ e2a :SetCountLimit (1 ,{id ,1 })
25+ e2a :SetTarget (s .thtg )
26+ e2a :SetOperation (s .thop )
27+ c :RegisterEffect (e2a )
28+ local e2b = e2a :Clone ()
29+ e2b :SetCode (EVENT_SPSUMMON_SUCCESS )
30+ c :RegisterEffect (e2b )
31+ -- Change this card's Level and name
32+ local e3 = Effect .CreateEffect (c )
33+ e3 :SetDescription (aux .Stringid (id ,2 ))
34+ e3 :SetCategory (CATEGORY_LVCHANGE )
35+ e3 :SetType (EFFECT_TYPE_IGNITION )
36+ e3 :SetProperty (EFFECT_FLAG_CARD_TARGET )
37+ e3 :SetRange (LOCATION_MZONE )
38+ e3 :SetCountLimit (1 ,{id ,2 })
39+ e3 :SetCondition (function (e ) return e :GetHandler ():HasEquipCard () end )
40+ e3 :SetTarget (s .lvnametg )
41+ e3 :SetOperation (s .lvnameop )
42+ c :RegisterEffect (e3 )
43+ end
44+ s .listed_names = {101302082 } -- "Cursed Copycat Noble Arms"
45+ function s .spconfilter (c )
46+ return c :IsEquipSpell () and (c :IsFaceup () or c :GetEquipTarget ())
47+ end
48+ function s .spcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
49+ return Duel .IsExistingMatchingCard (s .spconfilter ,tp ,LOCATION_ONFIELD |LOCATION_GRAVE ,0 ,1 ,nil )
50+ end
51+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
52+ local c = e :GetHandler ()
53+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
54+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
55+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
56+ end
57+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
58+ local c = e :GetHandler ()
59+ if c :IsRelateToEffect (e ) then
60+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
61+ end
62+ end
63+ function s .thfilter (c )
64+ return c :IsCode (101302082 ) and c :IsAbleToHand ()
65+ end
66+ function s .thtg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
67+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
68+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
69+ end
70+ function s .thop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
71+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
72+ local g = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
73+ if # g > 0 then
74+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
75+ Duel .ConfirmCards (1 - tp ,g )
76+ end
77+ end
78+ function s .lvnamefilter (c ,lv ,code )
79+ return not c :IsType (TYPE_TUNER ) and c :IsRace (RACE_WARRIOR ) and c :HasLevel () and c :IsFaceup () and not (c :IsLevel (lv ) and c :IsCode (code ))
80+ end
81+ function s .lvnametg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
82+ local c = e :GetHandler ()
83+ local lv = c :GetLevel ()
84+ local code = c :GetCode ()
85+ if chkc then return chkc :IsLocation (LOCATION_MZONE ) and chkc ~= c and s .lvnamefilter (chkc ,lv ,code ) end
86+ if chk == 0 then return Duel .IsExistingTarget (s .lvnamefilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,c ,lv ,code ) end
87+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
88+ Duel .SelectTarget (tp ,s .lvnamefilter ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,1 ,1 ,c ,lv ,code )
89+ end
90+ function s .lvnameop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
91+ local c = e :GetHandler ()
92+ local tc = Duel .GetFirstTarget ()
93+ if c :IsRelateToEffect (e ) and c :IsFaceup () and tc :IsRelateToEffect (e ) and tc :IsFaceup () then
94+ -- This card's Level, also its name, become the same as that monster's until the End Phase
95+ local e1 = Effect .CreateEffect (c )
96+ e1 :SetType (EFFECT_TYPE_SINGLE )
97+ e1 :SetCode (EFFECT_CHANGE_LEVEL )
98+ e1 :SetValue (tc :GetLevel ())
99+ e1 :SetReset (RESETS_STANDARD_DISABLE_PHASE_END )
100+ c :RegisterEffect (e1 )
101+ local e2 = e1 :Clone ()
102+ e2 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
103+ e2 :SetCode (EFFECT_CHANGE_CODE )
104+ e2 :SetValue (tc :GetCode ())
105+ e2 :SetReset (RESETS_STANDARD_PHASE_END )
106+ c :RegisterEffect (e2 )
107+ end
108+ end
0 commit comments