Commit 1b4d4cdb authored by Nemo Ma's avatar Nemo Ma

fix

parent ca17ba4c
......@@ -78,14 +78,16 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
if KOISHI_CHECK and cm[tp] then
--[[Duel.DisableActionCheck(true)
if not cm[tp] then
cm[tp]=Duel.CreateToken(tp,m)
end
local dc=cm[tp]
Duel.DisableActionCheck(false)--]]
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
Debug.Message("11")
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
return res and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsLocation(LOCATION_HAND)) or (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLocation(LOCATION_EXTRA)))
......@@ -279,4 +281,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
......@@ -23,6 +23,7 @@ function cm.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e1)
e3:SetTargetRange(1,0)
--e3:SetCost(cm.chkac)
e3:SetTarget(cm.actarget)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
......@@ -87,13 +88,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -172,6 +168,20 @@ function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,1-tp,REASON_EFFECT)
end
function cm.chkac(e,c,tp)
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
return res
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
......@@ -268,4 +278,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
......@@ -77,13 +77,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -221,4 +216,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
......@@ -79,13 +79,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -239,4 +234,10 @@ function cm.descon(e,tp,eg,ep,ev,re,r,rp)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
\ No newline at end of file
end
Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
......@@ -106,13 +106,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_LINK+TYPE_EFFECT)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -209,4 +204,10 @@ end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
end
Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
......@@ -62,13 +62,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -190,4 +185,10 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(1-tp)
end
end
end
\ No newline at end of file
end
Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
Duel.DisableActionCheck(false)
\ No newline at end of file
......@@ -91,13 +91,8 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if Card.SetCardData then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
res=dc:GetActivateEffect():IsActivatable(tp)
dc:SetCardData(CARDDATA_TYPE,TYPE_SPELL)
if KOISHI_CHECK and cm[tp] then
res=cm[tp]:GetActivateEffect():IsActivatable(tp,true)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
......@@ -147,4 +142,10 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then Duel.Draw(tp,1,REASON_EFFECT) end
end
\ No newline at end of file
end
Duel.DisableActionCheck(true)
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_QUICKPLAY+TYPE_SPELL)
Duel.DisableActionCheck(false)
\ No newline at end of file
......@@ -121,7 +121,7 @@ function cm.initial_effect(c)
rpz:RegisterEffect(e4)--]]
return sg
end
end
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -177,7 +177,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.repfilter(c,tp)
return cm.tdfilter(c,tp) and c:IsOnField() and c:IsFaceup()
return cm.tdfilter(c,tp) and c:IsOnField() and c:IsFaceup() and c:GetFlagEffect(m)==0
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) and rp~=tp end
......
local m=15000056
local cm=_G["c"..m]
cm.name="色带神·莎布尼古拉丝"
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.Tuner(Card.IsSetCard,0xf33),aux.NonTuner(Card.IsSynchroType,TYPE_MONSTER),1,99)
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xf33),aux.NonTuner(Card.IsSynchroType,TYPE_MONSTER),1,99)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(cm.SynMixCondition(aux.FilterBoolFunction(Card.IsSetCard,0xf33),nil,nil,aux.NonTuner(Card.IsSynchroType,TYPE_MONSTER),minc,maxc,gc))
e0:SetTarget(cm.SynMixTarget(aux.FilterBoolFunction(Card.IsSetCard,0xf33),nil,nil,aux.NonTuner(Card.IsSynchroType,TYPE_MONSTER),minc,maxc,gc))
e0:SetOperation(cm.SynMixOperation(aux.FilterBoolFunction(Card.IsSetCard,0xf33),nil,nil,aux.NonTuner(Card.IsSynchroType,TYPE_MONSTER),minc,maxc,gc))
e0:SetValue(SUMMON_TYPE_SYNCHRO)
e0:SetLabel(8)
e0:SetCondition(cm.sycon)
e0:SetOperation(cm.syop)
c:RegisterEffect(e0)
--pendulum summon
aux.EnablePendulumAttribute(c,false)
......@@ -67,53 +68,206 @@ function cm.initial_effect(c)
e6:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e6)
end
function cm.stfilter1(c,tc)
return c:IsSetCard(0xf33) and c:IsSynchroType(TYPE_TUNER) and c:IsPosition(POS_FACEUP) and c:IsCanBeSynchroMaterial(tc)
function cm.SynMaterialFilter(c,syncard)
return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard)
end
function cm.stfilter2(c,tc)
return c:IsPosition(POS_FACEUP) and c:IsCanBeSynchroMaterial(tc) and not c:IsSynchroType(TYPE_TUNER)
function cm.SynLimitFilter(c,f,e,syncard)
return f and not f(e,c,syncard)
end
function cm.stfilterg(g,tp,tc,lv,smat)
if smat then
g:AddCard(smat)
end
local g1=g:Filter(cm.stfilter1,nil,tc)
local g2=g:Filter(cm.stfilter2,nil,tc)
local count=g:GetCount()
return g1:GetCount()==1 and g2:GetCount()==count-1 and g:GetSum(Card.GetLevel)==lv and Duel.GetLocationCountFromEx(tp,tp,g,tc)>0
end
function cm.sycon(e,c,smat,mg)
if c==nil then return true end
local lv=e:GetLabel()
local tp=c:GetControler()
if not mg then
mg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
function cm.GetSynchroLevelFlowerCardian(c)
return 2
end
function cm.GetSynMaterials(tp,syncard)
local mg=Duel.GetMatchingGroup(cm.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
if smat then
mg:RemoveCard(smat)
return mg:CheckSubGroup(cm.stfilterg,1,nil,tp,c,lv,smat)
return mg
end
function cm.SynMixCondition(f1,f2,f3,f4,minc,maxc,gc)
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=cm.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(cm.SynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk)
end
end
function cm.SynMixTarget(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 g=Group.CreateGroup()
local mg
local mgchk=false
if mg1 then
mg=mg1
mgchk=true
else
mg=cm.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c1=mg:FilterSelect(tp,cm.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,cm.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,cm.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(cm.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,gc,mgchk)
if cg:GetCount()==0 then break end
local minct=1
if cm.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
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function cm.SynMixOperation(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)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
end
function cm.SynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk)
return (not f1 or f1(c,syncard)) and mg:IsExists(cm.SynMixFilter2,1,c,f2,f3,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk)
end
function cm.SynMixFilter2(c,f2,f3,f4,minc,maxc,syncard,mg,smat,c1,gc,mgchk)
if f2 then
return f2(c,syncard,c1)
and (mg:IsExists(cm.SynMixFilter3,1,Group.FromCards(c1,c),f3,f4,minc,maxc,syncard,mg,smat,c1,c,gc,mgchk)
or minc==0 and cm.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,nil,nil,gc,mgchk))
else
return mg:CheckSubGroup(cm.stfilterg,2,nil,tp,c,lv,nil)
return mg:IsExists(cm.SynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk)
end
end
function cm.syop(e,tp,eg,ep,ev,re,r,rp,c,smat,mg)
local lv=e:GetLabel()
if not mg then
mg=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
function cm.SynMixFilter3(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.SynMixFilter4,1,Group.FromCards(c1,c2,c),f4,minc,maxc,syncard,mg,smat,c1,c2,c,gc,mgchk)
or minc==0 and cm.SynMixFilter4(c,nil,1,1,syncard,mg,smat,c1,c2,nil,gc,mgchk))
else
return mg:IsExists(cm.SynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk)
end
local g=Group.CreateGroup()
if smat then
mg:RemoveCard(smat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
g:Merge(mg:SelectSubGroup(tp,cm.stfilterg,false,1,nil,tp,c,lv,smat))
g:AddCard(smat)
end
function cm.SynMixFilter4(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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
g:Merge(mg:SelectSubGroup(tp,cm.stfilterg,false,2,nil,tp,c,lv,nil))
mg:Sub(sg)
end
return cm.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk)
end
function cm.SynMixCheck(mg,sg1,minc,maxc,syncard,smat,gc,mgchk)
local tp=syncard:GetControler()
local sg=Group.CreateGroup()
if minc<=0 and cm.SynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,gc,mgchk) then return true end
if maxc==0 then return false end
return mg:IsExists(cm.SynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,gc,mgchk)
end
function cm.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk)
sg:AddCard(c)
ct=ct+1
local res=cm.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
or (ct<maxc and mg:IsExists(cm.SynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,gc,mgchk))
sg:RemoveCard(c)
ct=ct-1
return res
end
function cm.SynMixCheckGoal(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 cm.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
if not g:CheckWithSumEqual(Card.GetSynchroLevel,8,g:GetCount(),g:GetCount(),syncard)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(cm.GetSynchroLevelFlowerCardian,8,g:GetCount(),g:GetCount(),syncard))
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(cm.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(cm.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
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
return true
end
function cm.pcfilter(c)
return c:IsType(TYPE_PENDULUM) and (c:IsLocation(LOCATION_DECK) or c:IsFaceup()) and not c:IsForbidden()
end
......
......@@ -48,7 +48,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
......
......@@ -51,7 +51,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
......
......@@ -43,7 +43,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
......
......@@ -72,7 +72,7 @@ function cm.SynOperation(f1,f2,minct,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c,smat,mg,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT)
Duel.Destroy(g,REASON_MATERIAL+REASON_SYNCHRO+REASON_REPLACE+REASON_EFFECT+REASON_RULE)
--Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup()
end
......
......@@ -3,7 +3,6 @@ local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
......
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