1+ -- 血樹竜姫ドラセレア
2+ -- Draselea the Blood Tree Dragon Princess
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- You can send 1 Level 4 or lower Plant monster from your Deck to the GY, except "Draselea the Blood Tree Dragon Princess"; Special Summon this card from your hand, and if you do, its Level becomes the sent monster's
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON + CATEGORY_LVCHANGE )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_HAND )
12+ e1 :SetCountLimit (1 ,{id ,0 })
13+ e1 :SetCost (Cost .AND (s .selfspcost ,s .effcost ))
14+ e1 :SetTarget (s .selfsptg )
15+ e1 :SetOperation (s .selfspop )
16+ c :RegisterEffect (e1 )
17+ -- You can banish this card and 1 Plant monster from your GY; Special Summon 1 Dragon monster from your hand or GY
18+ local e2 = Effect .CreateEffect (c )
19+ e2 :SetDescription (aux .Stringid (id ,1 ))
20+ e2 :SetCategory (CATEGORY_SPECIAL_SUMMON )
21+ e2 :SetType (EFFECT_TYPE_IGNITION )
22+ e2 :SetRange (LOCATION_GRAVE )
23+ e2 :SetCountLimit (1 ,{id ,1 })
24+ e2 :SetCost (Cost .AND (s .dragonspcost ,s .effcost ))
25+ e2 :SetTarget (s .dragonsptg )
26+ e2 :SetOperation (s .dragonspop )
27+ c :RegisterEffect (e2 )
28+ Duel .AddCustomActivityCounter (id ,ACTIVITY_SPSUMMON ,function (c ) return c :IsRace (RACE_DRAGON |RACE_PLANT ) end )
29+ end
30+ s .listed_names = {id }
31+ function s .effcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
32+ if chk == 0 then return Duel .GetCustomActivityCount (id ,tp ,ACTIVITY_SPSUMMON )== 0 end
33+ -- You cannot Special Summon the turn you activate either of this card's effects, except Dragon or Plant monsters
34+ local e1 = Effect .CreateEffect (e :GetHandler ())
35+ e1 :SetDescription (aux .Stringid (id ,2 ))
36+ e1 :SetType (EFFECT_TYPE_FIELD )
37+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH + EFFECT_FLAG_CLIENT_HINT )
38+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
39+ e1 :SetTargetRange (1 ,0 )
40+ e1 :SetTarget (function (e ,c ) return c :IsRaceExcept (RACE_DRAGON |RACE_PLANT ) end )
41+ e1 :SetReset (RESET_PHASE |PHASE_END )
42+ Duel .RegisterEffect (e1 ,tp )
43+ end
44+ function s .selfspcostfilter (c )
45+ return c :IsLevelBelow (4 ) and c :IsRace (RACE_PLANT ) and not c :IsCode (id ) and c :IsAbleToGraveAsCost ()
46+ end
47+ function s .selfspcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
48+ if chk == 0 then return Duel .IsExistingMatchingCard (s .selfspcostfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ) end
49+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TOGRAVE )
50+ local sc = Duel .SelectMatchingCard (tp ,s .selfspcostfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ):GetFirst ()
51+ Duel .SendtoGrave (sc ,REASON_COST )
52+ e :SetLabel (sc :GetLevel ())
53+ end
54+ function s .selfsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
55+ local c = e :GetHandler ()
56+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
57+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
58+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
59+ end
60+ function s .selfspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
61+ local c = e :GetHandler ()
62+ if c :IsRelateToEffect (e ) and Duel .SpecialSummonStep (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP ) then
63+ -- Its Level becomes the sent monster's
64+ local e1 = Effect .CreateEffect (c )
65+ e1 :SetType (EFFECT_TYPE_SINGLE )
66+ e1 :SetCode (EFFECT_CHANGE_LEVEL )
67+ e1 :SetValue (e :GetLabel ())
68+ e1 :SetReset (RESET_EVENT |RESETS_STANDARD_DISABLE )
69+ c :RegisterEffect (e1 )
70+ end
71+ Duel .SpecialSummonComplete ()
72+ end
73+ function s .dragonspcostfilter (c ,e ,tp ,handler )
74+ return c :IsRace (RACE_PLANT ) and c :IsAbleToRemoveAsCost ()
75+ and Duel .IsExistingMatchingCard (s .dragonspfilter ,tp ,LOCATION_HAND |LOCATION_GRAVE ,0 ,1 ,Group .FromCards (c ,handler ),e ,tp )
76+ end
77+ function s .dragonspfilter (c ,e ,tp )
78+ return c :IsRace (RACE_DRAGON ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
79+ end
80+ function s .dragonspcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
81+ local c = e :GetHandler ()
82+ if chk == 0 then return c :IsAbleToRemoveAsCost ()
83+ and Duel .IsExistingMatchingCard (s .dragonspcostfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,c ,e ,tp ,c ) end
84+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_REMOVE )
85+ local g = Duel .SelectMatchingCard (tp ,s .dragonspcostfilter ,tp ,LOCATION_GRAVE ,0 ,1 ,1 ,c ,e ,tp ,c )
86+ Duel .Remove (g + c ,POS_FACEUP ,REASON_COST )
87+ end
88+ function s .dragonsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
89+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
90+ and Duel .IsExistingMatchingCard (s .dragonspfilter ,tp ,LOCATION_HAND |LOCATION_GRAVE ,0 ,1 ,nil ,e ,tp ) end
91+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_HAND |LOCATION_GRAVE )
92+ end
93+ function s .dragonspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
94+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
95+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
96+ local g = Duel .SelectMatchingCard (tp ,aux .NecroValleyFilter (s .dragonspfilter ),tp ,LOCATION_HAND |LOCATION_GRAVE ,0 ,1 ,1 ,nil ,e ,tp )
97+ if # g > 0 then
98+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
99+ end
100+ end
0 commit comments