@@ -24,21 +24,22 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2424end
2525function s .activate (e ,tp ,eg ,ep ,ev ,re ,r ,rp )
2626 local tg = Duel .SelectMatchingCard (tp ,s .rvfilter ,tp ,LOCATION_HAND ,0 ,1 ,1 ,nil ,tp ):GetFirst ()
27- if # tg == 0 then return end
28- Duel .ConfirmCards (1 - tp ,tg )
29- Duel .ShuffleHand (tp )
30- if Duel .GetMatchingGroupCount (aux .FilterMaximumSideFunctionEx (s .attfilter ,tg :GetAttribute ()),tp ,0 ,LOCATION_MZONE ,nil ,tg :GetAttribute ())> 0 then
31- Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_APPLYTO )
32- local g = Duel .SelectMatchingCard (tp ,aux .FilterMaximumSideFunctionEx (s .attfilter ,tg :GetAttribute ()),tp ,0 ,LOCATION_MZONE ,1 ,3 ,nil ,tg :GetAttribute ())
33- if # g == 0 then return end
34- Duel .HintSelection (g )
35- for tc in g :Iter () do
36- local e1 = Effect .CreateEffect (e :GetHandler ())
37- e1 :SetType (EFFECT_TYPE_SINGLE )
38- e1 :SetCode (EFFECT_CHANGE_ATTRIBUTE )
39- e1 :SetValue (tg :GetAttribute ())
40- e1 :SetReset (RESETS_STANDARD_PHASE_END )
41- tc :RegisterEffect (e1 )
27+ if tg then
28+ Duel .ConfirmCards (1 - tp ,tg )
29+ Duel .ShuffleHand (tp )
30+ if Duel .GetMatchingGroupCount (aux .FilterMaximumSideFunctionEx (s .attfilter ,tg :GetAttribute ()),tp ,0 ,LOCATION_MZONE ,nil ,tg :GetAttribute ())> 0 then
31+ Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_APPLYTO )
32+ local g = Duel .SelectMatchingCard (tp ,aux .FilterMaximumSideFunctionEx (s .attfilter ,tg :GetAttribute ()),tp ,0 ,LOCATION_MZONE ,1 ,3 ,nil ,tg :GetAttribute ())
33+ if # g == 0 then return end
34+ Duel .HintSelection (g )
35+ for tc in g :Iter () do
36+ local e1 = Effect .CreateEffect (e :GetHandler ())
37+ e1 :SetType (EFFECT_TYPE_SINGLE )
38+ e1 :SetCode (EFFECT_CHANGE_ATTRIBUTE )
39+ e1 :SetValue (tg :GetAttribute ())
40+ e1 :SetReset (RESETS_STANDARD_PHASE_END )
41+ tc :RegisterEffect (e1 )
42+ end
4243 end
4344 end
44- end
45+ end
0 commit comments