Commit 96339f03 authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent 3f11fe57
...@@ -16,7 +16,7 @@ function s.initial_effect(c) ...@@ -16,7 +16,7 @@ function s.initial_effect(c)
e1:SetOperation(s.rmop) e1:SetOperation(s.rmop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
......
...@@ -57,49 +57,31 @@ function s.initial_effect(c) ...@@ -57,49 +57,31 @@ function s.initial_effect(c)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
--E1 --E1
function s.hascopy(c,g) function s.rmfilter(c,g)
return g:IsExists(Card.IsCode,1,c,c:GetCode()) return g:IsExists(Card.IsCode,1,c,c:GetCode())
end end
function s.namecheck(g) function s.rescon(og)
local c1,c2=g:GetFirst(),g:GetNext()
return c1:IsCode(c2:GetCode())
end
function s.gcheck(og)
return function(g,e,tp,mg,c) return function(g,e,tp,mg,c)
for tc in aux.Next(og) do local cg=og:Filter(aux.TRUE,g)
local codes={tc:GetCode()} if c and not cg:IsExists(Card.IsCode,1,nil,c:GetCode()) then
for _,code in ipairs(codes) do return false,true
local ct=g:FilterCount(Card.IsCode,nil,code)
local ct1=og:FilterCount(Card.IsCode,nil,code)
if ct~=ct1-1 then
return false,ct>ct1-1
end
end
end end
local cg=og:Clone() return true
cg:Sub(g)
local res=cg:CheckSubGroup(s.namecheck,2,2)
return not res, not c:IsAbleToRemove()
end end
end end
function s.finishcon(og) function s.finishcon(ct,og)
return function(g,e,tp,mg) return function(g,e,tp,mg)
for tc in aux.Next(og) do local cg=og:Filter(aux.TRUE,g)
local codes={tc:GetCode()} local dnct=g:GetClassCount(Card.GetCode)
for _,code in ipairs(codes) do local cdnct=cg:GetClassCount(Card.GetCode)
local ct=g:FilterCount(Card.IsCode,nil,code) return dnct==ct and cdnct==ct
local ct1=og:FilterCount(Card.IsCode,nil,code)
if ct~=ct1-1 then
return false
end
end
end
local cg=og:Clone()
cg:Sub(g)
local res=cg:CheckSubGroup(s.namecheck,2,2)
return not res
end end
end end
function s.hasSameCodeButNotOtherOnes(c,code)
local codes={c:GetCode()}
if #codes>1 then return false end
return codes[1]==code
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if not (e:IsCostChecked() if not (e:IsCostChecked()
...@@ -108,20 +90,62 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -108,20 +90,62 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
return false return false
end end
local gy=Duel.GetGY(1-tp) local gy=Duel.GetGY(1-tp)
local g=gy:Filter(s.hascopy,nil,gy) local g=gy:Filter(s.rmfilter,nil,gy)
if #g==0 then return false end local ct=#g
return aux.SelectUnselectGroup(g,e,tp,1,#g-1,s.gcheck(g),0) if ct<=0 then return false end
local tc=g:GetFirst()
while tc do
local sg=g:Filter(s.hasSameCodeButNotOtherOnes,nil,tc:GetCode())
if not sg:IsContains(tc) then
sg:AddCard(tc)
end
local nrg=sg:Filter(aux.NOT(Card.IsAbleToRemove),nil)
if #nrg>0 then
if #nrg>=2 then
return false
end
g:Sub(nrg)
tc=g:GetFirst()
else
tc=g:GetNext()
end
end
return true
end end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local b1=true
local gy=Duel.GetGY(1-tp) local gy=Duel.GetGY(1-tp)
local g=gy:Filter(s.hascopy,nil,gy) local g=gy:Filter(s.rmfilter,nil,gy)
if #g>0 then local ct=#g
local rg=aux.SelectUnselectGroup(g,e,tp,1,#g-1,s.gcheck(g),1,tp,HINTMSG_REMOVE,s.finishcon(g)) if ct<=0 then b1=false end
if b1 then
local tc=g:GetFirst()
while tc do
local sg=g:Filter(s.hasSameCodeButNotOtherOnes,nil,tc:GetCode())
if not sg:IsContains(tc) then
sg:AddCard(tc)
end
local nrg=sg:Filter(aux.NOT(Card.IsAbleToRemove),nil)
if #nrg>0 then
if #nrg>=2 then
b1=false
break
end
g:Sub(nrg)
tc=g:GetFirst()
else
tc=g:GetNext()
end
end
end
if b1 and #g>0 then
local dnct=g:GetClassCount(Card.GetCode)
local rescon=s.rescon(g)
local rg=aux.SelectUnselectGroup(g,e,tp,ct-dnct,ct-1,rescon,1,tp,HINTMSG_REMOVE,s.finishcon(dnct,g))
if #rg>0 then if #rg>0 then
Duel.HintSelection(rg)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end end
end end
...@@ -140,7 +164,7 @@ function s.damcon(e) ...@@ -140,7 +164,7 @@ function s.damcon(e)
end end
--E6 --E6
function s.sgcheck(g) function s.srescon(g)
local c1,c2=g:GetFirst(),g:GetNext() local c1,c2=g:GetFirst(),g:GetNext()
return c1:IsCode(c2:GetCode()) return c1:IsCode(c2:GetCode())
end end
...@@ -148,5 +172,5 @@ function s.sdcon(e) ...@@ -148,5 +172,5 @@ function s.sdcon(e)
if not aux.ProcSummonedCond(e) then return false end if not aux.ProcSummonedCond(e) then return false end
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local sg=Duel.GetGY(tp) local sg=Duel.GetGY(tp)
return not sg:CheckSubGroup(s.sgcheck,2,2) return not sg:CheckSubGroup(s.srescon,2,2)
end end
\ No newline at end of file
...@@ -101,7 +101,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,7 +101,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
function s.aclimit(e,re,tp) function s.aclimit(e,re,tp)
local rc=re:GetHandler() local rc=re:GetHandler()
return not c.MoJin==true return not rc.MoJin==true
end end
function s.retop(e,tp,eg,ep,ev,re,r,rp) function s.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject() local g=e:GetLabelObject()
......
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