1+ -- 癒しの聖風ラーナ
2+ -- Lana the Holy Wind of Healing
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 :SetType (EFFECT_TYPE_FIELD )
9+ e1 :SetCode (EFFECT_SPSUMMON_PROC )
10+ e1 :SetProperty (EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_SPSUM_PARAM )
11+ e1 :SetRange (LOCATION_HAND )
12+ e1 :SetTargetRange (POS_FACEUP_DEFENSE ,0 )
13+ e1 :SetCondition (s .spcon )
14+ e1 :SetTarget (s .sptg )
15+ e1 :SetOperation (s .spop )
16+ c :RegisterEffect (e1 )
17+ -- Return 1 card on the field to the hand
18+ local e2 = Effect .CreateEffect (c )
19+ e2 :SetDescription (aux .Stringid (id ,0 ))
20+ e2 :SetCategory (CATEGORY_TOHAND )
21+ e2 :SetType (EFFECT_TYPE_IGNITION )
22+ e2 :SetRange (LOCATION_MZONE )
23+ e2 :SetCountLimit (1 )
24+ e2 :SetCondition (s .condition )
25+ e2 :SetCost (s .cost )
26+ e2 :SetTarget (s .target )
27+ e2 :SetOperation (s .operation )
28+ c :RegisterEffect (e2 )
29+ end
30+ function s .spcon (e ,c )
31+ if c == nil then return true end
32+ local tp = c :GetControler ()
33+ local rg = Duel .GetMatchingGroup (Card .IsDiscardable ,tp ,LOCATION_HAND ,0 ,e :GetHandler ())
34+ return aux .SelectUnselectGroup (rg ,e ,tp ,1 ,1 ,aux .ChkfMMZ (1 ),0 ,c )
35+ end
36+ function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
37+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_DISCARD )
38+ local rg = Duel .GetMatchingGroup (Card .IsDiscardable ,tp ,LOCATION_HAND ,0 ,e :GetHandler ())
39+ local g = aux .SelectUnselectGroup (rg ,e ,tp ,1 ,1 ,aux .ChkfMMZ (1 ),1 ,tp ,HINTMSG_DISCARD ,nil ,nil ,true )
40+ if # g > 0 then
41+ g :KeepAlive ()
42+ e :SetLabelObject (g )
43+ return true
44+ end
45+ return false
46+ end
47+ function s .spop (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,c )
48+ local g = e :GetLabelObject ()
49+ if not g then return end
50+ Duel .SendtoGrave (g ,REASON_DISCARD + REASON_COST )
51+ g :DeleteGroup ()
52+ end
53+ function s .condition (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
54+ local c = e :GetHandler ()
55+ return c :IsSummonPhaseMain () and c :IsStatus (STATUS_SUMMON_TURN + STATUS_SPSUMMON_TURN )
56+ end
57+ function s .cost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
58+ if chk == 0 then return Duel .IsExistingMatchingCard (Card .IsAbleToGraveAsCost ,tp ,LOCATION_HAND ,0 ,1 ,nil ) end
59+ end
60+ function s .thfilter (c )
61+ return c :IsSpellTrap () and c :IsAbleToHand ()
62+ end
63+ function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
64+ if chk == 0 then return Duel .IsExistingMatchingCard (s .thfilter ,tp ,0 ,LOCATION_ONFIELD ,1 ,nil ) end
65+ Duel .SetOperationInfo (0 ,CATEGORY_TOHAND ,nil ,1 ,1 - tp ,LOCATION_ONFIELD )
66+ end
67+ function s .operation (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
68+ local c = e :GetHandler ()
69+ --- Requirement
70+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
71+ local g = Duel .SelectMatchingCard (tp ,Card .IsAbleToGraveAsCost ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil )
72+ Duel .SendtoGrave (g ,REASON_COST )
73+ -- Effect
74+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_RTOHAND )
75+ local rg = Duel .SelectMatchingCard (tp ,s .thfilter ,tp ,0 ,LOCATION_ONFIELD ,1 ,1 ,nil )
76+ if # rg > 0 then
77+ Duel .HintSelection (rg )
78+ if Duel .SendtoHand (rg ,nil ,REASON_EFFECT )> 0 and c :IsCanChangePosition () and Duel .SelectYesNo (tp ,aux .Stringid (id ,1 )) then
79+ Duel .ChangePosition (c ,POS_FACEUP_DEFENSE ,0 ,POS_FACEUP_ATTACK ,0 )
80+ end
81+ end
82+ end
0 commit comments