Commit 2a0a0c6a authored by VanillaSalt's avatar VanillaSalt

fix

parent 1d541812
......@@ -1657,17 +1657,17 @@ function Auxiliary.GetLinkCount(c)
return 1+0x10000*c:GetLink()
else return 1 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)
ct=ct+1
local res=(ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lk,ct,minc,maxc))
or (ct>=minc and Auxiliary.LCheckGoal(tp,sg,lk,ct))
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,lc,ct))
sg:RemoveCard(c)
ct=ct-1
return res
end
function Auxiliary.LCheckGoal(tp,sg,lk,ct)
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lk,ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg)>0
function Auxiliary.LCheckGoal(tp,sg,lc,ct)
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
end
function Auxiliary.LinkCondition(f,minc,maxc)
return function(e,c)
......@@ -1676,7 +1676,7 @@ function Auxiliary.LinkCondition(f,minc,maxc)
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f)
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
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 sg=Group.CreateGroup()
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)
if i>=minc and i<maxc and Auxiliary.LCheckGoal(tp,sg,c:GetLink(),i)
and (not mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,c:GetLink(),i,minc,maxc)
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,i,minc,maxc)
or not Duel.SelectYesNo(tp,210)) then break end
end
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