@@ -9,15 +9,22 @@ function s.initial_effect(c)
99 e1 :SetType (EFFECT_TYPE_IGNITION )
1010 e1 :SetRange (LOCATION_MZONE )
1111 e1 :SetCountLimit (1 ,id )
12- e1 :SetCost (Cost . Discard ( function ( c , e , tp ) return Duel . IsExistingMatchingCard ( s . spfilter , tp , LOCATION_HAND | LOCATION_DECK , 0 , 1 , c , e , tp ) end ) )
12+ e1 :SetCost (s . spcost )
1313 e1 :SetTarget (s .sptg )
1414 e1 :SetOperation (s .spop )
1515 c :RegisterEffect (e1 )
1616end
1717s .listed_names = {id }
18+ function s .spcostfilter (c ,e ,tp )
19+ return Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND |LOCATION_DECK ,0 ,1 ,c ,e ,tp )
20+ end
1821function s .spfilter (c ,e ,tp )
1922 return c :IsLevelBelow (4 ) and c :IsRace (RACE_DRAGON ) and not c :IsCode (id ) and c :IsCanBeSpecialSummoned (e ,0 ,tp ,false ,false )
2023end
24+ function s .spcost (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
25+ if chk == 0 then return Duel .IsExistingMatchingCard (s .spcostfilter ,tp ,LOCATION_HAND ,0 ,1 ,nil ,e ,tp ) end
26+ Duel .DiscardHand (tp ,s .spcostfilter ,1 ,1 ,REASON_COST |REASON_DISCARD ,nil ,e ,tp )
27+ end
2128function s .sptg (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk )
2229 if chk == 0 then return Duel .GetLocationCount (tp ,LOCATION_MZONE ,0 )> 0
2330 and Duel .IsExistingMatchingCard (s .spfilter ,tp ,LOCATION_HAND |LOCATION_DECK ,0 ,1 ,nil ,e ,tp ) end
@@ -32,4 +39,4 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
3239 sc :NegateEffects (e :GetHandler ())
3340 end
3441 Duel .SpecialSummonComplete ()
35- end
42+ end
0 commit comments