Commit 0704cd0c authored by mercury233's avatar mercury233 Committed by GitHub

update (#1018)

parent 7a6b8d4a
...@@ -1844,17 +1844,19 @@ function Auxiliary.LinkTarget(f,minc,maxc,gf) ...@@ -1844,17 +1844,19 @@ function Auxiliary.LinkTarget(f,minc,maxc,gf)
end end
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
sg:Merge(bg) sg:Merge(bg)
local finish=false
while #sg<maxc do while #sg<maxc do
finish=Auxiliary.LCheckGoal(tp,sg,c,minc,#sg,gf)
local cg=mg:Filter(Auxiliary.LCheckRecursive,sg,tp,sg,mg,c,#sg,minc,maxc,gf) local cg=mg:Filter(Auxiliary.LCheckRecursive,sg,tp,sg,mg,c,#sg,minc,maxc,gf)
if #cg==0 then break end if #cg==0 then break end
local finish=Auxiliary.LCheckGoal(tp,sg,c,minc,#sg,gf) local cancel=not finish
local cancel=(#sg==0 or finish)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local tc=cg:SelectUnselect(sg,tp,finish,cancel,minc,maxc) local tc=cg:SelectUnselect(sg,tp,finish,cancel,minc,maxc)
if not tc then break end if not tc then break end
if not bg:IsContains(tc) then if not bg:IsContains(tc) then
if not sg:IsContains(tc) then if not sg:IsContains(tc) then
sg:AddCard(tc) sg:AddCard(tc)
if #sg==maxc then finish=true end
else else
sg:RemoveCard(tc) sg:RemoveCard(tc)
end end
...@@ -1862,7 +1864,7 @@ function Auxiliary.LinkTarget(f,minc,maxc,gf) ...@@ -1862,7 +1864,7 @@ function Auxiliary.LinkTarget(f,minc,maxc,gf)
return false return false
end end
end end
if #sg>0 then if finish then
sg:KeepAlive() sg:KeepAlive()
e:SetLabelObject(sg) e:SetLabelObject(sg)
return true return true
......
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