Commit 2a0a0c6a authored by VanillaSalt's avatar VanillaSalt

fix

parent 1d541812
...@@ -1657,17 +1657,17 @@ function Auxiliary.GetLinkCount(c) ...@@ -1657,17 +1657,17 @@ function Auxiliary.GetLinkCount(c)
return 1+0x10000*c:GetLink() return 1+0x10000*c:GetLink()
else return 1 end else return 1 end
end end
function Auxiliary.LCheckRecursive(c,tp,sg,mg,lk,ct,minc,maxc) function Auxiliary.LCheckRecursive(c,tp,sg,mg,lc,ct,minc,maxc)
sg:AddCard(c) sg:AddCard(c)
ct=ct+1 ct=ct+1
local res=(ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lk,ct,minc,maxc)) local res=(ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc))
or (ct>=minc and Auxiliary.LCheckGoal(tp,sg,lk,ct)) or (ct>=minc and Auxiliary.LCheckGoal(tp,sg,lc,ct))
sg:RemoveCard(c) sg:RemoveCard(c)
ct=ct-1 ct=ct-1
return res return res
end end
function Auxiliary.LCheckGoal(tp,sg,lk,ct) function Auxiliary.LCheckGoal(tp,sg,lc,ct)
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lk,ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg)>0 return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
end end
function Auxiliary.LinkCondition(f,minc,maxc) function Auxiliary.LinkCondition(f,minc,maxc)
return function(e,c) return function(e,c)
...@@ -1676,7 +1676,7 @@ function Auxiliary.LinkCondition(f,minc,maxc) ...@@ -1676,7 +1676,7 @@ function Auxiliary.LinkCondition(f,minc,maxc)
local tp=c:GetControler() local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f) local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f)
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
return mg:IsExists(Auxiliary.LCheckRecursive,1,nil,tp,sg,mg,c:GetLink(),0,minc,maxc) return mg:IsExists(Auxiliary.LCheckRecursive,1,nil,tp,sg,mg,c,0,minc,maxc)
end end
end end
function Auxiliary.LinkOperation(f,minc,maxc) function Auxiliary.LinkOperation(f,minc,maxc)
...@@ -1684,10 +1684,10 @@ function Auxiliary.LinkOperation(f,minc,maxc) ...@@ -1684,10 +1684,10 @@ function Auxiliary.LinkOperation(f,minc,maxc)
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f) local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f)
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
for i=1,maxc do for i=1,maxc do
local g=mg:FilterSelect(tp,Auxiliary.LCheckRecursive,1,1,sg,tp,sg,mg,c:GetLink(),i-1,minc,maxc) local g=mg:FilterSelect(tp,Auxiliary.LCheckRecursive,1,1,sg,tp,sg,mg,c,i-1,minc,maxc)
sg:Merge(g) sg:Merge(g)
if i>=minc and i<maxc and Auxiliary.LCheckGoal(tp,sg,c:GetLink(),i) if i>=minc and i<maxc and Auxiliary.LCheckGoal(tp,sg,c,i)
and (not mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,c:GetLink(),i,minc,maxc) and (not mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,c,i,minc,maxc)
or not Duel.SelectYesNo(tp,210)) then break end or not Duel.SelectYesNo(tp,210)) then break end
end end
c:SetMaterial(sg) c:SetMaterial(sg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment