1+ -- 夢中の再誕
2+ -- Delirium Rebirth
3+ -- Scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ local e1 = Fusion .CreateSummonEff (c ,s .ffilter ,Fusion .OnFieldMat (Card .IsFaceup ),s .fextra )
7+ c :RegisterEffect (e1 )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
10+ e1 :SetCode (EVENT_SUMMON_SUCCESS )
11+ e1 :SetCondition (s .condition )
12+ local e2 = e1 :Clone ()
13+ e2 :SetCode (EVENT_SPSUMMON_SUCCESS )
14+ c :RegisterEffect (e2 )
15+ local e3 = e1 :Clone ()
16+ e3 :SetCode (EVENT_DRAW )
17+ e3 :SetCondition (s .condition2 )
18+ c :RegisterEffect (e3 )
19+ end
20+ function s .ffilter (c )
21+ return c :IsRace (RACE_INSECT ) and c :IsAttribute (ATTRIBUTE_LIGHT )
22+ end
23+ function s .fusfilter (c ,tp )
24+ return c :IsControler (tp )
25+ end
26+ function s .checkmat (tp ,sg ,fc )
27+ local mg1 = sg :Filter (s .fusfilter ,nil ,tp )
28+ return # sg == 2 and # mg1 > 0
29+ end
30+ function s .fextra (e ,tp ,mg )
31+ return Duel .GetMatchingGroup (Fusion .IsMonsterFilter (aux .FaceupFilter (Card .IsLevelBelow ,9 )),tp ,0 ,LOCATION_ONFIELD ,nil ),s .checkmat
32+ end
33+ function s .filter1 (c ,tp )
34+ return c :IsSummonPlayer (1 - tp ) and c :IsLocation (LOCATION_MZONE )
35+ end
36+ function s .genericcondition (tp )
37+ return Duel .IsTurnPlayer (1 - tp ) and Duel .IsExistingMatchingCard (Card .IsRace ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,RACE_INSECT )
38+ end
39+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
40+ return eg :IsExists (s .filter1 ,1 ,nil ,tp ) and s .genericcondition (tp )
41+ end
42+ function s .condition2 (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
43+ return ep == 1 - tp and s .genericcondition (tp )
44+ end
0 commit comments