22-- Crystal Beast Topaz Tiger
33local s ,id = GetID ()
44function s .initial_effect (c )
5- -- send replace
5+ -- If this card attacks an opponent's monster, it gains 400 ATK during the Damage Step only
6+ local e1 = Effect .CreateEffect (c )
7+ e1 :SetType (EFFECT_TYPE_SINGLE )
8+ e1 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
9+ e1 :SetCode (EFFECT_UPDATE_ATTACK )
10+ e1 :SetRange (LOCATION_MZONE )
11+ e1 :SetCondition (s .atkcon )
12+ e1 :SetValue (400 )
13+ c :RegisterEffect (e1 )
14+ -- Place this card in your Spell & Trap Zone instead of sending it to the GY
615 local e1 = Effect .CreateEffect (c )
716 e1 :SetType (EFFECT_TYPE_SINGLE )
8- e1 :SetCode (EFFECT_TO_GRAVE_REDIRECT_CB )
917 e1 :SetProperty (EFFECT_FLAG_UNCOPYABLE )
10- e1 :SetCondition (s .repcon )
11- e1 :SetOperation (s .repop )
18+ e1 :SetCode (EFFECT_TO_GRAVE_REDIRECT_CB )
19+ e1 :SetCondition (s .replacecon )
20+ e1 :SetOperation (s .replaceop )
1221 c :RegisterEffect (e1 )
13- -- atkup
14- local e2 = Effect .CreateEffect (c )
15- e2 :SetCode (EFFECT_UPDATE_ATTACK )
16- e2 :SetType (EFFECT_TYPE_SINGLE )
17- e2 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
18- e2 :SetRange (LOCATION_MZONE )
19- e2 :SetCondition (s .condition )
20- e2 :SetValue (400 )
21- c :RegisterEffect (e2 )
2222end
23- function s .repcon (e )
23+ function s .atkcon (e )
24+ return Duel .GetAttacker ()== e :GetHandler () and Duel .GetAttackTarget ()~= nil and aux .StatChangeDamageStepCondition ()
25+ end
26+ function s .replacecon (e )
2427 local c = e :GetHandler ()
2528 return c :IsFaceup () and c :IsLocation (LOCATION_MZONE ) and c :IsReason (REASON_DESTROY )
2629end
27- function s .repop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
30+ function s .replaceop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
2831 local c = e :GetHandler ()
2932 local e1 = Effect .CreateEffect (c )
3033 e1 :SetCode (EFFECT_CHANGE_TYPE )
3134 e1 :SetType (EFFECT_TYPE_SINGLE )
3235 e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
33- e1 :SetReset (RESET_EVENT |RESETS_STANDARD &~RESET_TURN_SET )
34- e1 :SetValue (TYPE_SPELL + TYPE_CONTINUOUS )
36+ e1 :SetReset (( RESET_EVENT |RESETS_STANDARD ) &~RESET_TURN_SET )
37+ e1 :SetValue (TYPE_SPELL | TYPE_CONTINUOUS )
3538 c :RegisterEffect (e1 )
3639 Duel .RaiseEvent (c ,EVENT_CUSTOM + CARD_CRYSTAL_TREE ,e ,0 ,tp ,0 ,0 )
3740end
38- function s .condition (e )
39- local phase = Duel .GetCurrentPhase ()
40- return (phase == PHASE_DAMAGE or phase == PHASE_DAMAGE_CAL )
41- and Duel .GetAttacker ()== e :GetHandler () and Duel .GetAttackTarget ()~= nil
42- end
0 commit comments