1+ -- ドレッド・ドラゴン (Anime)
2+ -- Dread Dragon (Anime)
3+ local s ,id = GetID ()
4+ function s .initial_effect (c )
5+ -- Add 1 Dragon-Type monster from your Deck to your hand
6+ local e1 = Effect .CreateEffect (c )
7+ e1 :SetDescription (aux .Stringid (id ,0 ))
8+ e1 :SetCategory (CATEGORY_TOHAND + CATEGORY_SEARCH )
9+ e1 :SetType (EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O )
10+ e1 :SetCode (EVENT_BATTLE_DESTROYED )
11+ e1 :SetTarget (s .target )
12+ e1 :SetOperation (s .operation )
13+ c :RegisterEffect (e1 )
14+ end
15+ function s .filter (c )
16+ return c :IsRace (RACE_DRAGON ) and c :IsAbleToHand ()
17+ end
18+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
19+ if chk == 0 then return Duel .IsExistingMatchingCard (s .filter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
20+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_DECK )
21+ end
22+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
23+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
24+ local g = Duel .SelectMatchingCard (tp ,s .filter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil )
25+ if # g > 0 then
26+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
27+ Duel .ConfirmCards (1 - tp ,g )
28+ end
29+ end
0 commit comments