Skip to content

Commit 92f3e36

Browse files
committed
Fixed some cards using Group.CheckWithSumEqual with wrong parameters
Numbers Eveil and Clear Wing Fast Dragon
1 parent 6a34ba6 commit 92f3e36

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

official/c90036274.lua

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ function s.initial_effect(c)
4444
c:RegisterEffect(e3)
4545
end
4646
s.listed_series={SET_SPEEDROID}
47+
function s.filter(filter_func)
48+
return function(c)
49+
return c:IsFaceup() and c:IsLevelAbove(0) and c:IsAbleToGraveAsCost() and filter_func(c)
50+
end
51+
end
4752
function s.cfilter1(c)
48-
return c:IsFaceup() and c:IsSetCard(SET_SPEEDROID) and c:IsType(TYPE_TUNER) and c:IsAbleToGraveAsCost()
53+
return c:IsSetCard(SET_SPEEDROID) and c:IsType(TYPE_TUNER)
4954
end
5055
function s.cfilter2(c)
51-
return c:IsFaceup() and (not c:IsType(TYPE_TUNER) or c:IsHasEffect(EFFECT_NONTUNER)) and c:IsAbleToGraveAsCost()
56+
return (not c:IsType(TYPE_TUNER) or c:IsHasEffect(EFFECT_NONTUNER))
5257
end
5358
function s.rescon(sg,e,tp,mg)
5459
return aux.ChkfMMZ(1)(sg,e,tp,mg) and sg:IsExists(s.chk,1,nil,sg) and sg:CheckWithSumEqual(Card.GetLevel,7,2,2)
@@ -57,13 +62,11 @@ function s.chk(c,sg)
5762
return s.cfilter1(c) and sg:IsExists(s.cfilter2,1,c)
5863
end
5964
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
60-
local g1=Duel.GetMatchingGroup(s.cfilter1,tp,LOCATION_MZONE,0,nil)
61-
local g2=Duel.GetMatchingGroup(s.cfilter2,tp,LOCATION_MZONE,0,nil)
62-
local g=g1:Clone()
63-
g:Merge(g2)
64-
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #g1>0 and #g2>0
65-
and aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,0) end
66-
local sg=aux.SelectUnselectGroup(g,e,tp,2,2,s.rescon,1,tp,HINTMSG_TOGRAVE)
65+
local g1=Duel.GetMatchingGroup(s.filter(s.cfilter1),tp,LOCATION_MZONE,0,nil)
66+
local g2=Duel.GetMatchingGroup(s.filter(s.cfilter2),tp,LOCATION_MZONE,0,nil)
67+
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and #g1>0 and #g2>0
68+
and aux.SelectUnselectGroup(g1+g2,e,tp,2,2,s.rescon,0) end
69+
local sg=aux.SelectUnselectGroup(g1+g2,e,tp,2,2,s.rescon,1,tp,HINTMSG_TOGRAVE)
6770
Duel.SendtoGrave(sg,REASON_COST)
6871
end
6972
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
@@ -122,4 +125,4 @@ function s.penop(e,tp,eg,ep,ev,re,r,rp)
122125
if c:IsRelateToEffect(e) then
123126
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
124127
end
125-
end
128+
end

unofficial/c511001611.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--ナンバーズ・エヴァイユ
2-
--Numbers Evaille
2+
--Numbers Eveil (Manga)
33
--Rescripted by edo9300
44
local s,id=GetID()
55
function s.initial_effect(c)
@@ -16,20 +16,20 @@ s.listed_series={0x48}
1616
function s.spfilter(c,e,p,mg)
1717
return Duel.GetLocationCountFromEx(p,p,mg,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,p,false,false)
1818
end
19-
function s.filter(c,mg,p,e)
19+
function s.filter(c,mg,mg0,p,e)
2020
if not c:IsSetCard(SET_NUMBER) or not c:IsType(TYPE_XYZ) or type(c.xyz_number)~="number" or not s.spfilter(c,e,p,mg-c) then return false end
21-
if c.xyz_number==0 then
22-
return mg:IsExists(function(c)return c.xyz_number==0 end,1,c)
21+
if c.xyz_number==0 then
22+
return #mg0>0
2323
else
24-
return (mg-c):CheckWithSumEqual(function(c)return c.xyz_number end,c.xyz_number,1,99999)
24+
return (mg-c):CheckWithSumEqual(function(c)return c.xyz_number end,c.xyz_number,1,#mg)
2525
end
2626
end
2727
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
2828
if chk==0 then
2929
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_XYZ)
30-
local mg=Duel.GetMatchingGroup(function(c) return type(c.xyz_number)=="number" end,tp,LOCATION_EXTRA,0,nil)
31-
if #(pg-mg)>0 then return false end
32-
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,mg,tp,e)
30+
local mg,mg0=Duel.GetMatchingGroup(function(c) return type(c.xyz_number)=="number" end,tp,LOCATION_EXTRA,0,nil):Split(function(c)return c.xyz_number>0 end,nil)
31+
if (#pg-(#mg+#mg0))>0 then return false end
32+
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,mg,mg0,tp,e)
3333
end
3434
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA)
3535
end
@@ -43,7 +43,7 @@ end
4343
function s.activate(e,tp,eg,ep,ev,re,r,rp)
4444
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_XYZ)
4545
local mg,mg0=Duel.GetMatchingGroup(function(c) return type(c.xyz_number)=="number" end,tp,LOCATION_EXTRA,0,nil):Split(function(c)return c.xyz_number>0 end,nil)
46-
if #(pg-(mg+mg0))>0 then return false end
46+
if (#pg-(#mg+#mg0))>0 then return false end
4747
local mat=Group.CreateGroup()
4848
if #mg==0 and #mg0>1 then
4949
mat=aux.SelectUnselectGroup(mg0,e,tp,1,#mg0-1,s.rescon,1,tp,HINTMSG_XMATERIAL)
@@ -80,4 +80,4 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
8080
Duel.Overlay(spc,mat)
8181
spc:CompleteProcedure()
8282
end
83-
end
83+
end

0 commit comments

Comments
 (0)