Commit 8b25ce6e authored by POLYMER's avatar POLYMER

fix

parent 081884b6
...@@ -25,7 +25,7 @@ function c10111191.initial_effect(c) ...@@ -25,7 +25,7 @@ function c10111191.initial_effect(c)
e3:SetTarget(c10111191.sumtg) e3:SetTarget(c10111191.sumtg)
e3:SetOperation(c10111191.sumop) e3:SetOperation(c10111191.sumop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
-- 召唤成功时效果 -- 召唤成功时效果
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(10111191,0)) e4:SetDescription(aux.Stringid(10111191,0))
e4:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND) e4:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND)
...@@ -85,9 +85,9 @@ function c10111191.sumop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,9 +85,9 @@ function c10111191.sumop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
-- 素材检查 -- 素材检查(保持不变)
function c10111191.valcheck(e,c) function c10111191.valcheck(e,c)
local g=c:GetMaterial() -- 正确获取解放素材的方式 local g=c:GetMaterial()
if g:IsExists(Card.IsSetCard,1,nil,0x1185) then if g:IsExists(Card.IsSetCard,1,nil,0x1185) then
e:GetLabelObject():SetLabel(1) e:GetLabelObject():SetLabel(1)
else else
...@@ -98,10 +98,10 @@ end ...@@ -98,10 +98,10 @@ end
-- 目标选择 -- 目标选择
function c10111191.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c10111191.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_SZONE+LOCATION_GRAVE,1,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_SZONE+LOCATION_GRAVE,1,1,nil)
if #g>0 then if #g>0 then
e:SetLabelObject(g:GetFirst()) e:SetLabelObject(g:GetFirst())
if e:GetLabel()==1 then if e:GetLabel()==1 then
...@@ -115,7 +115,7 @@ end ...@@ -115,7 +115,7 @@ end
-- 效果处理 -- 效果处理
function c10111191.op(e,tp,eg,ep,ev,re,r,rp) function c10111191.op(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
if not tc or not tc:IsLocation(LOCATION_GRAVE) then return end if not tc or not tc:IsLocation(LOCATION_SZONE+LOCATION_GRAVE) then return end
local replace=(e:GetLabel()==1) local replace=(e:GetLabel()==1)
......
...@@ -53,20 +53,19 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,20 +53,19 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
-- 自肃效果 -- 自肃效果
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetCode(EFFECT_CANNOT_ACTIVATE) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit) e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function s.splimit(e,c)
function s.aclimit(e,re,tp) return not c:IsRace(RACE_DINOSAUR) and c:IsLocation(LOCATION_EXTRA)
return re:IsActiveType(TYPE_MONSTER)
and not re:GetHandler():IsRace(RACE_DINOSAUR) -- 修正点
end end
function s.thfilter(c) function s.thfilter(c)
return c:IsSetCard(0x1185) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0x1185) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
......
...@@ -15,13 +15,29 @@ function s.initial_effect(c) ...@@ -15,13 +15,29 @@ function s.initial_effect(c)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end
function s.counterfilter(c) function s.counterfilter(c)
return c:IsLevel(3) or c:IsLink(3) or c:IsRank(3) return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not (c:IsLevel(3) or c:IsLink(3) or c:IsRank(3)) return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end end
function s.costfilter(c,tp) function s.costfilter(c,tp)
return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost() return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()
...@@ -30,7 +46,7 @@ function s.cfilter(c) ...@@ -30,7 +46,7 @@ function s.cfilter(c)
return c:GetSequence()<5 return c:GetSequence()<5
end end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......
...@@ -15,12 +15,29 @@ function s.initial_effect(c) ...@@ -15,12 +15,29 @@ function s.initial_effect(c)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end end
function s.counterfilter(c) function s.counterfilter(c)
return c:IsLevel(3) or c:IsLink(3) or c:IsRank(3) return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not (c:IsLevel(3) or c:IsLink(3) or c:IsRank(3)) return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end end
function s.costfilter(c,tp) function s.costfilter(c,tp)
return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost() return c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost()
...@@ -28,7 +45,7 @@ end ...@@ -28,7 +45,7 @@ end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
...@@ -52,7 +69,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,7 +69,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
if not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then then if not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then
e:SetCategory(CATEGORY_GRAVE_ACTION) e:SetCategory(CATEGORY_GRAVE_ACTION)
end end
e:SetLabel(num) e:SetLabel(num)
......
...@@ -15,12 +15,29 @@ function s.initial_effect(c) ...@@ -15,12 +15,29 @@ function s.initial_effect(c)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end end
function s.counterfilter(c) function s.counterfilter(c)
return c:IsLevel(3) or c:IsLink(3) or c:IsRank(3) return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not (c:IsLevel(3) or c:IsLink(3) or c:IsRank(3)) return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end end
function s.costfilter(c,tp) function s.costfilter(c,tp)
...@@ -29,7 +46,7 @@ end ...@@ -29,7 +46,7 @@ end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
...@@ -56,8 +73,9 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -56,8 +73,9 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then if Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then
e:SetLabel(1) e:SetLabel(1)
e:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND) e:SetCategory(CATEGORY_DRAW+CATEGORY_TOHAND)
else
e:SetLabel(0)
end end
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
......
...@@ -15,12 +15,29 @@ function s.initial_effect(c) ...@@ -15,12 +15,29 @@ function s.initial_effect(c)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter) Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.fit1(c)
return c:IsLevelBelow(2) or c:IsLinkBelow(2) or c:IsRankBelow(2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(s.fit1,1,nil) then
Duel.RegisterFlagEffect(rp,id,0,0,0)
end
end end
function s.counterfilter(c) function s.counterfilter(c)
return c:IsLevel(3) or c:IsLink(3) or c:IsRank(3) return c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3)
end end
function s.splimit(e,c) function s.splimit(e,c)
return not (c:IsLevel(3) or c:IsLink(3) or c:IsRank(3)) return not (c:IsLevelAbove(3) or c:IsLinkAbove(3) or c:IsRankAbove(3))
end end
function s.costfilter(c,tp) function s.costfilter(c,tp)
...@@ -29,7 +46,7 @@ end ...@@ -29,7 +46,7 @@ end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c) and Duel.GetFlagEffect(tp,id)<1 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
......
...@@ -206,185 +206,3 @@ end ...@@ -206,185 +206,3 @@ end
--subgroup optimization
function Group.SelectSubGroup(g,tp,f,cancelable,min,max,...)
--classif: function to classify cards, e.g. function(c,tc) return c:GetLevel()==tc:GetLevel() end
--sortif: function of subgroup search order, high to low. e.g. Card.GetLevel
--passf: cards that do not require check, e.g. function(c) return c:IsLevel(1) end
--goalstop: do you want to backtrack after reaching the goal? true/false
--check: do you want to return true after reaching the goal firstly? true/false
local classif,sortf,passf,goalstop,check=table.unpack(cm.SubGroupParams)
min=min or 1
max=max or #g
local sg=Group.CreateGroup()
local fg=Duel.GrabSelectedCard()
if #fg>max or min>max or #(g+fg)<min then return nil end
if not check then
for tc in aux.Next(fg) do
fg:SelectUnselect(sg,tp,false,false,min,max)
end
end
sg:Merge(fg)
local mg,iisg,tmp,stop,iter,ctab,rtab,gtab
--main check
local finish=(#sg>=min and #sg<=max and f(sg,...))
while #sg<max do
mg=g-sg
iisg=sg:Clone()
if passf then
aux.SubGroupCaptured=mg:Filter(passf,nil,sg,g)
else
aux.SubGroupCaptured=Group.CreateGroup()
end
ctab,rtab,gtab={},{},{1}
for tc in aux.Next(mg) do
ctab[#ctab+1]=tc
end
--high to low
if sortf then
for i=1,#ctab-1 do
for j=1,#ctab-1-i do
if sortf(ctab[j])<sortf(ctab[j+1]) then
tmp=ctab[j]
ctab[j]=ctab[j+1]
ctab[j+1]=tmp
end
end
end
end
--classify
if classif then
--make similar cards adjacent
for i=1,#ctab-2 do
for j=i+2,#ctab do
if classif(ctab[i],ctab[j]) then
tmp=ctab[j]
ctab[j]=ctab[i+1]
ctab[i+1]=tmp
end
end
end
--rtab[i]: what category does the i-th card belong to
--gtab[i]: What is the first card's number in the i-th category
for i=1,#ctab-1 do
rtab[i]=#gtab
if not classif(ctab[i],ctab[i+1]) then
gtab[#gtab+1]=i+1
end
end
rtab[#ctab]=#gtab
--iter record all cards' number in sg
iter={1}
sg:AddCard(ctab[1])
while #sg>#iisg and #aux.SubGroupCaptured<#mg do
stop=#sg>=max
--prune if too much cards
if (aux.GCheckAdditional and not aux.GCheckAdditional(sg,c,g,f,min,max,...)) then
stop=true
--skip check if no new cards
elseif #(sg-iisg-aux.SubGroupCaptured)>0 and #sg>=min and #sg<=max and f(sg,...) then
for sc in aux.Next(sg-iisg) do
if check then return true end
aux.SubGroupCaptured:Merge(mg:Filter(classif,nil,sc))
end
stop=goalstop
end
local code=iter[#iter]
--last card isn't in the last category
if code and code<gtab[#gtab] then
if stop then
--backtrack and add 1 card from next category
iter[#iter]=gtab[rtab[code]+1]
sg:RemoveCard(ctab[code])
sg:AddCard(ctab[(iter[#iter])])
else
--continue searching forward
iter[#iter+1]=code+1
sg:AddCard(ctab[code+1])
end
--last card is in the last category
elseif code then
if stop or code>=#ctab then
--clear all cards in the last category
while #iter>0 and iter[#iter]>=gtab[#gtab] do
sg:RemoveCard(ctab[(iter[#iter])])
iter[#iter]=nil
end
--backtrack and add 1 card from next category
local code2=iter[#iter]
if code2 then
iter[#iter]=gtab[rtab[code2]+1]
sg:RemoveCard(ctab[code2])
sg:AddCard(ctab[(iter[#iter])])
end
else
--continue searching forward
iter[#iter+1]=code+1
sg:AddCard(ctab[code+1])
end
end
end
if check then return false end
--classification is essential for efficiency, and this part is only for backup
else
iter={1}
sg:AddCard(ctab[1])
while #sg>#iisg and #aux.SubGroupCaptured<#mg do
stop=#sg>=max
if (aux.GCheckAdditional and not aux.GCheckAdditional(sg,c,g,f,min,max,...)) then
stop=true
elseif #(sg-iisg-aux.SubGroupCaptured)>0 and #sg>=min and #sg<=max and f(sg,...) then
for sc in aux.Next(sg-iisg) do
if check then return true end
aux.SubGroupCaptured:AddCard(sc) --Merge(mg:Filter(class,nil,sc))
end
stop=goalstop
end
local code=iter[#iter]
if code<#ctab then
if stop then
iter[#iter]=nil
sg:RemoveCard(ctab[code])
end
iter[#iter+1]=code+1
sg:AddCard(ctab[code+1])
else
local code2=iter[#iter-1]
iter[#iter]=nil
sg:RemoveCard(ctab[code])
if code2 and code2>0 then
iter[#iter]=code2+1
sg:RemoveCard(ctab[code2])
sg:AddCard(ctab[code2+1])
end
end
end
end
--finish searching
sg=iisg
local cg=aux.SubGroupCaptured:Clone()
aux.SubGroupCaptured:Clear()
cg:Sub(sg)
--Debug.Message(cm[0])
finish=(#sg>=min and #sg<=max and f(sg,...))
if #cg==0 then break end
local cancel=not finish and cancelable
local tc=cg:SelectUnselect(sg,tp,finish,cancel,min,max)
if not tc then break end
if not fg:IsContains(tc) then
if not sg:IsContains(tc) then
sg:AddCard(tc)
if #sg==max then finish=true end
else
sg:RemoveCard(tc)
end
elseif cancelable then
return nil
end
end
if finish then
return sg
else
return nil
end
end
\ No newline at end of file
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