Commit 1ee8d23d authored by POLYMER's avatar POLYMER

fix

parent da057c58
......@@ -63,11 +63,13 @@ function cm.hspcheck(g,lv,tp)
--Duel.SetSelectedCard(g)
return cm.fselect(g,lv,tp) --g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
end
function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
local lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
--Duel.SetSelectedCard(g)
return cm.fselect(g,lv,tp) --g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
function cm.hspgcheck(lv,tp)
return function(g,c,mg)
--local lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
--Duel.SetSelectedCard(g)
return cm.fselect(g,lv,tp) --g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
end
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
......@@ -112,7 +114,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then return true end
......@@ -128,7 +130,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then tg:AddCard(sc) end
......@@ -140,7 +142,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=tg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(tc),tp)
rg=mg:SelectSubGroup(tp,cm.hspcheck,true,1,#mg,cm.lvplus(tc),tp)
aux.GCheckAdditional=nil
end
......
......@@ -61,11 +61,11 @@ function cm.hspcheck(g,lv,tp)
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
end
function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
local lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
function cm.hspgcheck(lv,tp)
return function(g,c,mg)
if g:GetSum(cm.lvplus)<=lv then return true end
return cm.fselect(g,lv,tp)
end
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -95,7 +95,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then return true end
......@@ -111,7 +111,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then tg:AddCard(sc) end
......@@ -123,7 +123,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=tg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(tc),tp)
rg=mg:SelectSubGroup(tp,cm.hspcheck,true,1,#mg,cm.lvplus(tc),tp)
aux.GCheckAdditional=nil
end
......
......@@ -95,11 +95,11 @@ function cm.hspcheck(g,lv,tp)
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
end
function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
local lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
function cm.hspgcheck(lv,tp)
return function(g,c,mg)
if g:GetSum(cm.lvplus)<=lv then return true end
return cm.fselect(g,lv,tp)
end
end
function cm.pccost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -151,7 +151,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then return true end
......@@ -167,7 +167,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then tg:AddCard(sc) end
......@@ -179,7 +179,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=tg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(tc),tp)
rg=mg:SelectSubGroup(tp,cm.hspcheck,true,1,#mg,cm.lvplus(tc),tp)
aux.GCheckAdditional=nil
end
......
......@@ -79,11 +79,11 @@ function cm.hspcheck(g,lv,tp)
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
end
function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
local lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
Duel.SetSelectedCard(g)
return g:CheckSubGroup(cm.fselect,1,#g,lv,tp)
function cm.hspgcheck(lv,tp)
return function(g,c,mg)
if g:GetSum(cm.lvplus)<=lv then return true end
return cm.fselect(g,lv,tp)
end
end
function cm.chcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -129,7 +129,7 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then return true end
......@@ -145,7 +145,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter3,tp,LOCATION_DECK,0,nil,e,tp)
local tg=Group.CreateGroup()
for sc in aux.Next(sg) do
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(sc),tp)
local tc=mg:CheckSubGroup(cm.hspcheck,1,#mg,cm.lvplus(sc),tp)
aux.GCheckAdditional=nil
if tc then tg:AddCard(sc) end
......@@ -157,7 +157,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tc=tg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=cm.hspgcheck
aux.GCheckAdditional=cm.hspgcheck(cm.lvplus(tc),tp)
rg=mg:SelectSubGroup(tp,cm.hspcheck,true,1,#mg,cm.lvplus(tc),tp)
aux.GCheckAdditional=nil
end
......
......@@ -83,7 +83,7 @@ function cm.fselect(g,ng,goal,tp)
elseif g:GetSum(cm.lvplus)==goal and Duel.GetMZoneCount(tp,g)>0 then
return true
end
aux.GCheckAdditional=cm.hspgcheck2
aux.GCheckAdditional=cm.hspgcheck2(g,g:GetSum(cm.lvplus)-goal,tp)
local tc=ng:CheckSubGroup(cm.fselect3,1,#ng,g,g:GetSum(cm.lvplus)-goal,tp)
aux.GCheckAdditional=nil
return tc
......@@ -91,15 +91,17 @@ end
function cm.fselect3(g,g1,lv,tp)
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0
end
function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
local ng,goal,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=goal then return true end
return cm.fselect(g,ng,goal,tp)
function cm.hspgcheck(ng,goal,tp)
return function(g,c,mg)
if g:GetSum(cm.lvplus)<=goal then return true end
return cm.fselect(g,ng,goal,tp)
end
end
function cm.hspgcheck2(g,c,mg,f,min,max,ext_params)
local g1,lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
return cm.fselect3(g,g1,lv,tp)
function cm.hspgcheck2(ng,goal,tp)
return function(g,c,mg)
if g:GetSum(cm.lvplus)<=goal then return true end
return cm.fselect3(g,ng,goal,tp)
end
end
function cm.accost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -167,7 +169,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
rg=trg:SelectSubGroup(tp,cm.fselect,true,1,#trg,ng,cm.lvplus(tc),tp)
if rg and #rg>0 and rg:GetSum(cm.lvplus)>cm.lvplus(tc) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,7))
aux.GCheckAdditional=cm.hspgcheck2
aux.GCheckAdditional=cm.hspgcheck2(rg,rg:GetSum(cm.lvplus)-cm.lvplus(tc),tp)
rg2=ng:SelectSubGroup(tp,cm.fselect3,true,1,#ng,rg,rg:GetSum(cm.lvplus)-cm.lvplus(tc),tp)
aux.GCheckAdditional=nil
if rg2 and #rg2>0 then
......
......@@ -86,7 +86,7 @@ function cm.fselect(g,ng,goal,tp)
elseif g:GetSum(cm.lvplus)==goal and Duel.GetMZoneCount(tp,g)>0 then
return true
end
aux.GCheckAdditional=cm.hspgcheck2
aux.GCheckAdditional=cm.hspgcheck2(g,g:GetSum(cm.lvplus)-goal,tp)
local tc=ng:CheckSubGroup(cm.fselect3,1,#ng,g,g:GetSum(cm.lvplus)-goal,tp)
aux.GCheckAdditional=nil
return tc
......@@ -94,15 +94,17 @@ end
function cm.fselect3(g,g1,lv,tp)
return g:GetSum(cm.lvplus)==lv and Duel.GetMZoneCount(tp,g+g1)>0
end
function cm.hspgcheck(g,c,mg,f,min,max,ext_params)
local ng,goal,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=goal then return true end
return cm.fselect(g,ng,goal,tp)
function cm.hspgcheck(ng,goal,tp)
return function(g,c,mg)
if g:GetSum(cm.lvplus)<=goal then return true end
return cm.fselect(g,ng,goal,tp)
end
end
function cm.hspgcheck2(g,c,mg,f,min,max,ext_params)
local g1,lv,tp=table.unpack(ext_params)
if g:GetSum(cm.lvplus)<=lv then return true end
return cm.fselect3(g,g1,lv,tp)
function cm.hspgcheck2(ng,goal,tp)
return function(g,c,mg)
if g:GetSum(cm.lvplus)<=goal then return true end
return cm.fselect3(g,ng,goal,tp)
end
end
function cm.chcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -207,7 +209,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
rg=trg:SelectSubGroup(tp,cm.fselect,true,1,#trg,ng,cm.lvplus(tc),tp)
if rg and #rg>0 and rg:GetSum(cm.lvplus)>cm.lvplus(tc) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,7))
aux.GCheckAdditional=cm.hspgcheck2
aux.GCheckAdditional=cm.hspgcheck2(rg,rg:GetSum(cm.lvplus)-cm.lvplus(tc),tp)
rg2=ng:SelectSubGroup(tp,cm.fselect3,true,1,#ng,rg,rg:GetSum(cm.lvplus)-cm.lvplus(tc),tp)
aux.GCheckAdditional=nil
if rg2 and #rg2>0 then
......
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