1+ -- ローリング×ローリング
2+ -- Rescue Rabbit
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 ,1 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetCountLimit (1 ,0 ,EFFECT_COUNT_CODE_SINGLE )
13+ e1 :SetCost (s .cost )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .operation )
16+ c :RegisterEffect (e1 )
17+ end
18+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
19+ if chk == 0 then return e :GetHandler ():IsAbleToDeckAsCost () end
20+ end
21+ function s .spfilter1 (c ,e ,tp )
22+ return c :IsType (TYPE_NORMAL ) and c :IsLevelBelow (4 ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
23+ and Duel .IsExistingMatchingCard (s .spfilter2 ,tp ,LOCATION_GRAVE ,0 ,1 ,c ,e ,tp ,c :GetRace ())
24+ end
25+ function s .spfilter2 (c ,e ,tp ,race )
26+ return c :IsType (TYPE_NORMAL ) and c :IsLevelBelow (4 ) and c :IsRace (race ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
27+ end
28+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
29+ local ft = Duel .GetLocationCount (tp ,LOCATION_MZONE )
30+ if chk == 0 then return ft > 0 and not Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT )
31+ and Duel .IsExistingMatchingCard (s .spfilter1 ,tp ,LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
32+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_GRAVE )
33+ end
34+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
35+ local c = e :GetHandler ()
36+ -- Requirement
37+ if Duel .SendtoDeck (c ,nil ,SEQ_DECKBOTTOM ,REASON_COST )< 1 then return end
38+ -- Effect
39+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )< 2 or Duel .IsPlayerAffectedByEffect (tp ,CARD_BLUEEYES_SPIRIT ) then return end
40+ local fid = e :GetHandler ():GetFieldID ()
41+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
42+ local g1 = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .spfilter1 ),tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
43+ local tc1 = g1 :GetFirst ()
44+ tc1 :RegisterFlagEffect (id ,RESET_EVENT |RESETS_STANDARD ,0 ,1 ,fid )
45+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
46+ local g2 = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .spfilter2 ),tp ,LOCATION_GRAVE ,0 ,1 ,1 ,tc1 ,e ,tp ,tc1 :GetRace ())
47+ local tc2 = g2 :GetFirst ()
48+ tc2 :RegisterFlagEffect (id ,RESET_EVENT |RESETS_STANDARD ,0 ,1 ,fid )
49+ Duel .SpecialSummonStep (tc1 ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
50+ Duel .SpecialSummonStep (tc2 ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
51+ tc1 :RegisterFlagEffect (id ,RESET_EVENT |RESETS_STANDARD ,0 ,1 ,fid )
52+ tc2 :RegisterFlagEffect (id ,RESET_EVENT |RESETS_STANDARD ,0 ,1 ,fid )
53+ Duel .SpecialSummonComplete ()
54+ g1 :Merge (g2 )
55+ g1 :KeepAlive ()
56+ local e1 = Effect .CreateEffect (e :GetHandler ())
57+ e1 :SetType (EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS )
58+ e1 :SetProperty (EFFECT_FLAG_IGNORE_IMMUNE )
59+ e1 :SetCode (EVENT_PHASE + PHASE_END )
60+ e1 :SetCountLimit (1 )
61+ e1 :SetLabel (fid )
62+ e1 :SetLabelObject (g1 )
63+ e1 :SetReset (RESET_PHASE |PHASE_END )
64+ e1 :SetCondition (s .descon )
65+ e1 :SetOperation (s .desop )
66+ Duel .RegisterEffect (e1 ,tp )
67+ local e2 = Effect .CreateEffect (c )
68+ e2 :SetType (EFFECT_TYPE_FIELD )
69+ e2 :SetCode (EFFECT_CANNOT_ACTIVATE )
70+ e2 :SetProperty (EFFECT_FLAG_PLAYER_TARGET )
71+ e2 :SetTargetRange (1 ,0 )
72+ e2 :SetValue (s .aclimit )
73+ e2 :SetReset (RESET_PHASE |PHASE_END )
74+ Duel .RegisterEffect (e2 ,tp )
75+ end
76+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
77+ Duel .Destroy (e :GetHandler (),REASON_EFFECT )
78+ end
79+ function s .aclimit (e ,re ,tp )
80+ return re :GetHandler ():IsCode (85138716 )
81+ end
82+ function s .desfilter (c ,fid )
83+ return c :GetFlagEffectLabel (id )== fid
84+ end
85+ function s .descon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
86+ local g = e :GetLabelObject ()
87+ if not g :IsExists (s .desfilter ,1 ,nil ,e :GetLabel ()) then
88+ g :DeleteGroup ()
89+ e :Reset ()
90+ return false
91+ else return true end
92+ end
93+ function s .desop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
94+ local g = e :GetLabelObject ()
95+ local tg = g :Filter (s .desfilter ,nil ,e :GetLabel ())
96+ Duel .Destroy (tg ,REASON_EFFECT )
97+ end
0 commit comments