1+ -- 夢中のドローネ
2+ -- Delirium Drone
3+ -- Scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ local e1 = Effect .CreateEffect (c )
7+ e1 :SetCategory (CATEGORY_ATKCHANGE + CATEGORY_DEFCHANGE )
8+ e1 :SetType (EFFECT_TYPE_IGNITION )
9+ e1 :SetRange (LOCATION_MZONE )
10+ e1 :SetCountLimit (1 )
11+ e1 :SetCondition (s .condition )
12+ e1 :SetCost (s .cost )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .operation )
15+ c :RegisterEffect (e1 )
16+ end
17+ function s .cfilter (c )
18+ return c :IsAttribute (ATTRIBUTE_LIGHT ) and c :IsRace (RACE_INSECT ) and c :IsFaceup ()
19+ end
20+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
21+ return Duel .IsExistingMatchingCard (s .cfilter ,tp ,LOCATION_MZONE ,0 ,1 ,e :GetHandler ())
22+ end
23+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
24+ local c = e :GetHandler ()
25+ if chk == 0 then return c :IsAttackPos () and c :IsCanChangePosition () end
26+ end
27+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
28+ if chk == 0 then return Duel .IsPlayerCanDiscardDeck (tp ,2 ) end
29+ Duel .SetOperationInfo (0 ,CATEGORY_DECKDES ,nil ,0 ,tp ,2 )
30+ end
31+ function s .insectfilter (c )
32+ return c :IsFaceup () and c :IsNotMaximumModeSide () and not c :IsRace (RACE_INSECT )
33+ end
34+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
35+ -- Requirement
36+ local c = e :GetHandler ()
37+ if Duel .ChangePosition (c ,POS_FACEUP_DEFENSE ,0 ,0 ,0 )< 1 then return end
38+ -- Effect
39+ if Duel .DiscardDeck (tp ,2 ,REASON_EFFECT )> 0
40+ and Duel .IsExistingMatchingCard (s .insectfilter ,tp ,0 ,LOCATION_MZONE ,1 ,nil )
41+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
42+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_APPLYTO )
43+ local dg = Duel .SelectMatchingCard (tp ,s .insectfilter ,tp ,0 ,LOCATION_MZONE ,1 ,1 ,nil )
44+ Duel .HintSelection (dg )
45+ local e3 = Effect .CreateEffect (c )
46+ e3 :SetType (EFFECT_TYPE_SINGLE )
47+ e3 :SetCode (EFFECT_CHANGE_RACE )
48+ e3 :SetValue (RACE_INSECT )
49+ e3 :SetReset (RESETS_STANDARD_PHASE_END ,2 )
50+ dg :GetFirst ():RegisterEffect (e3 )
51+ end
52+ end
0 commit comments