1+ -- 暁天使カムビン
2+ -- Dawn Angel Kambi
3+ -- scripted by pyrQ
4+ local s ,id = GetID ()
5+ function s .initial_effect (c )
6+ -- Special Summon this card from your hand
7+ local e1 = Effect .CreateEffect (c )
8+ e1 :SetDescription (aux .Stringid (id ,0 ))
9+ e1 :SetCategory (CATEGORY_SPECIAL_SUMMON )
10+ e1 :SetType (EFFECT_TYPE_IGNITION )
11+ e1 :SetRange (LOCATION_HAND )
12+ e1 :SetCountLimit (1 ,id )
13+ e1 :SetCondition (s .selfspcon )
14+ e1 :SetTarget (s .selfsptg )
15+ e1 :SetOperation (s .selfspop )
16+ c :RegisterEffect (e1 )
17+ -- Special Summon 1 Fairy monster from your Deck whose Level equals the total Levels the Tributed monsters had on the field
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_MZONE )
23+ e2 :SetCountLimit (1 ,{id ,1 })
24+ e2 :SetCost (s .deckspcost )
25+ e2 :SetTarget (s .decksptg )
26+ e2 :SetOperation (s .deckspop )
27+ c :RegisterEffect (e2 )
28+ Duel .AddCustomActivityCounter (id ,ACTIVITY_SPSUMMON ,function (c ) return c :IsRace (RACE_FAIRY ) end )
29+ end
30+ function s .selfspconfilter (c )
31+ return c :IsFacedown () or not c :IsRace (RACE_FAIRY )
32+ end
33+ function s .selfspcon (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
34+ return not Duel .IsExistingMatchingCard (s .selfspconfilter ,tp ,LOCATION_MZONE ,0 ,1 ,nil )
35+ end
36+ function s .selfsptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
37+ local c = e :GetHandler ()
38+ if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE )> 0
39+ and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false ) end
40+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,c ,1 ,tp ,0 )
41+ end
42+ function s .selfspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
43+ local c = e :GetHandler ()
44+ if c :IsRelateToEffect (e ) then
45+ Duel .SpecialSummon (c ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
46+ end
47+ end
48+ function s .deckspcostfilter (c )
49+ return c :IsRace (RACE_FAIRY ) and c :HasLevel ()
50+ end
51+ function s .rescon (sg ,tp ,exg ,e ,handler )
52+ return sg :IsContains (handler ) and Duel .GetMZoneCount (tp ,sg )> 0
53+ and Duel .IsExistingMatchingCard (s .deckspfilter ,tp ,LOCATION_DECK ,0 ,1 ,nil ,e ,tp ,sg :GetSum (Card .GetLevel )),not sg :IsContains (handler )
54+ end
55+ function s .deckspfilter (c ,e ,tp ,lv )
56+ return c :IsRace (RACE_FAIRY ) and c :IsLevel (lv ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
57+ end
58+ function s .deckspcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
59+ e :SetLabel (- 100 )
60+ local c = e :GetHandler ()
61+ if chk == 0 then return c :IsReleasable () and c :HasLevel () and Duel .GetCustomActivityCount (id ,tp ,ACTIVITY_SPSUMMON )== 0
62+ and Duel .CheckReleaseGroupCost (tp ,s .deckspcostfilter ,1 ,false ,s .rescon ,nil ,e ,c ) end
63+ local g = Duel .SelectReleaseGroupCost (tp ,s .deckspcostfilter ,1 ,99 ,false ,s .rescon ,nil ,e ,c )
64+ g :AddCard (c )
65+ e :SetLabel (g :GetSum (Card .GetLevel ))
66+ Duel .Release (g ,REASON_COST )
67+ -- You cannot Special Summon the turn you activate this effect, except Fairy monsters
68+ local e1 = Effect .CreateEffect (c )
69+ e1 :SetDescription (aux .Stringid (id ,2 ))
70+ e1 :SetType (EFFECT_TYPE_FIELD )
71+ e1 :SetProperty (EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH + EFFECT_FLAG_CLIENT_HINT )
72+ e1 :SetCode (EFFECT_CANNOT_SPECIAL_SUMMON )
73+ e1 :SetTargetRange (1 ,0 )
74+ e1 :SetTarget (function (e ,c ) return not c :IsRace (RACE_FAIRY ) end )
75+ e1 :SetReset (RESET_PHASE |PHASE_END )
76+ Duel .RegisterEffect (e1 ,tp )
77+ end
78+ function s .decksptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
79+ if chk == 0 then
80+ local res = e :GetLabel ()==- 100
81+ e :SetLabel (0 )
82+ return res
83+ end
84+ Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_DECK )
85+ end
86+ function s .deckspop (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
87+ if Duel .GetLocationCount (tp ,LOCATION_MZONE )<= 0 then return end
88+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_SPSUMMON )
89+ local g = Duel .SelectMatchingCard (tp ,s .deckspfilter ,tp ,LOCATION_DECK ,0 ,1 ,1 ,nil ,e ,tp ,e :GetLabel ())
90+ if # g > 0 then
91+ Duel .SpecialSummon (g ,0 ,tp ,tp ,false ,false ,POS_FACEUP )
92+ end
93+ end
0 commit comments