Commit 56b1e8aa authored by nekrozar's avatar nekrozar

update subgroup max value

parent b2835ebe
......@@ -32,12 +32,12 @@ function c10000.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp)
return rg:CheckSubGroup(c10000.fselect,1,99,tp)
return rg:CheckSubGroup(c10000.fselect,1,rg:GetCount(),tp)
end
function c10000.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,c10000.fselect,true,1,99,tp)
local sg=rg:SelectSubGroup(tp,c10000.fselect,true,1,rg:GetCount(),tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
......
......@@ -38,10 +38,10 @@ function c27012990.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return g:CheckSubGroup(c27012990.fselect,1,99,tp)
return g:CheckSubGroup(c27012990.fselect,1,g:GetCount(),tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,c27012990.fselect,false,1,99,tp)
local rg=g:SelectSubGroup(tp,c27012990.fselect,false,1,g:GetCount(),tp)
local ct=rg:GetSum(Card.GetLink)
e:SetLabel(ct)
local tct=1
......
......@@ -29,7 +29,7 @@ function c40998517.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c40998517.costfilter,1,nil,tp) end
local rg=Duel.GetReleaseGroup(tp):Filter(c40998517.costfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,c40998517.fselect,false,1,99,tp)
local sg=rg:SelectSubGroup(tp,c40998517.fselect,false,1,rg:GetCount(),tp)
local ct=Duel.Release(sg,REASON_COST)
e:SetLabel(ct)
end
......
......@@ -31,8 +31,8 @@ function c6713443.sfilter(c)
return c:IsSetCard(0x7c) and c:GetCode()~=6713443 and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c6713443.fselect(g,ft)
if g:IsExists(Card.IsType,1,nil,TYPE_FIELD) then ft=ft+1 end
return g:GetCount()<=ft and not g:IsExists(Card.IsType,2,nil,TYPE_FIELD)
local fc=g:FilterCount(Card.IsType,nil,TYPE_FIELD)
return fc<=1 and #g-fc<ft
end
function c6713443.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
......@@ -44,12 +44,11 @@ function c6713443.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if ct>0 then
local ft2=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft2>ct then ft2=ct end
local sg=Duel.GetMatchingGroup(c6713443.sfilter,tp,LOCATION_DECK,0,nil)
if sg:CheckSubGroup(c6713443.fselect,1,99,ft2) and Duel.SelectYesNo(tp,aux.Stringid(6713443,0)) then
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(6713443,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local setg=sg:SelectSubGroup(tp,c6713443.fselect,false,1,99,ft2)
local setg=sg:SelectSubGroup(tp,c6713443.fselect,false,1,math.min(ct,ft2+1),ft2)
Duel.SSet(tp,setg)
end
end
......
......@@ -43,7 +43,7 @@ function c720147.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
local rg=Duel.GetReleaseGroup(tp):Filter(c720147.costfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,c720147.fselect,false,1,99,tp)
local sg=rg:SelectSubGroup(tp,c720147.fselect,false,1,rg:GetCount(),tp)
sg:KeepAlive()
e:SetLabelObject(sg)
Duel.Release(sg,REASON_COST)
......
......@@ -96,18 +96,9 @@ end
function c77522571.costfilter(c)
return c:IsLevelAbove(1) and c:IsRace(RACE_FIEND)
end
function c77522571.lvcheck(g)
local lv=0
local tc=g:GetFirst()
while tc do
lv=lv+tc:GetLevel()
tc=g:GetNext()
end
return lv
end
function c77522571.fgoal(sg,e,tp)
if Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local lv=c77522571.lvcheck(sg)
local lv=sg:GetSum(Card.GetLevel)
Duel.SetSelectedCard(sg)
return Duel.CheckReleaseGroup(tp,nil,0,nil)
and Duel.IsExistingMatchingCard(c77522571.spfilter3,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv)
......@@ -119,9 +110,9 @@ function c77522571.spfilter3(c,e,tp,lv)
end
function c77522571.spcost3(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetReleaseGroup(tp):Filter(c77522571.costfilter,nil)
if chk==0 then return rg:CheckSubGroup(c77522571.fgoal,2,99,e,tp) end
local g=rg:SelectSubGroup(tp,c77522571.fgoal,false,2,99,e,tp)
local lv=c77522571.lvcheck(g)
if chk==0 then return rg:CheckSubGroup(c77522571.fgoal,2,rg:GetCount(),e,tp) end
local g=rg:SelectSubGroup(tp,c77522571.fgoal,false,2,rg:GetCount(),e,tp)
local lv=sg:GetSum(Card.GetLevel)
e:SetLabel(lv)
Duel.Release(g,REASON_COST)
end
......
......@@ -39,7 +39,7 @@ function c82319644.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c82319644.desfilter,tp,0,LOCATION_MZONE,nil,atk)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:SelectSubGroup(tp,c82319644.fselect,false,1,99,atk)
local dg=g:SelectSubGroup(tp,c82319644.fselect,false,1,g:GetCount(),atk)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
......
......@@ -66,7 +66,7 @@ function c88000953.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c88000953.costfilter,1,nil,tp,lg) end
local rg=Duel.GetReleaseGroup(tp):Filter(c88000953.costfilter,nil,tp,lg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,c88000953.fselect,false,1,99,tp)
local sg=rg:SelectSubGroup(tp,c88000953.fselect,false,1,rg:GetCount(),tp)
local ct=Duel.Release(sg,REASON_COST)
e:SetLabel(ct)
end
......
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