Commit f9858446 authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent 0e0a855f
No preview for this file type
......@@ -12,10 +12,11 @@ function c50223100.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c50223100.spcon)
e2:SetOperation(c50223100.spop)
e2:SetCondition(c50223100.scon)
e2:SetTarget(c50223100.stg)
e2:SetOperation(c50223100.sop)
c:RegisterEffect(e2)
--loselp
local e3=Effect.CreateEffect(c)
......@@ -37,13 +38,27 @@ function c50223100.initial_effect(c)
e7:SetOperation(c50223100.tdop)
c:RegisterEffect(e7)
end
function c50223100.spcon(e,c)
function c50223100.spfilter(c,tp)
return c:IsCode(50218102)
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c50223100.scon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(REASON_COST,c:GetControler(),Card.IsCode,1,nil,50218102)
local tp=c:GetControler()
return Duel.CheckReleaseGroupEx(tp,c50223100.spfilter,1,REASON_SPSUMMON,false,nil,tp)
end
function c50223100.stg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetReleaseGroup(tp,false,REASON_SPSUMMON):Filter(c50223100.spfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c50223100.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(REASON_COST,tp,Card.IsCode,1,1,nil,50218102)
Duel.Release(g,REASON_COST)
function c50223100.sop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON)
end
function c50223100.lpcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler())
......
......@@ -3476,570 +3476,6 @@ function cm.GCSpiritNop(e,tp,eg,ep,ev,re,r,rp)
Duel.Readjust()
Duel.RaiseSingleEvent(c,c:GetOriginalCode(),re,r,rp,ep,ev)
end
function cm.NecroceanSynchro(c)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(1164)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(aux.SynMixCondition(aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99,nil))
e1:SetTarget(cm.Necroceansyntg(aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99,nil))
e1:SetOperation(cm.Necroceansynop(aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99,nil))
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(0xff)
e2:SetOperation(cm.NecroceanSLevel)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+53752000)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ADJUST)
e3:SetRange(LOCATION_EXTRA)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetLabelObject(e1)
e3:SetOperation(cm.LilyLind)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(53752000)
e4:SetRange(LOCATION_EXTRA)
c:RegisterEffect(e4)
end
function cm.LilyLind(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local se=e:GetLabelObject()
se:SetLabel(0)
c:RegisterFlagEffect(53752000,0,0,0)
local re1={c:IsHasEffect(EFFECT_CANNOT_SPECIAL_SUMMON)}
local re2={c:IsHasEffect(EFFECT_SPSUMMON_COST)}
local re5={Duel.IsPlayerAffectedByEffect(tp,EFFECT_SPSUMMON_COUNT_LIMIT)}
for _,te1 in pairs(re1) do
local con=te1:GetCondition()
if not con then con=aux.TRUE end
te1:SetCondition(cm.Necroceanchcon(con))
se:SetLabel(1)
end
for _,te2 in pairs(re2) do
local cost=te2:GetCost()
if cost and not cost(te2,c,tp) then
if te2:GetType()==EFFECT_TYPE_SINGLE then
local con=te2:GetCondition()
if not con then con=aux.TRUE end
te2:SetCondition(cm.Necroceanchcon(con))
se:SetLabel(1)
end
if te2:GetType()==EFFECT_TYPE_FIELD then
local tg=te2:GetTarget()
if not tg then
te2:SetTarget(cm.Necroceanchtg(aux.TRUE))
se:SetLabel(1)
elseif tg(te2,c,tp) then
te2:SetTarget(cm.Necroceanchtg(tg))
se:SetLabel(1)
end
end
end
end
for _,te5 in pairs(re5) do
local val=te5:GetValue()
local _,a=te5:GetLabel()
if a==0 then te5:SetLabel(0,val) end
local sp=Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)
local _,b=te5:GetLabel()
if sp==0 then
te5:SetLabel(1,b)
te5:SetValue(b)
end
val=te5:GetValue()
local l,_=te5:GetLabel()
if l==0 then te5:SetLabel(sp+1,b) else
local n=sp-l+1
if n==val then
te5:SetValue(val+1)
local e1=te5:Clone()
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
local loc=te5:GetRange()
if loc~=0 then
e1:SetLabelObject(te5)
te5:GetHandler():RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetLabel(loc,b)
e2:SetLabelObject(e1)
e2:SetOperation(cm.Necroceanreset1)
Duel.RegisterEffect(e2,tp)
else Duel.RegisterEffect(e1,te5:GetOwnerPlayer()) end
end
end
end
local re3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SPECIAL_SUMMON)}
local re4={Duel.IsPlayerAffectedByEffect(tp,EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)}
for _,v in pairs(re4) do table.insert(re3,v) end
for _,te3 in pairs(re3) do
local tg=te3:GetTarget()
if not tg then
te3:SetTarget(cm.Necroceanchtg3(aux.TRUE))
se:SetLabel(1)
elseif tg(te3,c,tp,SUMMON_TYPE_SYNCHRO,POS_FACEUP,tp,se) then
te3:SetTarget(cm.Necroceanchtg3(tg))
se:SetLabel(1)
end
end
c:ResetFlagEffect(53752000)
end
function cm.Necroceanchcon(_con)
return function(e,...)
local x=e:GetHandler()
if x:IsHasEffect(53752000) and Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,x:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and x:GetFlagEffect(53752000)<1 then return false end
return _con(e,...)
end
end
function cm.Necroceanreset1(e,tp,eg,ep,ev,re,r,rp)
local x=e:GetLabelObject():GetHandler()
local te=e:GetLabelObject():GetLabelObject()
local loc,v=e:GetLabel()
if x:GetLocation()&loc==0 then
te:SetLabel(0,v)
te:SetValue(v)
e:GetLabelObject():Reset()
e:Reset()
end
end
function cm.Necroceanchtg3(_tg)
return function(e,c,sump,sumtype,sumpos,targetp,se)
if c:IsHasEffect(53752000) and se:GetHandler()==c and Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,c:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and c:GetFlagEffect(53752000)<1 then return false end
return _tg(e,c,sump,sumtype,sumpos,targetp,se)
end
end
function cm.Necroceanchtg(_tg)
return function(e,c,...)
if c:IsHasEffect(53752000) and Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,c:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and c:GetFlagEffect(53752000)<1 then return false end
return _tg(e,c,...)
end
end
function cm.NecroceanSLevel(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,53752000)>0 then return end
Duel.RegisterFlagEffect(0,53752000,0,0,0)
func1=Card.IsCanBeSynchroMaterial
Card.IsCanBeSynchroMaterial=function(tc,sc,...)
if sc and sc.NecroceanSyn then
if tc:IsLocation(LOCATION_GRAVE) and tc:IsLevel(0) and tc:GetControler()==sc:GetControler() and not sc.NecroceanKythra then return false end
local res=Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,sc:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil)
if tc:IsLocation(LOCATION_ONFIELD) and tc:GetControler()~=sc:GetControler() and not tc:IsHasEffect(EFFECT_SYNCHRO_MATERIAL) and not res then return false end
if not sc.GuyWildCard then
if not (tc:IsAbleToRemove() or res) then return false end
if tc:IsStatus(STATUS_FORBIDDEN) then return false end
if tc:IsHasEffect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) then return false end
end
return true
else
return func1(tc,sc,...)
end
end
func2=Card.GetSynchroLevel
Card.GetSynchroLevel=function(tc,sc)
if sc and sc.NecroceanSyn and ((tc:IsLocation(LOCATION_GRAVE) and tc:IsLevel(0) and (sc.GuyWildCard or sc.NecroceanKythra or tc:GetControler()~=sc:GetControler())) or (Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,sc:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and tc:IsLocation(LOCATION_ONFIELD) and tc:GetControler()~=sc:GetControler() and (tc:IsFacedown() or tc:IsLevel(0)))) then
return 1
else
return func2(tc,sc)
end
end
func3=aux.GetSynMaterials
aux.GetSynMaterials=function(tp,sc)
local exg=Group.CreateGroup()
if sc and sc.NecroceanSyn then
local mg3=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
if not mg3:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER) then
exg=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,sc)
end
if Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,sc:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) then
local exg2=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,0,LOCATION_ONFIELD,nil,sc)
exg:Merge(exg2)
end
end
return Group.__add(func3(tp,sc),exg)
end
func4=aux.SynMixCheckGoal
aux.SynMixCheckGoal=function(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if ct<minc then return false end
local g=sg:Clone()
g:Merge(sg1)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if gc and not gc(g) then return false end
if smat and not g:IsContains(smat) then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
if not (g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) and syncard and syncard.NecroceanSyn) then
if not g:CheckWithSumEqual(Card.GetSynchroLevel,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard) and (not g:IsExists(Card.IsHasEffect,1,nil,89818984) or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard)) then return false end
end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
end
--[[function cm.Necroceansyncon(f1,f2,f3,f4,minc,maxc,gc,check,wild_check)
return function(e,c,smat,mg1,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c,e,check)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(cm.NecroceanSynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk)
end
end
function cm.Necroceansyncon2(...)--deserted
local f1=aux.GetSynMaterials
local f2=aux.SynMixFilter1
aux.GetSynMaterials=cm.NecroceanGetSynMaterials
aux.SynMixFilter1=cm.NecroceanSynMixFilter1
local res=aux.SynMixCondition(aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99,nil)(...)
aux.GetSynMaterials=f1
aux.SynMixFilter1=f2
return res
end--]]
function cm.Necroceansyntg(f1,f2,f3,f4,minc,maxc,gc)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
local minc=minc
local maxc=maxc
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local res=false
while true do
local g=Group.CreateGroup()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=aux.GetSynMaterials(tp,c,e)
end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c1=mg:FilterSelect(tp,aux.SynMixFilter1,1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk):GetFirst()
g:AddCard(c1)
if f2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c2=mg:FilterSelect(tp,aux.SynMixFilter2,1,1,c1,f2,f3,f4,minc,maxc,c,mg,smat,c1,gc,mgchk):GetFirst()
g:AddCard(c2)
if f3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c3=mg:FilterSelect(tp,aux.SynMixFilter3,1,1,Group.FromCards(c1,c2),f3,f4,minc,maxc,c,mg,smat,c1,c2,gc,mgchk):GetFirst()
g:AddCard(c3)
end
end
local g4=Group.CreateGroup()
for i=0,maxc-1 do
local mg2=mg:Clone()
if f4 then
mg2=mg2:Filter(f4,g,c)
else
mg2:Sub(g)
end
local cg=mg2:Filter(aux.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,gc,mgchk)
if cg:GetCount()==0 then break end
local minct=1
if aux.SynMixCheckGoal(tp,g4,minc,i,c,g,smat,gc,mgchk) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tg=cg:Select(tp,minct,1,nil)
if tg:GetCount()==0 then break end
g4:Merge(tg)
end
g:Merge(g4)
if g:GetCount()>0 then
if not g:CheckWithSumEqual(Card.GetSynchroLevel,c:GetLevel(),g:GetCount(),g:GetCount(),c) and (not g:IsExists(Card.IsHasEffect,1,nil,89818984) or not g:CheckWithSumEqual(aux.GetSynchroLevelFlowerCardian,c:GetLevel(),g:GetCount(),g:GetCount(),c)) then
if not Duel.SelectYesNo(tp,aux.Stringid(53702600,5)) then break end
else
g:KeepAlive()
e:SetLabelObject(g)
res=true
break
end
else break end
end
return res
end
end
--[[function cm.Necroceansyntg2(...)-
local f1=aux.GetSynMaterials
local f2=aux.SynMixFilter1
local f3=aux.SynMixFilter2
local f4=aux.SynMixFilter3
local f5=aux.SynMixFilter4
local f6=aux.SynMixCheck
local f7=aux.SynMixCheckRecursive
local f8=aux.SynMixCheckGoal
aux.GetSynMaterials=cm.NecroceanGetSynMaterials
aux.SynMixFilter1=cm.NecroceanSynMixFilter1
aux.SynMixFilter2=cm.NecroceanSynMixFilter2
aux.SynMixFilter3=cm.NecroceanSynMixFilter3
aux.SynMixFilter4=cm.NecroceanSynMixFilter4
aux.SynMixCheck=cm.NecroceanSynMixCheck
aux.SynMixCheckRecursive=cm.NecroceanSynMixCheckRecursive
aux.SynMixCheckGoal=cm.NecroceanSynMixCheckGoal
local res=aux.SynMixTarget(aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99,nil)(...)
aux.GetSynMaterials=f1
aux.SynMixFilter1=f2
aux.SynMixFilter2=f3
aux.SynMixFilter3=f4
aux.SynMixFilter4=f5
aux.SynMixCheck=f6
aux.SynMixCheckRecursive=f7
aux.SynMixCheckGoal=f8
return res
end--]]
function cm.Necroceansynop(f1,f2,f3,f4,minct,maxc,gc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
local rg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local pos,rsn=POS_FACEUP,0
if c.GuyWildCard then
pos=POS_FACEDOWN
rsn=REASON_RULE
end
local res=false
if g:IsExists(function(c,tp)return c:IsControler(1-tp) and c:IsLocation(LOCATION_ONFIELD) and not c:IsHasEffect(EFFECT_SYNCHRO_MATERIAL)end,1,nil,tp) then res=true end
if g:IsExists(aux.NOT(Card.IsAbleToRemove),1,nil) then
rsn=REASON_RULE
res=true
end
Duel.Remove(rg,pos,REASON_MATERIAL+REASON_SYNCHRO+rsn)
Duel.SendtoGrave(Group.__sub(g,rg),REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
if e:GetLabel()==1 or res then
local g=Duel.SelectMatchingCard(tp,function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then Duel.SendtoGrave(g,REASON_EFFECT) end
end
end
end
--[[function cm.Necroceansfilter(c,syncard,e,tp,check,wild_check)
if not wild_check then
if c:IsHasEffect(EFFECT_CANNOT_REMOVE) then return false end
local re1={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_REMOVE)}
local res=true
for _,v1 in ipairs(re1) do
local tg=v1:GetTarget()
if not tg or tg(v1,c,tp,REASON_MATERIAL+REASON_SYNCHRO,e) then res=false end
end
if not res then return false end
end
local flag=c:IsLevel(0)
if c:IsControler(tp) and flag and not check then return false end
if not wild_check then
local re2={c:IsHasEffect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)}
for _,v2 in ipairs(re2) do
local val=v2:GetValue()
if aux.GetValueType(val)=="number" then flag=false elseif val(v2,c) then flag=false end
end
end
return c:IsCanBeSynchroMaterial(syncard) or flag
end
function cm.NecroceanGetSynMaterials(tp,syncard,e,check,wild_check)
local mg=Duel.GetMatchingGroup(aux.SynMaterialFilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,syncard)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND,0,nil,syncard)
if mg2:GetCount()>0 then mg:Merge(mg2) end
end
local mg3=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
if not mg3:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER) then
local exg=Duel.GetMatchingGroup(cm.Necroceansfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,syncard,e,tp,check,wild_check)
if exg:GetCount()>0 then mg:Merge(exg) end
end
return mg
end
function cm.NecroceanSynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk)
return (not f1 or f1(c,syncard)) and mg:IsExists(cm.NecroceanSynMixFilter2,1,c,f2,f3,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk)
end
function cm.NecroceanSynMixFilter2(c,f2,f3,f4,minc,maxc,syncard,mg,smat,c1,gc,mgchk)
if f2 then
return f2(c,syncard,c1)
and (mg:IsExists(cm.NecroceanSynMixFilter3,1,Group.FromCards(c1,c),f3,f4,minc,maxc,syncard,mg,smat,c1,c,gc,mgchk)
or minc==0 and cm.NecroceanSynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,nil,nil,gc,mgchk))
else
return mg:IsExists(cm.NecroceanSynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk)
end
end
function cm.NecroceanSynMixFilter3(c,f3,f4,minc,maxc,syncard,mg,smat,c1,c2,gc,mgchk)
if f3 then
return f3(c,syncard,c1,c2)
and (mg:IsExists(cm.NecroceanSynMixFilter4,1,Group.FromCards(c1,c2,c),f4,minc,maxc,syncard,mg,smat,c1,c2,c,gc,mgchk)
or minc==0 and cm.NecroceanSynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,c2,nil,gc,mgchk))
else
return mg:IsExists(cm.NecroceanSynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk)
end
end
function cm.NecroceanSynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk)
if f4 and not f4(c,syncard,c1,c2,c3) then return false end
local sg=Group.FromCards(c1,c)
sg:AddCard(c1)
if c2 then sg:AddCard(c2) end
if c3 then sg:AddCard(c3) end
local mg=mg1:Clone()
if f4 then
mg=mg:Filter(f4,sg,syncard)
else
mg:Sub(sg)
end
return cm.NecroceanSynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk)
end
function cm.NecroceanSynMixCheck(mg,sg1,minc,maxc,syncard,smat,gc,mgchk)
local tp=syncard:GetControler()
local sg=Group.CreateGroup()
if minc<=0 and cm.NecroceanSynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,gc,mgchk) then return true end
if maxc==0 then return false end
return mg:IsExists(cm.NecroceanSynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,gc,mgchk)
end
function cm.NecroceanSynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)
sg:AddCard(c)
ct=ct+1
local res=cm.NecroceanSynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
or (ct<maxc and mg:IsExists(cm.NecroceanSynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk))
sg:RemoveCard(c)
ct=ct-1
return res
end
function cm.NecroceanGetSynchroLevel(c,syncard,wild_check)
local slv=c:GetSynchroLevel(syncard)
if c:IsLocation(LOCATION_GRAVE) and c:IsLevel(0) then slv=1 end
return slv
end
function cm.NecroceanGetSynchroLevelFlowerCardian(c,syncard)
local slv=2
--if c:IsSynchroType(TYPE_SPELL+TYPE_TRAP) and c:IsLocation(LOCATION_GRAVE) then slv=1 end
return slv
end
function cm.NecroceanSynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if ct<minc then return false end
local g=sg:Clone()
g:Merge(sg1)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end
if gc and not gc(g) then return false end
if smat and not g:IsContains(smat) then return false end
if not Auxiliary.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hct=hg:GetCount()
if hct>0 and not mgchk then
local found=false
for c in aux.Next(g) do
local he,hf,hmin,hmax=c:GetHandSynchro()
if he then
found=true
if hf and hg:IsExists(aux.SynLimitFilter,1,c,hf,he,syncard) then return false end
if (hmin and hct<hmin) or (hmax and hct>hmax) then return false end
end
end
if not found then return false end
end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,syncard) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end--]]
--[[function cm.NecroceanSynchro(c)
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,aux.Tuner(nil),aux.NonTuner(nil),nil,nil,0,99)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e5:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e5:SetRange(0xff)
e5:SetOperation(cm.NecroceanSLevel)
e5:SetCountLimit(1,EFFECT_COUNT_CODE_DUEL+53752000)
c:RegisterEffect(e5)
end
function cm.NecroceanSLevel(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,53752000)>0 then return end
Duel.RegisterFlagEffect(0,53752000,0,0,0)
func1=Card.IsCanBeSynchroMaterial
Card.IsCanBeSynchroMaterial=function(tc,sc,...)
if tc:IsLocation(LOCATION_GRAVE) and sc and sc.NecroceanSyn and sc.GuyWildCard then
if sc and tc:IsLocation(LOCATION_MZONE) and tc:GetControler()~=sc:GetControler() and not tc:IsHasEffect(EFFECT_SYNCHRO_MATERIAL) then return false end
return true
else
return func1(tc,sc,...)
end
end
func2=Card.GetSynchroLevel
Card.GetSynchroLevel=function(tc,sc)
if sc and sc.NecroceanSyn and sc.GuyWildCard and tc:IsLocation(LOCATION_GRAVE) and tc:IsLevel(0) then
return 1
else
return func2(tc,sc)
end
end
func3=aux.GetSynMaterials
aux.GetSynMaterials=function(tp,sc)
local exg=Group.CreateGroup()
if sc and sc.NecroceanSyn and sc.GuyWildCard then
local mg3=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
if not mg3:IsExists(aux.NOT(Card.IsType),1,nil,TYPE_TUNER) then
exg=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,sc)
end
end
return Group.__add(func3(tp,sc),exg)
end
end--]]
function Intersection(t1, t2)
local ret = {}
for k, v1 in pairs(t1) do
......@@ -7887,129 +7323,185 @@ function cm.Whitkinsefilter(att)
return te:GetOwnerPlayer()~=c:GetControler() and te:IsActiveType(TYPE_MONSTER) and te:GetHandler():IsAttribute(att)
end
end
-----------
--[[ local dam=tc:GetAttack()
local seta={tc:IsHasEffect(EFFECT_SET_BATTLE_ATTACK)}
if #seta>0 then
seta=seta[#seta]
dam=seta:GetValue()
if aux.GetValueType(dam)=="function" then val=val(dam) end
--written by purplenightfall
--subgroup optimization
function cm.SelectSubGroup(g,tp,f,cancelable,min,max,...)
--classif: function to classify cards, e.g. function(c,tc) return c:GetLevel()==tc:GetLevel() end
--sortif: function of subgroup search order, high to low. e.g. Card.GetLevel
--passf: cards that do not require check, e.g. function(c) return c:IsLevel(1) end
--goalstop: do you want to backtrack after reaching the goal? true/false
--check: do you want to return true after reaching the goal firstly? true/false
local classif,sortf,passf,goalstop,check,params1,params2=table.unpack(cm.SubGroupParams)
min=min or 1
max=max or #g
local sg=Group.CreateGroup()
local fg=Duel.GrabSelectedCard()
if #fg>max or min>max or #(g+fg)<min then return nil end
for tc in aux.Next(fg) do
fg:SelectUnselect(sg,tp,false,false,min,max)
end
sg:Merge(fg)
local mg=g-sg
local iisg,tmp,stop,iter,ctab,rtab,gtab
--main check
local finish=(#sg>=min and #sg<=max and f(sg,...))
while #sg<max do
mg=g-sg
iisg=sg:Clone()
if passf then
aux.SubGroupCaptured=mg:Filter(passf,nil)
else
aux.SubGroupCaptured=Group.CreateGroup()
end
ctab,rtab,gtab={},{},{1}
for tc in aux.Next(mg) do
ctab[#ctab+1]=tc
end
--high to low
if sortf then
for i=1,#ctab-1 do
for j=1,#ctab-1-i do
if sortf(ctab[j],table.unpack(params2))<sortf(ctab[j+1],table.unpack(params2)) then
tmp=ctab[j]
ctab[j]=ctab[j+1]
ctab[j+1]=tmp
end
end
end
end
--classify
if classif then
--make similar cards adjacent
for i=1,#ctab-2 do
for j=i+2,#ctab do
if classif(ctab[i],ctab[j],table.unpack(params1)) then
tmp=ctab[j]
ctab[j]=ctab[i+1]
ctab[i+1]=tmp
end
end
local le={tc:IsHasEffect(EFFECT_DEFENSE_ATTACK)}
local val=0
for _,v in pairs(le) do
val=v:GetValue()
if aux.GetValueType(val)=="function" then val=val(e) end
end
--rtab[i]: what category does the i-th card belong to
--gtab[i]: What is the first card's number in the i-th category
for i=1,#ctab-1 do
rtab[i]=#gtab
if not classif(ctab[i],ctab[i+1],table.unpack(params1)) then
gtab[#gtab+1]=i+1
end
if val==1 then
local setd={tc:IsHasEffect(EFFECT_SET_BATTLE_DEFENSE)}
if #setd>0 then
setd=setd[#setd]
dam=setd:GetValue()
if aux.GetValueType(dam)=="function" then val=val(dam) end
end
--iter record all cards' number in sg
iter={1}
sg:AddCard(ctab[1])
while #sg>#iisg and #aux.SubGroupCaptured<#mg do
stop=false
--prune if too much cards
if aux.GCheckAdditional and not aux.GCheckAdditional(sg,c,g,f,min,max,...) then
stop=true
--skip check if no new cards
elseif #(sg-iisg-aux.SubGroupCaptured)>0 and #sg>=min and #sg<=max and f(sg,...) then
for sc in aux.Next(sg-iisg) do
if check then return true end
aux.SubGroupCaptured:Merge(mg:Filter(classif,nil,sc,table.unpack(params1)))
end
stop=goalstop
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(id)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge0=Effect.GlobalEffect()
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetCode(EVENT_ADJUST)
ge0:SetLabelObject(sg)
ge0:SetOperation(s.geop)
Duel.RegisterEffect(ge0,0)
s.OAe={}
end
end
function s.geop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(function(c)return c:IsOriginalCodeRule(46173679) and c:GetActivateEffect()end,0,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,nil)
for tc in aux.Next(g) do
local le={tc:GetActivateEffect()}
for _,v in pairs(le) do
if v:GetRange()&0x10a~=0 and not SNNM.IsInTable(v,s.OAe) then
table.insert(s.OAe,v)
local e1=v:Clone()
e1:SetRange(LOCATION_DECK+LOCATION_GRAVE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
tc:RegisterEffect(e1,true)
local e2=SNNM.Act(tc,e1)
e2:SetRange(LOCATION_DECK+LOCATION_GRAVE)
e2:SetCost(s.costchk)
e2:SetOperation(s.costop2)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(tc)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_HAND)
e3:SetLabelObject(v)
e3:SetTargetRange(1,0)
e3:SetTarget(s.costtg)
e3:SetOperation(s.costop1)
tc:RegisterEffect(e3,true)
end
end
end
end
function s.costchk(e,te,tp)
return Duel.IsExistingMatchingCard(Card.IsHasEffect,tp,0xff,0,1,nil,id)
end
function s.costtg(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject() and Duel.IsExistingMatchingCard(Card.IsHasEffect,tp,0xff,0,nil,id)
end
function s.costop1(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,aux.Stringid(id,0)) then return end
s.costop(e,tp,eg,ep,ev,re,r,rp)
end
function s.costop2(e,tp,eg,ep,ev,re,r,rp)
s.costop(e,tp,eg,ep,ev,re,r,rp)
SNNM.BaseActOp(e,tp,eg,ep,ev,re,r,rp)
end
function s.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
local tc=Duel.SelectMatchingCard(tp,Card.IsHasEffect,tp,0xff,0,1,1,nil,id):GetFirst()
Duel.ConfirmCards(1-tp,tc)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return ev==ev0 end)
e1:SetOperation(s.op)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
tc:CreateEffectRelation(e1)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not tc:IsRelateToEffect(e) then return end
local le={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SUMMON)}
for _,v in pairs(le) do
if v:GetOwner()==e:GetOwner() then
local tg=v:GetTarget() or aux.TRUE
if tg(v,tc,tp,SUMMON_TYPE_ADVANCE,POS_FACEUP,tp,e) then v:SetTarget(s.chtg(tg,tc)) end
end
end
if not (tc:IsAbleToHand() or tc:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)) or not Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,tc,REASON_EFFECT) or not Duel.SelectYesNo(tp,aux.Stringid(id,2)) then return end
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,tc)==0 then return end
if not tc:IsLocation(LOCATION_HAND) then Duel.SendtoHand(tc,nil,REASON_EFFECT) else
local s1=tc:IsSummonable(true,nil,1)
local s2=tc:IsMSetable(true,nil,1)
if (s1 and s2 and Duel.SelectPosition(tp,tc,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
Duel.Summon(tp,tc,true,nil,1)
if #sg>=max then stop=true end
local code=iter[#iter]
--last card isn't in the last category
if code and code<gtab[#gtab] then
if stop then
--backtrack and add 1 card from next category
iter[#iter]=gtab[rtab[code]+1]
sg:RemoveCard(ctab[code])
sg:AddCard(ctab[(iter[#iter])])
else
--continue searching forward
iter[#iter+1]=code+1
sg:AddCard(ctab[code+1])
end
--last card is in the last category
elseif code then
if stop or code>=#ctab then
--clear all cards in the last category
while #iter>0 and iter[#iter]>=gtab[#gtab] do
sg:RemoveCard(ctab[(iter[#iter])])
iter[#iter]=nil
end
--backtrack and add 1 card from next category
local code2=iter[#iter]
if code2 then
iter[#iter]=gtab[rtab[code2]+1]
sg:RemoveCard(ctab[code2])
sg:AddCard(ctab[(iter[#iter])])
end
else
--continue searching forward
iter[#iter+1]=code+1
sg:AddCard(ctab[code+1])
end
end
end
--classification is essential for efficiency, and this part is only for backup
else
Duel.MSet(tp,tc,true,nil,1)
iter={1}
sg:AddCard(ctab[1])
while #sg>#iisg and #aux.SubGroupCaptured<#mg do
stop=false
if aux.GCheckAdditional and not aux.GCheckAdditional(sg,c,g,f,min,max,...) then
stop=true
elseif #(sg-iisg-aux.SubGroupCaptured)>0 and #sg>=min and #sg<=max and f(sg,...) then
for sc in aux.Next(sg-iisg) do
if check then return true end
aux.SubGroupCaptured:AddCard(sc) --Merge(mg:Filter(class,nil,sc))
end
stop=goalstop
end
if #sg>=max then stop=true end
local code=iter[#iter]
if code<#ctab then
if stop then
iter[#iter]=nil
sg:RemoveCard(ctab[code])
end
iter[#iter+1]=code+1
sg:AddCard(ctab[code+1])
else
local code2=iter[#iter-1]
iter[#iter]=nil
sg:RemoveCard(ctab[code])
if code2 and code2>0 then
iter[#iter]=code2+1
sg:RemoveCard(ctab[code2])
sg:AddCard(ctab[code2+1])
end
end
end
end
--finish searching
sg=iisg
local cg=aux.SubGroupCaptured:Clone()
aux.SubGroupCaptured:Clear()
cg:Sub(sg)
finish=(#sg>=min and #sg<=max and f(sg,...))
if #cg==0 then break end
local cancel=not finish and cancelable
local tc=cg:SelectUnselect(sg,tp,finish,cancel,min,max)
if not tc then break end
if not fg:IsContains(tc) then
if not sg:IsContains(tc) then
sg:AddCard(tc)
if #sg==max then finish=true end
else
sg:RemoveCard(tc)
end
elseif cancelable then
return nil
end
end
if finish then
return sg
else
return nil
end
end
function s.chtg(_tg,tc)
return function(e,c,...)
return _tg(e,c,...) and c~=tc
end
end--]]
\ No newline at end of file
local m=53752002
local cm=_G["c"..m]
cm.name="棘轮之基特拉"
cm.NecroceanSyn=true
cm.NecroceanKythra=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
if Necrocean_Database then return end
Necrocean_Database=true
if Necrocean then return end
Necrocean=Necrocean or {}
function Necrocean.set(code,setcode,rkflag)
if not _G["c"..code] then _G["c"..code]={}
setmetatable(_G["c"..code],Card)
_G["c"..code].__index=_G["c"..code]
end
return code,_G["c"..code]
end
local id,s=Necrocean.set(53752002)
Necrocean=s
function Necrocean.AddSynchroMixProcedure(c)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(1164)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(s.SynMixCondition)
e1:SetTarget(s.SynMixTarget)
e1:SetOperation(s.SynMixOperation)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_EXTRA)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetLabelObject(e1)
e2:SetOperation(s.LilyLind)
c:RegisterEffect(e2)
end
function s.LilyLind(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local se=e:GetLabelObject()
se:SetLabel(0)
c:RegisterFlagEffect(53752000,0,0,0)
local re1={c:IsHasEffect(EFFECT_CANNOT_SPECIAL_SUMMON)}
local re2={c:IsHasEffect(EFFECT_SPSUMMON_COST)}
local re5={Duel.IsPlayerAffectedByEffect(tp,EFFECT_SPSUMMON_COUNT_LIMIT)}
for _,te1 in pairs(re1) do
local con=te1:GetCondition()
if not con then con=aux.TRUE end
te1:SetCondition(s.chcon(con))
se:SetLabel(1)
end
for _,te2 in pairs(re2) do
local cost=te2:GetCost()
if cost and not cost(te2,c,tp) then
if te2:GetType()==EFFECT_TYPE_SINGLE then
local con=te2:GetCondition()
if not con then con=aux.TRUE end
te2:SetCondition(s.chcon(con))
se:SetLabel(1)
end
if te2:GetType()==EFFECT_TYPE_FIELD then
local tg=te2:GetTarget()
if not tg then
te2:SetTarget(s.chtg(aux.TRUE))
se:SetLabel(1)
elseif tg(te2,c,tp) then
te2:SetTarget(s.chtg(tg))
se:SetLabel(1)
end
end
end
end
for _,te5 in pairs(re5) do
local val=te5:GetValue()
local _,a=te5:GetLabel()
if a==0 then te5:SetLabel(0,val) end
local sp=Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)
local _,b=te5:GetLabel()
if sp==0 then
te5:SetLabel(1,b)
te5:SetValue(b)
end
val=te5:GetValue()
local l,_=te5:GetLabel()
if l==0 then te5:SetLabel(sp+1,b) else
local n=sp-l+1
if n==val then
te5:SetValue(val+1)
local e1=te5:Clone()
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
local loc=te5:GetRange()
if loc~=0 then
e1:SetLabelObject(te5)
te5:GetHandler():RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetLabel(loc,b)
e2:SetLabelObject(e1)
e2:SetOperation(s.reset1)
Duel.RegisterEffect(e2,tp)
else Duel.RegisterEffect(e1,te5:GetOwnerPlayer()) end
end
end
end
local re3={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_SPECIAL_SUMMON)}
local re4={Duel.IsPlayerAffectedByEffect(tp,EFFECT_LIMIT_SPECIAL_SUMMON_POSITION)}
for _,v in pairs(re4) do table.insert(re3,v) end
for _,te3 in pairs(re3) do
local tg=te3:GetTarget()
if not tg then
te3:SetTarget(s.chtg3(aux.TRUE))
se:SetLabel(1)
elseif tg(te3,c,tp,SUMMON_TYPE_SYNCHRO,POS_FACEUP,tp,se) then
te3:SetTarget(s.chtg3(tg))
se:SetLabel(1)
end
end
c:ResetFlagEffect(53752000)
end
function s.chcon(_con)
return function(e,...)
local x=e:GetHandler()
if x:IsHasEffect(53752000) and Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,x:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and x:GetFlagEffect(53752000)<1 then return false end
return _con(e,...)
end
end
function s.reset1(e,tp,eg,ep,ev,re,r,rp)
local x=e:GetLabelObject():GetHandler()
local te=e:GetLabelObject():GetLabelObject()
local loc,v=e:GetLabel()
if x:GetLocation()&loc==0 then
te:SetLabel(0,v)
te:SetValue(v)
e:GetLabelObject():Reset()
e:Reset()
end
end
function s.chtg3(_tg)
return function(e,c,sump,sumtype,sumpos,targetp,se)
if s.NecroceanSyn(c) and se:GetHandler()==c and Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,c:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and c:GetFlagEffect(53752000)<1 then return false end
return _tg(e,c,sump,sumtype,sumpos,targetp,se)
end
end
function s.chtg(_tg)
return function(e,c,...)
if c:IsHasEffect(53752000) and Duel.IsExistingMatchingCard(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,c:GetControler(),LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and c:GetFlagEffect(53752000)<1 then return false end
return _tg(e,c,...)
end
end
function s.GetSynMaterials(tp,syncard)
local g=aux.GetSynMaterials(tp,syncard)
local mg=Duel.GetMatchingGroup(s.IsCanBeSynchroMaterial,tp,0x10,0x1c,nil,syncard,g)
return Group.__add(g,mg)
end
function s.IsCanBeSynchroMaterial(c,syncard,g)
if c:IsCanBeSynchroMaterial(syncard) and (not g or g:IsContains(c)) then return true end
if not s.NecroceanSyn(syncard) then return false end
if c:IsStatus(STATUS_FORBIDDEN) then return false end
if c:IsHasEffect(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) then return false end
local tp=syncard:GetControler()
local res=Duel.IsExistingMatchingCard(s.lindfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil)
if c:IsLocation(LOCATION_GRAVE) then
if c:GetControler()==tp and c:IsLevel(0) and syncard:GetOriginalCode()~=53752002 then return false end
if Duel.IsExistingMatchingCard(function(c)return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TUNER)end,tp,LOCATION_GRAVE,0,1,nil) then return false end
if not (c:IsAbleToRemove(tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO) or res) then return false end
elseif c:IsLocation(LOCATION_ONFIELD) then
if c:GetControler()~=tp and not res then return false end
else return false end
return true
end
function s.GetSynchroLevel(c,sc)
local lv=c:GetSynchroLevel(sc)
local tp=sc:GetControler()
local b1=c:IsLocation(LOCATION_GRAVE) and c:IsLevel(0) and (c:GetControler()~=tp or sc:GetOriginalCode()==53752002)
local b2=Duel.IsExistingMatchingCard(s.lindfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) and c:IsLocation(LOCATION_ONFIELD) and c:GetControler()~=tp and (c:IsFacedown() or c:IsLevel(0))
if s.NecroceanSyn(sc) and (b1 or b2) then return 1 else return lv end
end
function s.NecroceanSyn(c)
local code=c:GetOriginalCode()-53752000
return (code>=7 and code<=14) or code==2
end
function s.lindfilter(c)
return c:IsFaceupEx() and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()
end
function s.lvs(c,syncard)
if not c then return 0 end
local lv=s.GetSynchroLevel(c,syncard)
local lv2=lv>>16
lv=lv&0xffff
if lv2>0 then return lv,lv2 else return lv end
end
function s.lvplus(group,sc)
local results = {}
local function calculateRecursive(cards, index, sum)
if index > #cards then
table.insert(results, sum)
return
end
local card = cards[index]
local level1, level2 = s.lvs(card,sc)
if not level2 then
calculateRecursive(cards, index + 1, sum + level1)
else
calculateRecursive(cards, index + 1, sum + level1)
calculateRecursive(cards, index + 1, sum + level2)
end
end
local cards = {}
local card = group:GetFirst()
while card do
table.insert(cards, card)
card = group:GetNext()
end
calculateRecursive(cards, 1, 0)
return results
end
function s.slfilter(c,tc,sc)
local lv1_1,lv1_2=s.lvs(c,sc)
local lv2_1,lv2_2=s.lvs(tc,sc)
if (lv1_2 and not lv2_2) or (not lv1_2 and lv2_2) then return false end
local res1=(lv1_1==lv2_1)
if lv1_2 and lv2_2 then res1=(((lv1_1==lv2_1) and (lv1_2==lv2_2)) or ((lv1_1==lv2_2) and (lv1_2==lv2_1))) end
if not res1 then return false end
local function botht(card,syncard)
return card:IsTuner(syncard) and card:IsNotTuner(syncard)
end
if botht(c,sc) and botht(tc,sc) then return true
elseif botht(c,sc) and not botht(tc,sc) then return false
elseif not botht(c,sc) and botht(tc,sc) then return false else
if (c:IsTuner(sc) and tc:IsTuner(sc)) or (c:IsNotTuner(sc) and tc:IsNotTuner(sc)) then return true end
end
return false
end
function s.gcheck(sc)
return function(sg)
return math.min(table.unpack(s.lvplus(sg,sc)))<=sc:GetLevel()
end
end
function s.SynMixCondition(e,c,smat,mg1,min,max)
if c==nil then return true end
local minc=0
local maxc=99
if min then
local exct=1
if min-exct>minc then minc=min-exct end
if max-exct<maxc then maxc=max-exct end
if minc>maxc then return false end
end
local tp=c:GetControler()
if Duel.IsPlayerAffectedByEffect(tp,8173184) then
Duel.RegisterFlagEffect(tp,8173184+1,0,0,1)
end
if smat and not s.IsCanBeSynchroMaterial(smat,c) then
Duel.ResetFlagEffect(tp,8173184+1)
return false
end
local mg
local mgchk=false
if mg1 then
mg=mg1:Filter(s.IsCanBeSynchroMaterial,nil,c)
mgchk=true
else
mg=s.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
Auxiliary.SubGroupCaptured=Group.CreateGroup()
SNNM.SubGroupParams={s.slfilter,s.GetSynchroLevel,nil,true,true,{c},{c}}
aux.GCheckAdditional=s.gcheck(c)
local res=SNNM.SelectSubGroup(mg,tp,s.syngoal,Duel.IsSummonCancelable(),2,#mg,c,smat,tp,mgchk)
aux.GCheckAdditional=nil
SNNM.SubGroupParams={}
Duel.ResetFlagEffect(tp,8173184+1)
return res and mg:IsExists(s.ntfilter,1,nil,c,mg) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.ntfilter(c,sc,mg)
return c:IsTuner(sc) and mg:IsExists(Card.IsNotTuner,1,c,sc)
end
function s.syngoal(g,sc,smat,tp,mgchk)
if not g:IsExists(s.ntfilter,1,nil,sc,g) then return false end
if smat and not g:IsContains(smat) then return false end
if not aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
if Duel.IsPlayerAffectedByEffect(tp,8173184)
and not g:IsExists(aux.Tuner(Card.IsSetCard,0x2),1,nil,sc) then return false end
if not SNNM.IsInTable(sc:GetLevel(),s.lvplus(g,sc))
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or (#g)*2~=sc:GetLevel())
then return false end
if not (mgchk or aux.SynMixHandCheck(g,tp,sc)) then return false end
for c in aux.Next(g) do
local le,lf,lloc,lmin,lmax=c:GetTunerLimit()
if le then
local lct=g:GetCount()-1
if lloc then
local llct=g:FilterCount(Card.IsLocation,c,lloc)
if llct~=lct then return false end
end
if lf and g:IsExists(aux.SynLimitFilter,1,c,lf,le,sc) then return false end
if (lmin and lct<lmin) or (lmax and lct>lmax) then return false end
end
end
return true
end
function s.SynMixTarget(e,tp,eg,ep,ev,re,r,rp,chk,c)
local minc=0
local maxc=99
local gc=nil
if min then
local exct=1
if min-exct>minc then minc=min-exct end
if max-exct<maxc then maxc=max-exct end
if minc>maxc then return false end
end
if Duel.IsPlayerAffectedByEffect(tp,8173184) then
Duel.RegisterFlagEffect(tp,8173184+1,0,0,1)
end
local g=Group.CreateGroup()
local mg
local mgchk=false
if mg1 then
mg=mg1:Filter(s.IsCanBeSynchroMaterial,nil,c)
mgchk=true
else
mg=s.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
SNNM.SubGroupParams={s.slfilter,s.GetSynchroLevel,nil,true,false,{c},{c}}
aux.GCheckAdditional=s.gcheck(c)
local sg=SNNM.SelectSubGroup(mg,tp,s.syngoal,Duel.IsSummonCancelable(),2,#mg,c,smat,tp,mgchk)
aux.GCheckAdditional=nil
SNNM.SubGroupParams={}
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function s.SynMixOperation(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
local rg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local res
local mrg=rg:Filter(aux.NOT(Card.IsAbleToRemove),nil,tp,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
if #mrg>0 then res=true end
local et={}
s[0]={} s[1]={}
for tc in aux.Next(mrg) do
local le1={tc:IsHasEffect(EFFECT_CANNOT_REMOVE)}
for _,v in pairs(le1) do
table.insert(et,v)
local con=v:GetCondition() or aux.TRUE
s[0][v]=con
s[1][v]=0
v:SetCondition(aux.FALSE)
end
local le2={Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_REMOVE)}
for _,v in pairs(le2) do
table.insert(et,v)
local tg=v:GetTarget() or aux.TRUE
if tg(v,tc,tp,REASON_MATERIAL+REASON_SYNCHRO,e) then
s[0][v]=tg
s[1][v]=1
v:SetTarget(s.chtg(tg,tc))
end
end
end
Duel.Remove(rg,POS_FACEUP,REASON_MATERIAL+REASON_SYNCHRO)
for _,v in pairs(et) do
local ch=s[0][v]
if s[1][v]==0 then v:SetCondition(ch) else v:SetTarget(ch) end
end
s[0]={} s[1]={}
local fg=Group.__sub(g,rg)
if fg:IsExists(s.afffilter,1,nil,c,tp) then res=true end
Duel.SendtoGrave(fg,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
if res then
local g=Duel.SelectMatchingCard(tp,s.lindfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then Duel.SendtoGrave(g,REASON_RULE) end
end
end
function s.afffilter(c,syncard,tp)
if c:IsControler(tp) then return false end
local le={c:IsHasEffect(EFFECT_EXTRA_SYNCHRO_MATERIAL,tp)}
for _,te in pairs(le) do
local tf=te:GetValue()
if aux.GetValueType(tf)=="function" then
if tf(te,syncard) then return false end
else
if tf~=0 then return false end
end
end
return true
end
function s.chtg(tg,tc)
return function(e,c,rp,r,re)
return not tc and tg(e,c,rp,r,re)
end
end
if not s then return end
function s.initial_effect(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)end)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
function cm.filter(c,tp)
return c:IsType(TYPE_FIELD) and c:IsCode(53752003) and c:GetActivateEffect():IsActivatable(tp,true,true)
function s.filter(c,tp)
return c:IsType(TYPE_FIELD) and c:IsOriginalCodeRule(22702055) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
function s.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,1))
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
......@@ -46,14 +439,14 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_FZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(cm.sdcon)
e1:SetCondition(s.sdcon)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function cm.cfilter(c)
function s.cfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TUNER)
end
function cm.sdcon(e)
return Duel.IsExistingMatchingCard(cm.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil)
function s.sdcon(e)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,1,nil)
end
......@@ -27,11 +27,14 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.tffilter(c,tp)
return c:GetType()&0x20002==0x20002 and c:IsCode(53752015,53752016,53752017) and c:GetActivateEffect():IsActivatable(tp)
return c:GetType()&0x20002==0x20002 and c:GetActivateEffect():IsActivatable(tp)
end
function cm.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tffilter,tp,LOCATION_DECK,0,1,nil,tp) end
end
function cm.tdfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and (c:IsFacedown() or not c:IsCode(22702055)) and c:IsAbleToDeck()
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local sc=Duel.SelectMatchingCard(tp,cm.tffilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
......@@ -42,6 +45,11 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(sc,73734821,te,0,tp,tp,Duel.GetCurrentChain())
local dg=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_ONFIELD,0,nil)
if #dg>0 then
Duel.BreakEffect()
Duel.SendtoDeck(dg,nil,2,REASON_EFFECT)
end
end
function cm.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsPreviousLocation(LOCATION_DECK+LOCATION_HAND) and c:IsControler(1-tp)
......
local m=53752007
local cm=_G["c"..m]
cm.name="仇恨之安妮"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
......
local m=53752008
local cm=_G["c"..m]
cm.name="荣誉之瓦萨"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
......
local m=53752009
local cm=_G["c"..m]
cm.name="压迫之斯考皮恩"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
......
local m=53752010
local cm=_G["c"..m]
cm.name="守护之罗斯"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
......
local m=53752011
local cm=_G["c"..m]
cm.name="庄重之戈登堡"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
......
local m=53752012
local cm=_G["c"..m]
cm.name="宏伟之泰坦"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_ATKCHANGE)
......
local m=53752013
local cm=_G["c"..m]
cm.name="破灭之阿尔坎"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES)
......
local m=53752014
local cm=_G["c"..m]
cm.name="无名天际领航者"
cm.NecroceanSyn=true
--cm.GuyWildCard=true
if not require and dofile then function require(str) return dofile(str..".lua") end end
if not pcall(function() require("expansions/script/c53702500") end) then require("script/c53702500") end
if not pcall(function() require("expansions/script/c53752002") end) then require("script/c53752002") end
function cm.initial_effect(c)
SNNM.NecroceanSynchro(c)
Necrocean.AddSynchroMixProcedure(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
......
......@@ -2,6 +2,8 @@ local m=53752016
local cm=_G["c"..m]
cm.name="为离开的再生"
function cm.initial_effect(c)
aux.AddCodeList(c,22702055)
aux.EnableChangeCode(c,22702055,LOCATION_SZONE+LOCATION_GRAVE)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
......@@ -48,7 +50,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetCode(EFFECT_EXTRA_SYNCHRO_MATERIAL)
e1:SetOwnerPlayer(tp)
e1:SetValue(cm.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
......@@ -74,6 +78,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.matval(e,c)
return c:IsControler(e:GetOwnerPlayer())
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)==e:GetLabel() then
......
local m=53752019
local cm=_G["c"..m]
cm.name="莉莉·林德"
function cm.initial_effect(c)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_ACTIVATE_COST)
ge1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
ge1:SetTargetRange(1,1)
ge1:SetTarget(cm.costtg)
ge1:SetOperation(cm.costop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_BE_MATERIAL)
ge3:SetCondition(cm.matcon)
ge3:SetOperation(cm.matop)
Duel.RegisterEffect(ge3,0)
end
end
function cm.costtg(e,te,tp)
local rc=te:GetHandler()
return rc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and rc:GetFlagEffect(m)>0
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local ge1=Effect.CreateEffect(e:GetHandler())
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAIN_SOLVING)
ge1:SetLabel(Duel.GetCurrentChain()+1)
ge1:SetOperation(cm.disop)
ge1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(ge1,tp)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if ev~=e:GetLabel() then return end
local dg=Duel.GetMatchingGroup(function(c)return (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsOriginalCodeRule(53752019) and c:IsAbleToGrave()end,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,nil)
if Duel.GetFlagEffect(0,m)>0 then
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,aux.NULL)
elseif #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,aux.NULL)
local sg=dg:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.RegisterFlagEffect(0,m,RESET_CHAIN,0,1)
end
end
function cm.cfilter(c,r)
return (c:IsLocation(LOCATION_GRAVE) or c:IsLocation(LOCATION_REMOVED) and c:IsFaceup()) and r==REASON_SYNCHRO
end
function cm.matcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,r)
end
function cm.matop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.cfilter,nil,r)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,0,0)
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