1+ -- OTSダイレクトドライバー
2+ -- OuTerverSe Direct Diver
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Name becomes "OuTerverSe" in the Graveyard
7+ local e0 = Effect .CreateEffect (c )
8+ e0 :SetType (EFFECT_TYPE_SINGLE )
9+ e0 :SetCode (EFFECT_CHANGE_CODE )
10+ e0 :SetProperty (EFFECT_FLAG_SINGLE_RANGE )
11+ e0 :SetRange (LOCATION_GRAVE )
12+ e0 :SetValue (160022200 )
13+ c :RegisterEffect (e0 )
14+ -- Change to Galaxy Type
15+ local e1 = Effect .CreateEffect (c )
16+ e1 :SetDescription (aux .Stringid (id ,0 ))
17+ e1 :SetType (EFFECT_TYPE_IGNITION )
18+ e1 :SetRange (LOCATION_MZONE )
19+ e1 :SetCountLimit (1 )
20+ e1 :SetCondition (s .condition )
21+ e1 :SetCost (s .cost )
22+ e1 :SetTarget (s .target )
23+ e1 :SetOperation (s .operation )
24+ c :RegisterEffect (e1 )
25+ end
26+ s .listed_names = {160022200 }
27+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
28+ return e :GetHandler ():IsStatus (STATUS_SUMMON_TURN )
29+ end
30+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
31+ if chk == 0 then return Duel .IsPlayerCanDiscardDeckAsCost (tp ,1 ) end
32+ end
33+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
34+ local c = e :GetHandler ()
35+ if chk == 0 then return c :CanChangeIntoTypeRush (RACE_GALAXY ) end
36+ end
37+ function s .filter (c )
38+ return c :IsFaceup () and c :IsLevel (4 ) and c :IsRace (RACE_GALAXY ) and c :IsType (TYPE_EFFECT )
39+ end
40+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
41+ local c = e :GetHandler ()
42+ -- Requirement
43+ if Duel .DiscardDeck (tp ,1 ,REASON_COST )< 1 then return end
44+ -- Effect
45+ local e1 = Effect .CreateEffect (c )
46+ e1 :SetType (EFFECT_TYPE_SINGLE )
47+ e1 :SetCode (EFFECT_CHANGE_RACE )
48+ e1 :SetValue (RACE_GALAXY )
49+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
50+ c :RegisterEffect (e1 )
51+ if Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_MZONE ,0 ,2 ,nil ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
52+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_MZONE ,0 ,1 ,2 ,nil )
53+ Duel .HintSelection (g )
54+ local c = e :GetHandler ()
55+ for tc in g :Iter () do
56+ local e2 = Effect .CreateEffect (c )
57+ e2 :SetDescription (3205 )
58+ e2 :SetProperty (EFFECT_FLAG_CLIENT_HINT )
59+ e2 :SetType (EFFECT_TYPE_SINGLE )
60+ e2 :SetCode (EFFECT_DIRECT_ATTACK )
61+ e2 :SetReset (RESETS_STANDARD_PHASE_END )
62+ tc :RegisterEffect (e2 )
63+ end
64+ -- can only attack twice
65+ local e3 = Effect .CreateEffect (e :GetHandler ())
66+ e3 :SetDescription (aux .Stringid (id ,2 ))
67+ e3 :SetType (EFFECT_TYPE_FIELD )
68+ e3 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE + EFFECT_FLAG_CLIENT_HINT )
69+ e3 :SetCode (EFFECT_CANNOT_ATTACK_ANNOUNCE )
70+ e3 :SetTargetRange (LOCATION_MZONE ,0 )
71+ e3 :SetCondition (s .atkcon )
72+ e3 :SetReset (RESET_PHASE |PHASE_END )
73+ Duel .RegisterEffect (e3 ,tp )
74+ local e4 = Effect .CreateEffect (e :GetHandler ())
75+ e4 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
76+ e4 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
77+ e4 :SetCode (EVENT_ATTACK_ANNOUNCE )
78+ e4 :SetOperation (s .checkop )
79+ e4 :SetReset (RESET_PHASE |PHASE_END )
80+ e4 :SetLabelObject (e3 )
81+ Duel .RegisterEffect (e4 ,tp )
82+ end
83+ end
84+ function s .atkcon (e )
85+ return e :GetLabel ()== 2
86+ end
87+ function s .checkop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
88+ if Duel .IsTurnPlayer (e :GetHandlerPlayer ()) then
89+ e :GetLabelObject ():SetLabel (e :GetLabelObject ():GetLabel ()+ 1 )
90+ end
91+ end
0 commit comments