1+ -- ドラゴニック・ピースボンバー
2+ -- Dragonic Peace Bomber
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Shuffle up to 5 monsters from any GY to the deck
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_SSET )
12+ e1 :SetCondition (s .condition )
13+ e1 :SetTarget (s .target )
14+ e1 :SetOperation (s .operation )
15+ c :RegisterEffect (e1 )
16+ end
17+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
18+ return eg :IsExists (Card .IsControler ,1 ,nil ,1 - tp ) and Duel .IsTurnPlayer (1 - tp )
19+ end
20+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
21+ local dg = Duel .GetMatchingGroup (Card .IsFacedown ,tp ,0 ,LOCATION_SZONE ,nil )
22+ if chk == 0 then return # dg > 0 end
23+ end
24+ function s .filter (c )
25+ return c :IsType (TYPE_SPELL ) and not c :IsNormalSpell ()
26+ end
27+ function s .spfilter (c ,e ,tp )
28+ return c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
29+ end
30+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
31+ local dg = Duel .GetMatchingGroup (Card .IsFacedown ,tp ,0 ,LOCATION_SZONE ,nil )
32+ if # dg > 0 then
33+ local sg = dg :Select (tp ,1 ,1 ,nil )
34+ Duel .HintSelection (sg )
35+ local ct = Duel .Destroy (sg ,REASON_EFFECT )
36+ local ft = Duel .GetMZoneCount (tp )
37+ if Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then ft = 1 end
38+ local g2 = Duel .GetMatchingGroup (s .spfilter ,tp ,LOCATION_HAND |LOCATION_GRAVE ,0 ,nil ,e ,tp )
39+ if ct > 0 and ft > 0 and Duel .IsExistingMatchingCard (s .filter ,tp ,0 ,LOCATION_GRAVE ,1 ,nil ) and # g2 > 0 and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
40+ Duel .BreakEffect ()
41+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
42+ local sg = g2 :Select (tp ,1 ,math.min (2 ,ft ),nil )
43+ Duel .SpecialSummon (sg ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
44+ end
45+ end
46+ end
0 commit comments