1+ -- 苦渋の選択
2+ -- Painful Choice
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Add excavated monster to hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
10+ e1 :SetType (EFFECT_TYPE_ACTIVATE )
11+ e1 :SetCode (EVENT_FREE_CHAIN )
12+ e1 :SetTarget (s .target )
13+ e1 :SetOperation (s .operation )
14+ c :RegisterEffect (e1 )
15+ end
16+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
17+ if chk == 0 then return Duel .GetFieldGroupCount (tp ,LOCATION_DECK ,0 )>= 5 end
18+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
19+ end
20+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
21+ -- Effect
22+ if Duel .GetFieldGroupCount (tp ,LOCATION_DECK ,0 )< 5 then return end
23+ Duel .ConfirmDecktop (tp ,5 )
24+ local g = Duel .GetDecktopGroup (tp ,5 )
25+ if g :IsExists (Card .IsAbleToHand ,1 ,nil ) then
26+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
27+ local tg = g :FilterSelect (1 - tp ,Card .IsAbleToHand ,1 ,1 ,nil )
28+ if # tg > 0 then
29+ Duel .DisableShuffleCheck ()
30+ Duel .SendtoHand (tg ,nil ,REASON_EFFECT )
31+ Duel .ConfirmCards (1 - tp ,tg )
32+ Duel .ShuffleHand (tp )
33+ g :RemoveCard (tg )
34+ end
35+ end
36+ Duel .SendtoGrave (g ,REASON_EFFECT |REASON_EXCAVATE )
37+ end
0 commit comments