1+ -- 凍てし心が映す神影
2+ -- Lev Shaddoll Fusion
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- When this card is activated: Send 1 Fusion Monster from your Extra Deck to the GY
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_TOGRAVE )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetCountLimit (1 ,{id ,0 })
13+ e1 :SetCost (s .effcost )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .activate )
16+ c :RegisterEffect (e1 )
17+ -- Special Summon 1 "Shaddoll" Fusion Monster with a different Attribute from your Extra Deck (this is treated as a Fusion Summon), but change its ATK to 0
18+ local e2 = Effect .CreateEffect (c )
19+ e2 :SetDescription (aux .Stringid (id ,1 ))
20+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_ATKCHANGE )
21+ e2 :SetType (EFFECT_TYPE_IGNITION )
22+ e2 :SetRange (LOCATION_SZONE )
23+ e2 :SetCountLimit (1 ,{id ,1 })
24+ e2 :SetCost (Cost .AND (s .spcost ,s .effcost ))
25+ e2 :SetTarget (s .sptg )
26+ e2 :SetOperation (s .spop )
27+ c :RegisterEffect (e2 )
28+ Duel .AddCustomActivityCounter (id ,ACTIVITY_SPSUMMON ,function (c ) return not c :IsSummonLocation (LOCATION_EXTRA ) or c :IsSetCard (SET_SHADDOLL ) end )
29+ end
30+ s .listed_series = {SET_SHADDOLL }
31+ function s .effcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
32+ if chk == 0 then return Duel .GetCustomActivityCount (id ,tp ,ACTIVITY_SPSUMMON )== 0 end
33+ -- You cannot Special Summon from the Extra Deck the turn you activate either of this card's effects, except "Shaddoll" monsters
34+ local e1 = Effect .CreateEffect (e :GetHandler ())
35+ e1 :SetDescription (aux .Stringid (id ,2 ))
36+ e1 :SetType (EFFECT_TYPE_FIELD )
37+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH + EFFECT_FLAG_CLIENT_HINT )
38+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
39+ e1 :SetTargetRange (1 ,0 )
40+ e1 :SetTarget (function (e ,c ) return c :IsLocation (LOCATION_EXTRA ) and not c :IsSetCard (SET_SHADDOLL ) end )
41+ e1 :SetReset (RESET_PHASE |PHASE_END )
42+ Duel .RegisterEffect (e1 ,tp )
43+ end
44+ function s .tgfilter (c )
45+ return c :IsFusionMonster () and c :IsAbleToGrave ()
46+ end
47+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
48+ if chk == 0 then return Duel .IsExistingMatchingCard (s .tgfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ) end
49+ Duel .SetOperationInfo (0 ,CATEGORY_TOGRAVE ,nil ,1 ,tp ,LOCATION_EXTRA )
50+ end
51+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
52+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
53+ local g = Duel .SelectMatchingCard (tp ,s .tgfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,1 ,nil )
54+ if # g > 0 then
55+ Duel .SendtoGrave (g ,REASON_EFFECT )
56+ end
57+ end
58+ function s .spcostfilter (c ,e ,tp )
59+ return c :IsFusionMonster () and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ,e ,tp ,c :GetAttribute (),c )
60+ end
61+ function s .spfilter (c ,e ,tp ,attr ,cost_c )
62+ return c :IsSetCard (SET_SHADDOLL ) and c :IsFusionMonster () and c :IsAttributeExcept (attr )
63+ and c :CheckFusionMaterial () and Duel .GetLocationCountFromEx (tp ,tp ,cost_c ,c )> 0
64+ and c :IsCanBeSpecialSummoned (e ,SUMMON_TYPE_FUSION ,tp ,false ,false )
65+ end
66+ function s .spcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
67+ if chk == 0 then return Duel .CheckReleaseGroupCost (tp ,s .spcostfilter ,1 ,false ,nil ,nil ,e ,tp ) end
68+ local sc = Duel .SelectReleaseGroupCost (tp ,s .spcostfilter ,1 ,1 ,false ,nil ,nil ,e ,tp ):GetFirst ()
69+ e :SetLabel (sc :GetAttribute ())
70+ Duel .Release (sc ,REASON_COST )
71+ end
72+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
73+ if chk == 0 then return true end
74+ Duel .SetTargetParam (e :GetLabel ())
75+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_EXTRA )
76+ end
77+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
78+ local attr = Duel .GetChainInfo (0 ,CHAININFO_TARGET_PARAM )
79+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
80+ local sc = Duel .SelectMatchingCard (tp ,s .spfilter ,tp ,LOCATION_EXTRA ,0 ,1 ,1 ,nil ,e ,tp ,attr ):GetFirst ()
81+ if not sc then return end
82+ sc :SetMaterial (nil )
83+ if Duel .SpecialSummonStep (sc ,SUMMON_TYPE_FUSION ,tp ,tp ,false ,false ,POS_FACEUP ) then
84+ -- Change its ATK to 0
85+ local e1 = Effect .CreateEffect (e :GetHandler ())
86+ e1 :SetType (EFFECT_TYPE_SINGLE )
87+ e1 :SetProperty (EFFECT_FLAG_CANNOT_DISABLE )
88+ e1 :SetCode (EFFECT_SET_ATTACK_FINAL )
89+ e1 :SetValue (0 )
90+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD )
91+ sc :RegisterEffect (e1 )
92+ end
93+ if Duel .SpecialSummonComplete ()> 0 then
94+ sc :CompleteProcedure ()
95+ end
96+ end
0 commit comments