1+ -- ヴォイドダスト・フュージョン
2+ -- Void Dust Fusion
3+ -- scripted by Naim
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Fusion Summon a Level 9 DARK Attribute Galaxy Type monster with 2000 or more DEF
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
10+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_FUSION_SUMMON + CATEGORY_TODECK )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetTarget (s .fustg )
13+ e1 :SetOperation (s .fusop )
14+ c :RegisterEffect (e1 )
15+ end
16+ function s .extrafusionmat (exc )
17+ return function (e ,tp ,mg )
18+ return Duel .GetMatchingGroup (s .matfilter ,tp ,LOCATION_GRAVE ,0 ,exc ),s .matexclusioncheck (exc )
19+ end
20+ end
21+ function s .matexclusioncheck (exc )
22+ return function (tp ,sg ,fc )
23+ return not (exc and sg :IsContains (exc ))
24+ end
25+ end
26+ function s .fusmonfilter (c )
27+ return c :IsLevel (9 ) and c :IsAttribute (ATTRIBUTE_DARK ) and c :IsRace (RACE_GALAXY ) and c :IsDefenseAbove (2000 )
28+ end
29+ function s .matfilter (c )
30+ return c :IsAttribute (ATTRIBUTE_DARK ) and c :IsRace (RACE_GALAXY ) and c :IsAbleToDeck ()
31+ end
32+ function s .atklimit (e ,sc ,tp ,sg ,chk )
33+ if chk == 0 then
34+ -- Register a flag to the summoned monster
35+ sc :RegisterFlagEffect (id ,RESETS_STANDARD_PHASE_END ,0 ,1 )
36+ -- Monsters other than the summoned monster cannot attack this turn
37+ local e1 = Effect .CreateEffect (e :GetHandler ())
38+ e1 :SetType (EFFECT_TYPE_FIELD )
39+ e1 :SetCode (EFFECT_CANNOT_ATTACK )
40+ e1 :SetTargetRange (LOCATION_MZONE ,0 )
41+ e1 :SetTarget (function (e ,c ) return not c :HasFlagEffect (id ) end )
42+ e1 :SetReset (RESET_PHASE |PHASE_END )
43+ Duel .RegisterEffect (e1 ,tp )
44+ end
45+ end
46+ function s .costfilter (c ,e ,tp ,eg ,ep ,ev ,re ,r ,rp )
47+ if not (c :IsAttribute (ATTRIBUTE_DARK ) and c :IsRace (RACE_GALAXY ) and c :IsType (TYPE_NORMAL )) then return false end
48+ local fusion_params = {fusfilter = s .fusmonfilter ,
49+ matfilter = aux .FALSE ,
50+ extrafil = s .extrafusionmat (c ),
51+ extraop = Fusion .ShuffleMaterial ,
52+ exactcount = 2 ,
53+ stage2 = s .atklimit
54+ }
55+ return Fusion .SummonEffTG (fusion_params )(e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 )
56+ end
57+ function s .fustg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
58+ if chk == 0 then return Duel .IsExistingMatchingCard (s .costfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ,eg ,ep ,ev ,re ,r ,rp ) end
59+ Duel .SetOperationInfo (0 ,CATEGORY_TODECK ,nil ,2 ,tp ,LOCATION_GRAVE )
60+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_EXTRA )
61+ end
62+ function s .fusop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
63+ local fusion_params = {fusfilter = s .fusmonfilter ,
64+ matfilter = aux .FALSE ,
65+ extrafil = s .extrafusionmat (c ),
66+ extraop = Fusion .ShuffleMaterial ,
67+ exactcount = 2 ,
68+ stage2 = s .atklimit
69+ }
70+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TODECK )
71+ local req_c = Duel .SelectMatchingCard (tp ,s .costfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp ,eg ,ep ,ev ,re ,r ,rp )
72+ Duel .HintSelection (req_c )
73+ Duel .SendtoDeck (req_c ,nil ,SEQ_DECKSHUFFLE ,REASON_EFFECT )
74+ Fusion .SummonEffTG (fusion_params )(e ,tp ,eg ,ep ,ev ,re ,r ,rp ,1 )
75+ Fusion .SummonEffOP (fusion_params )(e ,tp ,eg ,ep ,ev ,re ,r ,rp )
76+ end
0 commit comments