Commit 6142fe0e authored by mercury233's avatar mercury233 Committed by GitHub

add Auxiliary.gfcheck, gffcheck (#1286)

parent 10b125f5
...@@ -44,30 +44,11 @@ end ...@@ -44,30 +44,11 @@ end
function c11366199.spcostfilter(c) function c11366199.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_WIND+ATTRIBUTE_DARK) return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_WIND+ATTRIBUTE_DARK)
end end
function c11366199.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c11366199.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_WIND)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c11366199.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c11366199.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c11366199.spcostfilter,tp,LOCATION_HAND+LOCATION_GRAVE-e:GetHandler():GetLocation(),0,nil) local g=Duel.GetMatchingGroup(c11366199.spcostfilter,tp,LOCATION_HAND+LOCATION_GRAVE-e:GetHandler():GetLocation(),0,nil)
local sg=Group.CreateGroup() if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_WIND,ATTRIBUTE_DARK) end
if chk==0 then return g:IsExists(c11366199.spcost_selector,1,nil,tp,g,sg,1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_WIND,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c11366199.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c11366199.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c11366199.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -18,36 +18,18 @@ end ...@@ -18,36 +18,18 @@ end
function c19028307.spcostfilter(c) function c19028307.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_BEASTWARRIOR+RACE_MACHINE) and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_BEASTWARRIOR+RACE_MACHINE) and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup())
end end
function c19028307.spcost_selector(c,tp,g,sg,i) function c19028307.spcheck(sg,tp)
sg:AddCard(c) return Duel.GetMZoneCount(tp,sg,tp)>0 and aux.gfcheck(sg,Card.IsRace,RACE_BEASTWARRIOR,RACE_MACHINE)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c19028307.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=Duel.GetMZoneCount(tp,sg,tp)>0
and sg:FilterCount(Card.IsRace,nil,RACE_BEASTWARRIOR)>0
and sg:FilterCount(Card.IsRace,nil,RACE_MACHINE)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end end
function c19028307.spcon(e,c) function c19028307.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c19028307.spcostfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,c) local g=Duel.GetMatchingGroup(c19028307.spcostfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,c)
local sg=Group.CreateGroup() return g:CheckSubGroup(c19028307.spcheck,2,2,tp)
return g:IsExists(c19028307.spcost_selector,1,nil,tp,g,sg,1)
end end
function c19028307.spop(e,tp,eg,ep,ev,re,r,rp,c) function c19028307.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c19028307.spcostfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,c) local g=Duel.GetMatchingGroup(c19028307.spcostfilter,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,c)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,c19028307.spcheck,false,2,2,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c19028307.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
...@@ -25,37 +25,17 @@ end ...@@ -25,37 +25,17 @@ end
function c25460258.spcostfilter(c) function c25460258.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end end
function c25460258.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c25460258.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c25460258.spcon(e,c) function c25460258.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c25460258.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c25460258.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
return g:IsExists(c25460258.spcost_selector,1,nil,tp,g,sg,1)
end end
function c25460258.spop(e,tp,eg,ep,ev,re,r,rp,c) function c25460258.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c25460258.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c25460258.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c25460258.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c25460258.cfilter(c) function c25460258.cfilter(c)
......
...@@ -83,31 +83,12 @@ end ...@@ -83,31 +83,12 @@ end
function c38695361.spcostfilter(c) function c38695361.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end end
function c38695361.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c38695361.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c38695361.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function c38695361.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c38695361.spcostfilter,tp,LOCATION_GRAVE,0,c) local g=Duel.GetMatchingGroup(c38695361.spcostfilter,tp,LOCATION_GRAVE,0,c)
local sg=Group.CreateGroup() if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK) end
if chk==0 then return g:IsExists(c38695361.spcost_selector,1,nil,tp,g,sg,1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c38695361.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c38695361.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c38695361.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -58,37 +58,17 @@ end ...@@ -58,37 +58,17 @@ end
function c55591586.spcostfilter(c) function c55591586.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end end
function c55591586.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c55591586.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c55591586.spcon(e,c) function c55591586.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c55591586.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c55591586.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
return g:IsExists(c55591586.spcost_selector,1,nil,tp,g,sg,1)
end end
function c55591586.spop(e,tp,eg,ep,ev,re,r,rp,c) function c55591586.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c55591586.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c55591586.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c55591586.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c55591586.atkcon(e,tp,eg,ep,ev,re,r,rp) function c55591586.atkcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -35,37 +35,17 @@ end ...@@ -35,37 +35,17 @@ end
function c72989439.spcostfilter(c) function c72989439.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end end
function c72989439.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c72989439.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c72989439.spcon(e,c) function c72989439.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c72989439.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c72989439.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
return g:IsExists(c72989439.spcost_selector,1,nil,tp,g,sg,1)
end end
function c72989439.spop(e,tp,eg,ep,ev,re,r,rp,c) function c72989439.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c72989439.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c72989439.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c72989439.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c72989439.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function c72989439.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -33,37 +33,17 @@ end ...@@ -33,37 +33,17 @@ end
function c82301904.spcostfilter(c) function c82301904.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end end
function c82301904.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c82301904.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c82301904.spcon(e,c) function c82301904.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c82301904.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c82301904.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
return g:IsExists(c82301904.spcost_selector,1,nil,tp,g,sg,1)
end end
function c82301904.spop(e,tp,eg,ep,ev,re,r,rp,c) function c82301904.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c82301904.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c82301904.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c82301904.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c82301904.sgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c82301904.sgcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -27,30 +27,11 @@ end ...@@ -27,30 +27,11 @@ end
function c86559484.spcostfilter(c) function c86559484.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_DRAGON+RACE_WYRM) return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_DRAGON+RACE_WYRM)
end end
function c86559484.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c86559484.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsRace,nil,RACE_DRAGON)>0
and sg:FilterCount(Card.IsRace,nil,RACE_WYRM)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c86559484.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c86559484.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c86559484.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c86559484.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() if chk==0 then return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsRace,RACE_DRAGON,RACE_WYRM) end
if chk==0 then return g:IsExists(c86559484.spcost_selector,1,nil,tp,g,sg,1) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsRace,RACE_DRAGON,RACE_WYRM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c86559484.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c86559484.spfilter(c,e,tp) function c86559484.spfilter(c,e,tp)
......
...@@ -27,37 +27,17 @@ end ...@@ -27,37 +27,17 @@ end
function c9596126.spcostfilter(c) function c9596126.spcostfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) return c:IsAbleToRemoveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end end
function c9596126.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c9596126.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c9596126.spcon(e,c) function c9596126.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c9596126.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c9596126.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
return g:IsExists(c9596126.spcost_selector,1,nil,tp,g,sg,1)
end end
function c9596126.spop(e,tp,eg,ep,ev,re,r,rp,c) function c9596126.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c9596126.spcostfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c9596126.spcostfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c9596126.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c9596126.rmcost(e,tp,eg,ep,ev,re,r,rp,chk) function c9596126.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -35,37 +35,17 @@ end ...@@ -35,37 +35,17 @@ end
function c99365553.spcostfilter2(c) function c99365553.spcostfilter2(c)
return c:IsAbleToGraveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK) return c:IsAbleToGraveAsCost() and c:IsAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end end
function c99365553.spcost_selector(c,tp,g,sg,i)
sg:AddCard(c)
g:RemoveCard(c)
local flag=false
if i<2 then
flag=g:IsExists(c99365553.spcost_selector,1,nil,tp,g,sg,i+1)
else
flag=sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_LIGHT)>0
and sg:FilterCount(Card.IsAttribute,nil,ATTRIBUTE_DARK)>0
end
sg:RemoveCard(c)
g:AddCard(c)
return flag
end
function c99365553.spcon1(e,c) function c99365553.spcon1(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c99365553.spcostfilter1,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c99365553.spcostfilter1,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
return g:IsExists(c99365553.spcost_selector,1,nil,tp,g,sg,1)
end end
function c99365553.spop1(e,tp,eg,ep,ev,re,r,rp,c) function c99365553.spop1(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c99365553.spcostfilter1,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c99365553.spcostfilter1,tp,LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,2 do local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c99365553.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
end end
function c99365553.spcon2(e,c) function c99365553.spcon2(e,c)
...@@ -73,18 +53,13 @@ function c99365553.spcon2(e,c) ...@@ -73,18 +53,13 @@ function c99365553.spcon2(e,c)
local tp=c:GetControler() local tp=c:GetControler()
if c:IsHasEffect(EFFECT_NECRO_VALLEY) or Duel.GetMZoneCount(tp)<=0 then return false end if c:IsHasEffect(EFFECT_NECRO_VALLEY) or Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c99365553.spcostfilter2,tp,LOCATION_HAND,0,nil) local g=Duel.GetMatchingGroup(c99365553.spcostfilter2,tp,LOCATION_HAND,0,nil)
local sg=Group.CreateGroup() return g:CheckSubGroup(aux.gfcheck,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
return g:IsExists(c99365553.spcost_selector,1,nil,tp,g,sg,1)
end end
function c99365553.spop2(e,tp,eg,ep,ev,re,r,rp,c) function c99365553.spop2(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c99365553.spcostfilter2,tp,LOCATION_HAND,0,nil) local g=Duel.GetMatchingGroup(c99365553.spcostfilter2,tp,LOCATION_HAND,0,nil)
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
for i=1,2 do Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local sg=g:SelectSubGroup(tp,aux.gfcheck,false,2,2,Card.IsAttribute,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK)
local g1=g:FilterSelect(tp,c99365553.spcost_selector,1,1,nil,tp,g,sg,i)
sg:Merge(g1)
g:Sub(g1)
end
Duel.SendtoGrave(sg,REASON_COST) Duel.SendtoGrave(sg,REASON_COST)
end end
function c99365553.spcon3(e,tp,eg,ep,ev,re,r,rp) function c99365553.spcon3(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -2230,6 +2230,20 @@ end ...@@ -2230,6 +2230,20 @@ end
function Auxiliary.drccheck(g) function Auxiliary.drccheck(g)
return g:GetClassCount(Card.GetRace)==#g return g:GetClassCount(Card.GetRace)==#g
end end
--check for group with 2 cards, each card match f with a1/a2 as argument
function Auxiliary.gfcheck(g,f,a1,a2)
if #g~=2 then return false end
local c1=g:GetFirst()
local c2=g:GetNext()
return f(c1,a1) and f(c2,a2) or f(c2,a1) and f(c1,a2)
end
--check for group with 2 cards, each card match f1 with a1, f2 with a2 as argument
function Auxiliary.gffcheck(g,f1,a1,f2,a2)
if #g~=2 then return false end
local c1=g:GetFirst()
local c2=g:GetNext()
return f1(c1,a1) and f2(c2,a2) or f1(c2,a1) and f2(c1,a2)
end
--used for "except this card" --used for "except this card"
function Auxiliary.ExceptThisCard(e) function Auxiliary.ExceptThisCard(e)
local c=e:GetHandler() local c=e:GetHandler()
......
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