1+ -- CAN-Eb:D
2+ -- CAN - Eb:D
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- name change
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (EFFECT_TYPE_IGNITION )
10+ e1 :SetRange (LOCATION_MZONE )
11+ e1 :SetCountLimit (1 )
12+ e1 :SetCost (s .cost )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .operation )
15+ c :RegisterEffect (e1 )
16+ end
17+ s .listed_names = {CARD_CAN_D ,CARD_FUSION }
18+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
19+ if chk == 0 then return Duel .CheckLPCost (tp ,1000 ) end
20+ end
21+ function s .filter (c ,code )
22+ return c :IsMonster () and c :IsRace (RACE_PSYCHIC ) and not c :IsCode (code )
23+ end
24+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
25+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e :GetHandler ():GetCode ()) end
26+ end
27+ function s .thfilter (c )
28+ return c :IsCode (CARD_CAN_D ,CARD_FUSION ) and c :IsAbleToHand ()
29+ end
30+ function s .chkfilter (c )
31+ return c :IsFaceup () and c :IsType (TYPE_FUSION )
32+ end
33+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
34+ local c = e :GetHandler ()
35+ -- Requirement
36+ Duel .PayLPCost (tp ,1000 )
37+ -- Effect
38+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,c :GetCode ())
39+ if # g > 0 then
40+ Duel .HintSelection (g )
41+ local e1 = Effect .CreateEffect (c )
42+ e1 :SetType (EFFECT_TYPE_SINGLE )
43+ e1 :SetCode (EFFECT_CHANGE_CODE )
44+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
45+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
46+ e1 :SetValue (g :GetFirst ():GetCode ())
47+ c :RegisterEffect (e1 )
48+ if Duel .GetMatchingGroupCount (s .chkfilter ,tp ,LOCATION_MZONE ,0 ,nil )== 0 and Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .thfilter ),tp ,LOCATION_GRAVE ,0 ,1 ,nil ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
49+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
50+ local g = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
51+ if # g > 0 then
52+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
53+ Duel .ConfirmCards (1 - tp ,g )
54+ end
55+ end
56+ end
57+ end
0 commit comments