1+ -- 永遠のルリグラ
2+ -- Rurigra the Eternal
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Place 1 card from opponent's GY on the bottom of the Deck
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_TODECK |CATEGORY_TOHAND |CATEGORY_SEARCH )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetCountLimit (1 )
13+ e1 :SetCondition (function (e )return e :GetHandler ():IsStatus (STATUS_SUMMON_TURN )end )
14+ e1 :SetTarget (s .target )
15+ e1 :SetOperation (s .operation )
16+ c :RegisterEffect (e1 )
17+ end
18+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
19+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToDeck ,tp ,0 ,LOCATION_GRAVE ,1 ,nil ) and Duel .GetFieldGroupCount (tp ,LOCATION_DECK ,0 )>= 4 end
20+ Duel .SetOperationInfo (0 ,CATEGORY_TODECK ,nil ,1 ,tp ,LOCATION_GRAVE )
21+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
22+ end
23+ function s .filter (c )
24+ return c :IsRace (RACE_SPELLCASTER ) and c :IsAttribute (ATTRIBUTE_EARTH ) and c :IsLevel (9 ) and c :IsAbleToHand ()
25+ end
26+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
27+ local c = e :GetHandler ()
28+ -- Effect
29+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TODECK )
30+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (Card .IsAbleToDeck ),tp ,0 ,LOCATION_GRAVE ,1 ,1 ,nil )
31+ Duel .HintSelection (g )
32+ Duel .SendtoDeck (g ,nil ,SEQ_DECKBOTTOM ,REASON_EFFECT )
33+ if Duel .GetFieldGroupCount (tp ,LOCATION_DECK ,0 )< 4 then return end
34+ Duel .ConfirmDecktop (tp ,4 )
35+ local g = Duel .GetDecktopGroup (tp ,4 )
36+ Duel .DisableShuffleCheck ()
37+ if g :IsExists (s .filter ,1 ,nil ) and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
38+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
39+ local tg = g :FilterSelect (tp ,s .filter ,1 ,1 ,nil )
40+ if # tg > 0 then
41+ Duel .SendtoHand (tg ,nil ,REASON_EFFECT )
42+ Duel .ConfirmCards (1 - tp ,tg )
43+ Duel .ShuffleHand (tp )
44+ g :RemoveCard (tg )
45+ end
46+ end
47+ local ct =# g
48+ if ct > 0 then
49+ Duel .MoveToDeckBottom (ct ,tp )
50+ Duel .SortDeckbottom (tp ,tp ,ct )
51+ end
52+ end
0 commit comments