Commit 0ac577c5 authored by Tachibana's avatar Tachibana

eme

parent c497789a
Pipeline #8495 passed with stages
in 33 minutes and 2 seconds
......@@ -66,7 +66,7 @@ end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.disop(e,tp,tp,eg,ep,ev,re,r,rp)
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
......
......@@ -5,11 +5,11 @@ function c33701323.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c33701323.lkcon)
e1:SetOperation(c33701323.lkop)
e1:SetValue(SUMMON_TYPE_LINK)
e1:SetCondition(c33701323.spcon)
e1:SetOperation(c33701323.spop)
c:RegisterEffect(e1)
--cannot be material
local e2=Effect.CreateEffect(c)
......@@ -28,17 +28,76 @@ function c33701323.initial_effect(c)
e5:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e5)
end
function c33701323.spfil(c)
return c:IsCanBeLinkMaterial(nil) and (c:IsType(TYPE_SPELL+TYPE_TRAP) or c:IsRace(RACE_CYBERSE))
function c33701323.lkfilter(c,lc,tp)
local flag=c:IsFaceup() and c:IsCanBeLinkMaterial(lc)
if c:IsType(TYPE_MONSTER) then
return flag and c:IsRace(RACE_CYBERSE)
else
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
end
function c33701323.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
return Duel.IsExistingMatchingCard(c33701323.spfil,tp,LOCATION_ONFIELD,0,2,nil)
function c33701323.lvfilter(c)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then
return 1+0x10000*c:GetLink()
else
return 1
end
end
function c33701323.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c33701323.spfil,tp,LOCATION_ONFIELD,0,2,2,nil)
e:GetHandler():SetMaterial(g)
Duel.SendtoGrave(g,REASON_LINK+REASON_MATERIAL)
function c33701323.lcheck(tp,sg,lc,minc,ct)
return ct>=minc and sg:CheckWithSumEqual(c33701323.lvfilter,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
end
function c33701323.lkchenk(c,tp,sg,mg,lc,ct,minc,maxc)
sg:AddCard(c)
ct=ct+1
local res=c33701323.lcheck(tp,sg,lc,minc,ct) or (ct<maxc and mg:IsExists(c33701323.lkchenk,1,sg,tp,sg,mg,lc,ct,minc,maxc))
sg:RemoveCard(c)
ct=ct-1
return res
end
function c33701323.lkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c33701323.lkfilter,tp,LOCATION_ONFIELD,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
local pc=pe:GetHandler()
if not mg:IsContains(pc) then return false end
sg:AddCard(pc)
end
local ct=sg:GetCount()
local minc=2
local maxc=2
if ct>maxc then return false end
return c33701323.lcheck(tp,sg,c,minc,ct) or mg:IsExists(c33701323.lkchenk,1,nil,tp,sg,mg,c,ct,minc,maxc)
end
--
function c33701323.lkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c33701323.lkfilter,tp,LOCATION_ONFIELD,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
sg:AddCard(pe:GetHandler())
end
local ct=sg:GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
sg:Select(tp,ct,ct,nil)
local minc=2
local maxc=2
for i=ct,maxc-1 do
local cg=mg:Filter(c33701323.lkchenk,sg,tp,sg,mg,c,i,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if c33701323.lcheck(tp,sg,c,minc,i) then
if not Duel.SelectYesNo(tp,210) then break end
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
end
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK)
end
function c33701323.synlimit(e,c)
if not c then return false end
......
......@@ -89,7 +89,7 @@ function c9330003.actop(e,tp,eg,ep,ev,re,r,rp)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and tc:IsLocation(LOCATION_REMOVED)
and tc:IsSSetable()
and Duel.SelectYesNo(tp,aux.Stringid(9330004,1)) then
and Duel.SelectYesNo(tp,aux.Stringid(9330003,1)) then
Duel.BreakEffect()
Duel.SSet(tp,tc)
end
......
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