Commit d79002c1 authored by VanillaSalt's avatar VanillaSalt

fix

parent e6d623cf
...@@ -634,27 +634,29 @@ function Auxiliary.FOperationMixRep(insf,sub,fun1,minc,maxc,...) ...@@ -634,27 +634,29 @@ function Auxiliary.FOperationMixRep(insf,sub,fun1,minc,maxc,...)
Duel.SetFusionMaterial(sg) Duel.SetFusionMaterial(sg)
end end
end end
function Auxiliary.FCheckMixRep(c,sg,g,fc,sub,fun1,minc,maxc,fun2,...) function Auxiliary.FCheckMixRep(sg,g,fc,sub,fun1,minc,maxc,fun2,...)
g:AddCard(c)
local res=false
if fun2 then if fun2 then
if fun2(c,fc,sub) then return sg:IsExists(Auxiliary.FCheckMixRepFilter,1,g,sg,g,fc,sub,fun1,minc,maxc,fun2,...)
local sub=sub and fun2(c,fc,false) else
res=sg:IsExists(Auxiliary.FCheckMixRep,1,g,sg,g,fc,sub,fun1,minc,maxc,...)
end
elseif fun1(c,fc,sub) then
local sub=sub and fun1(c,fc,false)
local ct1=sg:FilterCount(fun1,g,fc,sub) local ct1=sg:FilterCount(fun1,g,fc,sub)
local ct2=sg:FilterCount(fun1,g,fc,false) local ct2=sg:FilterCount(fun1,g,fc,false)
res=ct1==sg:GetCount()-g:GetCount() and (not sub or ct1-ct2<=1) return ct1==sg:GetCount()-g:GetCount() and ct1-ct2<=1
end end
g:RemoveCard(c) end
return res function Auxiliary.FCheckMixRepFilter(c,sg,g,fc,sub,fun1,minc,maxc,fun2,...)
if fun2(c,fc,sub) then
g:AddCard(c)
local sub=sub and fun2(c,fc,false)
local res=Auxiliary.FCheckMixRep(sg,g,fc,sub,fun1,minc,maxc,...)
g:RemoveCard(c)
return res
end
return false
end end
function Auxiliary.FCheckMixRepGoal(tp,sg,fc,sub,fun1,minc,maxc,...) function Auxiliary.FCheckMixRepGoal(tp,sg,fc,sub,fun1,minc,maxc,...)
if sg:GetCount()<minc+#{...} or sg:GetCount()>maxc+#{...} then return false end if sg:GetCount()<minc+#{...} or sg:GetCount()>maxc+#{...} then return false end
local g=Group.CreateGroup() local g=Group.CreateGroup()
return sg:IsExists(Auxiliary.FCheckMixRep,1,nil,sg,g,fc,sub,fun1,minc,maxc,...) and Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0 return Auxiliary.FCheckMixRep(sg,g,fc,sub,fun1,minc,maxc,...) and Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0
and (not Auxiliary.FCheckAdditional or Auxiliary.FCheckAdditional(tp,sg,fc)) and (not Auxiliary.FCheckAdditional or Auxiliary.FCheckAdditional(tp,sg,fc))
end end
function Auxiliary.FCheckMixRepTemplate(c,cond,tp,mg,sg,g,fc,sub,fun1,minc,maxc,...) function Auxiliary.FCheckMixRepTemplate(c,cond,tp,mg,sg,g,fc,sub,fun1,minc,maxc,...)
...@@ -708,13 +710,14 @@ function Auxiliary.FCheckSelectMixRepAll(c,tp,mg,sg,g,fc,sub,fun1,minc,maxc,fun2 ...@@ -708,13 +710,14 @@ function Auxiliary.FCheckSelectMixRepAll(c,tp,mg,sg,g,fc,sub,fun1,minc,maxc,fun2
g:RemoveCard(c) g:RemoveCard(c)
return res return res
end end
elseif fun1(c,fc,sub) then elseif maxc>0 and fun1(c,fc,sub) then
g:AddCard(c) g:AddCard(c)
local sub=sub and fun1(c,fc,false) local sub=sub and fun1(c,fc,false)
local res=Auxiliary.FCheckSelectMixRep(tp,mg,sg,g,fc,sub,fun1,minc-1,maxc-1) local res=Auxiliary.FCheckSelectMixRep(tp,mg,sg,g,fc,sub,fun1,minc-1,maxc-1)
g:RemoveCard(c) g:RemoveCard(c)
return res return res
end end
return false
end end
function Auxiliary.FCheckSelectMixRepM(c,tp,...) function Auxiliary.FCheckSelectMixRepM(c,tp,...)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
......
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