Commit 117db756 authored by mercury233's avatar mercury233 Committed by GitHub

update to use aux.mzctcheck (#1345)

parent 6506bcf9
......@@ -38,16 +38,13 @@ end
function c25857977.desfilter2(c,e)
return c25857977.desfilter(c) and c:IsCanBeEffectTarget(e)
end
function c25857977.fselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c25857977.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c25857977.desfilter(chkc) end
local g=Duel.GetMatchingGroup(c25857977.desfilter2,tp,LOCATION_ONFIELD,0,nil,e)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and g:CheckSubGroup(c25857977.fselect,1,g:GetCount(),tp) end
and g:CheckSubGroup(aux.mzctcheck,1,g:GetCount(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:SelectSubGroup(tp,c25857977.fselect,false,1,g:GetCount(),tp)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,false,1,g:GetCount(),tp)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
......
......@@ -28,19 +28,16 @@ function c33022867.initial_effect(c)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c33022867.fselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c33022867.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp)
return rg:CheckSubGroup(c33022867.fselect,3,3,tp)
return rg:CheckSubGroup(aux.mzctcheck,3,3,tp)
end
function c33022867.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,c33022867.fselect,true,3,3,tp)
local sg=rg:SelectSubGroup(tp,aux.mzctcheck,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
......
......@@ -44,19 +44,16 @@ end
function c36322312.sprfilter(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsSetCard(0x51) and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsAbleToGraveAsCost()
end
function c36322312.fselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c36322312.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c36322312.sprfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
return g:CheckSubGroup(c36322312.fselect,2,2,tp)
return g:CheckSubGroup(aux.mzctcheck,2,2,tp)
end
function c36322312.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c36322312.sprfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,c36322312.fselect,true,2,2,tp)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
......
......@@ -58,9 +58,6 @@ end
function c44097050.splimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function c44097050.rselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c44097050.costfilter(c,tp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
......@@ -73,7 +70,7 @@ end
function c44097050.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetReleaseGroup(tp)
local b1=Duel.CheckReleaseGroup(tp,c44097050.costfilter,1,nil,tp)
local b2=g:GetCount()>1 and g:CheckSubGroup(c44097050.rselect,2,2,tp)
local b2=g:GetCount()>1 and g:CheckSubGroup(aux.mzctcheck,2,2,tp)
and Duel.IsExistingMatchingCard(c44097050.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b3=Duel.CheckReleaseGroup(tp,nil,3,nil) and Duel.IsExistingMatchingCard(c44097050.thfilter,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 or b3 end
......@@ -103,7 +100,7 @@ function c44097050.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
rg=Duel.SelectReleaseGroup(tp,c44097050.costfilter,1,1,nil,tp)
elseif opval[op]==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
rg=g:SelectSubGroup(tp,c44097050.rselect,false,2,2,tp)
rg=g:SelectSubGroup(tp,aux.mzctcheck,false,2,2,tp)
else
rg=Duel.SelectReleaseGroup(tp,nil,3,3,nil)
end
......
......@@ -60,14 +60,11 @@ function c45148985.sprcon(e,c)
local ct=-ft+1
return ft>-5 and g:GetClassCount(Card.GetCode)>=5 and (ft>0 or g:IsExists(c45148985.mzfilter,ct,nil))
end
function c45148985.gselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c45148985.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c45148985.sprfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=aux.dncheck
local rg=g:SelectSubGroup(tp,c45148985.gselect,false,5,5,tp)
local rg=g:SelectSubGroup(tp,aux.mzctcheck,false,5,5,tp)
aux.GCheckAdditional=nil
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
......
......@@ -39,14 +39,11 @@ function c91588074.spcon(e,c)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeckOrExtraAsCost,c:GetControler(),LOCATION_HAND+LOCATION_ONFIELD,0,c)
return g:GetClassCount(Card.GetCode)>=10 and (ft>0 or g:IsExists(Card.IsLocation,ct,nil,LOCATION_MZONE))
end
function c91588074.gselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c91588074.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
aux.GCheckAdditional=aux.dncheck
local rg=g:SelectSubGroup(tp,c91588074.gselect,false,10,10,tp)
local rg=g:SelectSubGroup(tp,aux.mzctcheck,false,10,10,tp)
aux.GCheckAdditional=nil
local cg=rg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
......
......@@ -62,13 +62,10 @@ function c95403418.spcon(e,c)
local ct=-ft+1
return mg:GetCount()>0 and (ft>0 or mg:IsExists(c95403418.mzfilter,ct,nil))
end
function c95403418.gselect(g,tp)
return Duel.GetMZoneCount(tp,g)>0
end
function c95403418.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c95403418.filter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=mg:SelectSubGroup(tp,c95403418.gselect,false,1,#mg,tp)
local g=mg:SelectSubGroup(tp,aux.mzctcheck,false,1,#mg,tp)
local ct=Duel.SendtoGrave(g,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
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