1+ -- 髑巌襲来
2+ -- Skullcrag Incursion
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Send to the Graveyard and Fusion Summon
7+ local params = {s .filter ,s .mfilter ,s .fextra ,Fusion .ShuffleMaterial }
8+ local e1 = Effect .CreateEffect (c )
9+ e1 :SetDescription (aux .Stringid (id ,0 ))
10+ e1 :SetCategory (CATEGORY_DESTROY )
11+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
12+ e1 :SetCode (EVENT_FREE_CHAIN )
13+ e1 :SetCondition (s .condition )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .operation (Fusion .SummonEffTG (table.unpack (params )),Fusion .SummonEffOP (table.unpack (params ))))
16+ c :RegisterEffect (e1 )
17+ end
18+ function s .filter (c )
19+ return c :IsRace (RACE_ZOMBIE ) and c :IsDefense (0 )
20+ end
21+ function s .mfilter (c )
22+ return c :IsRace (RACE_ZOMBIE ) and c :IsLocation (LOCATION_GRAVE |LOCATION_MZONE ) and c :IsAbleToDeck ()
23+ end
24+ function s .fextra (e ,tp ,mg )
25+ return Duel .GetMatchingGroup (s .mfilter ,tp ,LOCATION_GRAVE |LOCATION_MZONE ,0 ,nil )
26+ end
27+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
28+ return Duel .GetMatchingGroupCountRush (Card .IsNotMaximumModeSide ,tp ,LOCATION_MZONE ,LOCATION_MZONE ,nil )>= 3
29+ end
30+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
31+ local dg = Duel .GetMatchingGroup (Card .IsSpellTrap ,tp ,0 ,LOCATION_ONFIELD ,nil )
32+ if chk == 0 then return # dg > 0 end
33+ end
34+ function s .operation (fustg ,fusop )
35+ return function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
36+ -- Effect
37+ local dg = Duel .GetMatchingGroup (Card .IsSpellTrap ,tp ,0 ,LOCATION_ONFIELD ,nil )
38+ if # dg > 0 then
39+ local sg = dg :Select (tp ,1 ,1 ,nil )
40+ Duel .HintSelection (sg )
41+ if Duel .Destroy (sg ,REASON_EFFECT )> 0 and fustg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
42+ Duel .BreakEffect ()
43+ fusop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
44+ end
45+ end
46+ end
47+ end
0 commit comments