1+ -- サイバネティック・オーバーフロー
2+ -- Cybernetic Overflow
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Activate
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_ATKCHANGE )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_SUMMON_SUCCESS )
12+ e1 :SetCondition (s .condition )
13+ e1 :SetCost (s .cost )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .activate )
16+ c :RegisterEffect (e1 )
17+ end
18+ s .listed_names = {CARD_CYBER_DRAGON }
19+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
20+ return eg :IsExists (Card .IsSummonPlayer ,1 ,nil ,1 - tp )
21+ end
22+ function s .cfilter (c )
23+ return c :IsCode (CARD_CYBER_DRAGON ) and c :IsAbleToDeckOrExtraAsCost ()
24+ end
25+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
26+ local cg = Duel .GetMatchingGroup (s .cfilter ,tp ,LOCATION_GRAVE ,0 ,nil )
27+ if chk == 0 then return aux .SelectUnselectGroup (cg ,e ,tp ,2 ,2 ,s .rescon ,0 ) end
28+ end
29+ function s .rescon (sg ,e ,tp ,mg )
30+ return sg :GetClassCount (Card .GetLevel )==# sg
31+ end
32+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
33+ local g = Duel .GetMatchingGroup (aux .FilterMaximumSideFunctionEx (aux .TRUE ),tp ,0 ,LOCATION_ONFIELD ,nil )
34+ if chk == 0 then return # g > 1 end
35+ Duel .SetOperationInfo (0 ,CATEGORY_DESTROY ,g ,2 ,0 ,LOCATION_ONFIELD )
36+ end
37+ function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
38+ -- Requirement
39+ local cg = Duel .GetMatchingGroup (s .cfilter ,tp ,LOCATION_GRAVE ,0 ,nil )
40+ local tdg = aux .SelectUnselectGroup (cg ,e ,tp ,2 ,2 ,s .rescon ,1 ,tp ,HINTMSG_TODECK )
41+ Duel .HintSelection (tdg )
42+ if Duel .SendtoDeck (tdg ,nil ,SEQ_DECKBOTTOM ,REASON_COST )== 0 then return end
43+ local og = Duel .GetOperatedGroup ():Filter (Card .IsLocation ,nil ,LOCATION_DECK )
44+ if # og > 0 then Duel .SortDeckbottom (tp ,tp ,# og ) end
45+ -- Effect
46+ local g = Duel .GetMatchingGroup (aux .FilterMaximumSideFunctionEx (aux .TRUE ),tp ,0 ,LOCATION_ONFIELD ,nil )
47+ if # g > 0 then
48+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
49+ local sg = g :Select (tp ,2 ,2 ,nil )
50+ Duel .HintSelection (sg )
51+ Duel .Destroy (sg ,REASON_EFFECT )
52+ end
53+ end
0 commit comments