1+ -- 救惺の狂撃 スレイ
2+ -- Slay the Star Protector's Gunslinger
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Change name and Fusion Summon
7+ local params = {s .fusfilter ,Fusion .OnFieldMat (Card .IsAbleToDeck ),s .fextra ,s .fproc ,Fusion .ForcedHandler }
8+ local e1 = Effect .CreateEffect (c )
9+ e1 :SetDescription (aux .Stringid (id ,0 ))
10+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_FUSION_SUMMON )
11+ e1 :SetType (EFFECT_TYPE_IGNITION )
12+ e1 :SetRange (LOCATION_MZONE )
13+ e1 :SetCountLimit (1 )
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 .fusfilter (c )
19+ return c :IsAttribute (ATTRIBUTE_WATER ) and c :IsRace (RACE_MAGICALKNIGHT |RACE_WYRM )
20+ end
21+ function s .fextra (e ,tp ,mg )
22+ return Duel .GetMatchingGroup (Fusion .IsMonsterFilter (Card .IsAbleToDeck ),tp ,LOCATION_GRAVE ,0 ,nil )
23+ end
24+ function s .fproc (e ,tc ,tp ,sg )
25+ local gg = sg :Filter (Card .IsLocation ,nil ,LOCATION_HAND |LOCATION_GRAVE )
26+ if # gg > 0 then Duel .HintSelection (gg ,true ) end
27+ local rg = sg :Filter (Card .IsFacedown ,nil )
28+ if # rg > 0 then Duel .ConfirmCards (1 - tp ,rg ) end
29+ Duel .SendtoDeck (sg ,nil ,SEQ_DECKBOTTOM ,REASON_EFFECT + REASON_MATERIAL + REASON_FUSION )
30+ local dg = Duel .GetOperatedGroup ():Filter (Card .IsLocation ,nil ,LOCATION_DECK )
31+ local ct = dg :FilterCount (Card .IsControler ,nil ,tp )
32+ if ct > 0 then
33+ Duel .SortDeckbottom (tp ,tp ,ct )
34+ end
35+ if # dg > ct then
36+ Duel .SortDeckbottom (tp ,1 - tp ,# dg - ct )
37+ end
38+ sg :Clear ()
39+ end
40+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
41+ if chk == 0 then return Duel .IsPlayerCanDiscardDeck (tp ,1 ) end
42+ Duel .SetOperationInfo (0 ,CATEGORY_DECKDES ,nil ,0 ,tp ,1 )
43+ end
44+ function s .operation (fustg ,fusop )
45+ return function (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
46+ local c = e :GetHandler ()
47+ -- Effect
48+ Duel .DiscardDeck (tp ,1 ,REASON_EFFECT )
49+ local g = Duel .GetOperatedGroup ()
50+ local ct = g :GetFirst ()
51+ if ct and ct :IsCode (CARD_FUSION ) and fustg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,0 ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
52+ Duel .BreakEffect ()
53+ fusop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
54+ end
55+ end
56+ end
0 commit comments