Commit 190ec70b authored by GuGu's avatar GuGu

Update c22123.lua

parent 2875d7f8
Pipeline #42795 passed with stage
in 13 seconds
...@@ -14,44 +14,32 @@ function c22123.tfilter0(c) ...@@ -14,44 +14,32 @@ function c22123.tfilter0(c)
return c:IsSetCard(0x814) and c:IsFaceup() return c:IsSetCard(0x814) and c:IsFaceup()
end end
function c22123.tfilter1(c) function c22123.tfilter1(c)
return c:GetSequence()>4 local gn=Duel.GetMatchingGroup(c22123.tfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c)
return c:IsSetCard(0x814) and c:IsFaceup() and gn:GetCount()>0
end end
function c22123.check1(c) function c22123.tfilter2(c,tc)
return c:IsType(TYPE_MONSTER)
end
function c22123.check2(c,g1,g2,tp)
return (g1:IsContains(c) and c:GetControler()==tp)
or (g2:IsContains(c) and c:IsLocation(LOCATION_MZONE) and (c:GetControler()==tp or c:GetSequence()>4))
end
function c22123.check3(c,g1,g2,tp)
return (g2:IsContains(c) and c:IsLocation(LOCATION_MZONE) and c:GetControler()==tp and not g1:IsContains(c))
or (g1:IsContains(c) and c:IsLocation(LOCATION_MZONE) and c:GetControler()==tp)
end
function c22123.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(c22123.tfilter0,tp,LOCATION_MZONE,0,nil)==1 end
local gn=Group.CreateGroup() local gn=Group.CreateGroup()
local tc=Duel.GetMatchingGroup(c22123.tfilter0,tp,LOCATION_MZONE,0,nil):GetFirst()
local seq=tc:GetSequence() local seq=tc:GetSequence()
if seq>4 then if seq>4 then
local g1=tc:GetColumnGroup() local g1=tc:GetColumnGroup()
local g2=Duel.GetMatchingGroup(c22123.tfilter1,tp,0,LOCATION_MZONE,0,nil) local g2=Duel.GetMatchingGroup(c22123.tfilter3,tp,LOCATION_MZONE,LOCATION_MZONE,tc)
if g2:GetCount()>0 then if g1:GetCount()>0 then gn:Merge(g1) end
g1:Merge(g2) if g2:GetCount()>0 then gn:Merge(g2) end
end
if g1:GetCount()>0 then
gn=g1:Filter(c22123.check1,tc)
end
else else
if seq==1 or seq==3 then local g1=tc:GetColumnGroup()
local g1=tc:GetColumnGroup() local g2=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,tc)
local g2=tc:GetColumnGroup(1,1) if g1:GetCount()>0 then gn:Merge(g1) end
gn=g2:Filter(c22123.check2,tc,g1,g2,tp) if g2:GetCount()>0 then gn:Merge(g2) end
else
local g1=tc:GetColumnGroup()
local g2=tc:GetColumnGroup(1,1)
gn=g2:Filter(c22123.check3,tc,g1,g2,tp)
end
end end
return gn:IsContains(c)
end
function c22123.tfilter3(c)
return c:GetSequence()>4
end
function c22123.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(c22123.tfilter0,tp,LOCATION_MZONE,0,nil)==1 and Duel.GetMatchingGroupCount(c22123.tfilter1,tp,LOCATION_MZONE,0,nil)==1 end
local tc=Duel.GetMatchingGroup(c22123.tfilter0,tp,LOCATION_MZONE,0,nil):GetFirst()
local gn=Duel.GetMatchingGroup(c22123.tfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tc)
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,gn,gn:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,gn,gn:GetCount(),0,0)
end end
...@@ -59,29 +47,7 @@ end ...@@ -59,29 +47,7 @@ end
function c22123.operation(e,tp,eg,ep,ev,re,r,rp) function c22123.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
local gn=Group.CreateGroup() local gn=Duel.GetMatchingGroup(c22123.tfilter2,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tc)
local tc=Duel.GetMatchingGroup(c22123.tfilter0,tp,LOCATION_MZONE,0,nil):GetFirst()
local seq=tc:GetSequence()
if seq>4 then
local g1=tc:GetColumnGroup()
local g2=Duel.GetMatchingGroup(c22123.tfilter1,tp,0,LOCATION_MZONE,0,nil)
if g2:GetCount()>0 then
g1:Merge(g2)
end
if g1:GetCount()>0 then
gn=g1:Filter(c22123.check1,tc)
end
else
if seq==1 or seq==3 then
local g1=tc:GetColumnGroup()
local g2=tc:GetColumnGroup(1,1)
gn=g2:Filter(c22123.check2,tc,g1,g2,tp)
else
local g1=tc:GetColumnGroup()
local g2=tc:GetColumnGroup(1,1)
gn=g2:Filter(c22123.check3,tc,g1,g2,tp)
end
end
if gn:GetCount()>0 and Duel.Destroy(gn,REASON_EFFECT)~=0 then if gn:GetCount()>0 and Duel.Destroy(gn,REASON_EFFECT)~=0 then
local h=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) local h=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if h<gn:GetCount() then if h<gn:GetCount() 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