1+ -- シタールート
2+ -- Sitarloot
3+ -- scripted by YoshiDuels
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Return 1 card on the field to the hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_TOHAND )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_MZONE )
12+ e1 :SetCountLimit (1 )
13+ e1 :SetCondition (s .condition )
14+ e1 :SetCost (s .cost )
15+ e1 :SetTarget (s .target )
16+ e1 :SetOperation (s .operation )
17+ c :RegisterEffect (e1 )
18+ end
19+ function s .cfilter (c )
20+ return c :IsFaceup () and c :IsRace (RACE_PSYCHIC ) and c :IsAttribute (ATTRIBUTE_WIND ) and c :IsLevelAbove (7 )
21+ end
22+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
23+ return Duel .IsExistingMatchingCard (s .cfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil ) and e :GetHandler ():IsStatus (STATUS_SUMMON_TURN )
24+ end
25+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
26+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToGraveAsCost ,tp ,LOCATION_ONFIELD ,0 ,1 ,nil ) end
27+ end
28+ function s .thfilter (c )
29+ return c :IsSpellTrap () and c :IsAbleToHand ()
30+ end
31+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
32+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,0 ,LOCATION_ONFIELD ,1 ,nil ) end
33+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,1 - tp ,LOCATION_ONFIELD )
34+ Duel .SetPossibleOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,tp ,LOCATION_GRAVE )
35+ end
36+ function s .thfilter2 (c )
37+ return c :IsEquipSpell () and c :IsAbleToHand ()
38+ end
39+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
40+ -- Requirement
41+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
42+ local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToGraveAsCost ,tp ,LOCATION_ONFIELD ,0 ,1 ,1 ,nil )
43+ if Duel .SendtoGrave (g ,REASON_COST )== 0 then return end
44+ -- Effect
45+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
46+ local rg = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,0 ,LOCATION_ONFIELD ,1 ,1 ,nil )
47+ if # rg > 0 then
48+ Duel .HintSelection (rg )
49+ if Duel .SendtoHand (rg ,nil ,REASON_EFFECT )> 0 and rg :GetFirst ():IsLocation (LOCATION_HAND )
50+ and Duel .IsExistingMatchingCard (aux .NecroValleyFilter (s .thfilter2 ),tp ,LOCATION_GRAVE ,0 ,1 ,nil )
51+ and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
52+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_ATOHAND )
53+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .thfilter2 ),tp ,LOCATION_GRAVE ,0 ,1 ,1 ,nil )
54+ if # g > 0 then
55+ Duel .BreakEffect ()
56+ Duel .SendtoHand (g ,nil ,REASON_EFFECT )
57+ Duel .ConfirmCards (1 - tp ,g )
58+ end
59+ end
60+ end
61+ end
0 commit comments