1+ -- リボーンパターン
2+ -- Reborn Pattern
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetProperty (EFFECT_FLAG_DAMAGE_STEP )
11+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
12+ e1 :SetCode (EVENT_DESTROYED )
13+ e1 :SetCondition (s .condition )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .operation )
16+ c :RegisterEffect (e1 )
17+ end
18+ function s .cfilter (c ,tp )
19+ return c :GetReasonPlayer ()== 1 - tp and c :IsPreviousLocation (LOCATION_MZONE ) and c :IsPreviousControler (tp )
20+ and (c :IsReason (REASON_EFFECT ) or (c :IsReason (REASON_BATTLE ) and Duel .GetAttacker ():IsControler (1 - tp )))
21+ end
22+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
23+ return eg :IsExists (s .cfilter ,1 ,nil ,tp )
24+ end
25+ function s .filter (c ,e ,tp )
26+ return (c :IsCode (10992251 ) or (c :IsRace (RACE_MACHINE ) and c :IsType (TYPE_FUSION ) and c :IsLevel (4 ) and c :IsDefense (800 ))) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ,POS_FACEUP )
27+ end
28+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
29+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
30+ and Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
31+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_GRAVE )
32+ end
33+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
34+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
35+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
36+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .filter ),tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
37+ if # g > 0 and Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )> 0
38+ and Duel .IsExistingMatchingCard (Card .IsNotMaximumModeSide ,tp ,0 ,LOCATION_ONFIELD ,1 ,nil )
39+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
40+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DESTROY )
41+ local g = Duel .SelectMatchingCard (tp ,Card .IsNotMaximumModeSide ,tp ,0 ,LOCATION_ONFIELD ,1 ,1 ,nil )
42+ local g2 = g :AddMaximumCheck ()
43+ Duel .HintSelection (g2 )
44+ Duel .BreakEffect ()
45+ Duel .Destroy (g ,REASON_EFFECT )
46+ end
47+ end
0 commit comments