@@ -17,8 +17,12 @@ s.listed_series={SET_NUMBER,SET_NUMBER_S}
1717function s .matfilter (c ,e )
1818 return c :IsSetCard (SET_NUMBER ) and c :IsCanBeEffectTarget (e )
1919end
20- function s .rescon (sg ,e ,tp ,g )
21- return Duel .IsExistingMatchingCard (Card .IsXyzSummonable ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ,nil ,sg ,# sg ,# sg )
20+ function s .rescon (xyzg )
21+ return function (sg ,e ,tp ,g )
22+ -- If no xyz can be summoned using at least the currently seelcted cards as forced materials, stop
23+ return xyzg :IsExists (Card .IsXyzSummonable ,1 ,nil ,nil ,sg ,# sg ,# sg ),
24+ not xyzg :IsExists (Card .IsXyzSummonable ,1 ,nil ,sg ,g ,# sg ,# g )
25+ end
2226end
2327function s .target (e ,tp ,eg ,ep ,ev ,re ,r ,rp ,chk ,chkc )
2428 if chkc then return false end
@@ -33,13 +37,13 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
3337 _c :RegisterEffect (e1 ,true )
3438 _c :AssumeProperty (ASSUME_RANK ,_c :GetRank ()+ 1 )
3539 end
40+ local xyzg = Duel .GetMatchingGroup (Card .IsXyzSummonable ,tp ,LOCATION_EXTRA ,0 ,nil ,nil ,mg )
3641 if chk == 0 then
37- local res = Duel .IsExistingMatchingCard (Card .IsXyzSummonable ,tp ,LOCATION_EXTRA ,0 ,1 ,nil ,nil ,mg )
3842 notSg :ForEach (function (_c ) _c :ResetEffect (id ,RESET_CARD ) end )
39- return res
43+ return # xyzg > 0
4044 end
4145 Duel .Hint (HINT_SELECTMSG ,tp ,HINTMSG_TARGET )
42- local tg = aux .SelectUnselectGroup (mg ,e ,tp ,1 ,99 ,s .rescon ,1 ,tp ,HINTMSG_XMATERIAL ,s .rescon )
46+ local tg = aux .SelectUnselectGroup (mg ,e ,tp ,1 ,# mg ,s .rescon ( xyzg ) ,1 ,tp ,HINTMSG_XMATERIAL ,s .rescon ( xyzg ) )
4347 Duel .SetTargetCard (tg )
4448 Duel .SetOperationInfo (0 ,CATEGORY_LEAVE_GRAVE ,tg ,# tg ,0 ,0 )
4549 Duel .SetOperationInfo (0 ,CATEGORY_SPECIAL_SUMMON ,nil ,1 ,tp ,LOCATION_EXTRA )
0 commit comments