Commit 7545becb authored by Nemo Ma's avatar Nemo Ma

fix

parent 420efab8
--
function c1.initial_effect(c)
end
...@@ -19,7 +19,7 @@ function c10150030.spfilter(c,e,tp) ...@@ -19,7 +19,7 @@ function c10150030.spfilter(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end end
function c10150030.cfilter(c) function c10150030.cfilter(c)
return Duel.GetLocationCountFromEx(tp,tp,c)>0 return Duel.GetMZoneCount(tp,c)>0
end end
function c10150030.target(e,tp,eg,ep,ev,re,r,rp,chk) function c10150030.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
...@@ -40,7 +40,7 @@ function c10150030.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,7 +40,7 @@ function c10150030.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c10150030.activate(e,tp,eg,ep,ev,re,r,rp) function c10150030.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c10150030.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,c10150030.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
......
...@@ -3,19 +3,8 @@ local m=188801 ...@@ -3,19 +3,8 @@ local m=188801
local cm=_G["c"..m] local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--synchro summon --synchro summon
c:EnableReviveLimit() c:EnableReviveLimit()
local e1=Effect.CreateEffect(c) cm.AddSynchroMixProcedure(c,nil,nil,nil,nil,1,99,nil)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.syncon)
e1:SetTarget(cm.syntg)
e1:SetOperation(cm.synop)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--atkup --atkup
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
...@@ -49,145 +38,266 @@ function cm.initial_effect(c) ...@@ -49,145 +38,266 @@ function cm.initial_effect(c)
e6:SetValue(1) e6:SetValue(1)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function cm.CheckGroup(g,f,cg,min,max,...) function cm.AddSynchroMixProcedure(c,f1,f2,f3,f4,minc,maxc,gc)
if cg then Duel.SetSelectedCard(cg) end local e1=Effect.CreateEffect(c)
return g:CheckSubGroup(f,min,max,...) e1:SetDescription(1164)
end e1:SetType(EFFECT_TYPE_FIELD)
function cm.SelectGroupNew(tp,desc,cancelable,g,f,cg,min,max,...) e1:SetCode(EFFECT_SPSUMMON_PROC)
local min=min or 1 e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
local max=max or #g e1:SetRange(LOCATION_EXTRA)
local ext_params={...} e1:SetCondition(cm.SynMixCondition(f1,f2,f3,f4,minc,maxc,gc))
if cg then Duel.SetSelectedCard(cg) end e1:SetTarget(cm.SynMixTarget(f1,f2,f3,f4,minc,maxc,gc))
Duel.Hint(tp,HINT_SELECTMSG,desc) e1:SetOperation(cm.SynMixOperation(f1,f2,f3,f4,minc,maxc,gc))
return g:SelectSubGroup(tp,f,cancelable,min,max,...) e1:SetValue(SUMMON_TYPE_SYNCHRO)
end c:RegisterEffect(e1)
function cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
return cm.SelectGroupNew(tp,desc,false,g,f,cg,min,max,...)
end
function cm.matfilter1(c,syncard,tp)
if c:IsFacedown() then return false end
if c:IsLocation(LOCATION_OVERLAY) and c:IsLevelAbove(1) then return c:IsSetCard(0x7e) or c:IsSynchroType(TYPE_TUNER) end
return c:IsSynchroType(TYPE_TUNER) and c:IsCanBeSynchroMaterial(syncard)
end end
function cm.matfilter2(c,syncard) function cm.AddSynchroMixProcedure(c,f1,f2,f3,f4,minc,maxc,gc)
if c:IsLocation(LOCATION_OVERLAY) and c:IsLevelAbove(1) and c:IsNotTuner(syncard) then return true end local e1=Effect.CreateEffect(c)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsNotTuner(syncard) and c:IsCanBeSynchroMaterial(syncard) 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(cm.SynMixCondition(f1,f2,f3,f4,minc,maxc,gc))
e1:SetTarget(cm.SynMixTarget(f1,f2,f3,f4,minc,maxc,gc))
e1:SetOperation(cm.SynMixOperation(f1,f2,f3,f4,minc,maxc,gc))
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
end end
function cm.val(c,syncard) function cm.SynMaterialFilter(c,syncard)
return c:GetSynchroLevel(syncard) return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard)
end end
function cm.CheckGroupRecursive(c,sg,g,f,min,max,ext_params) function cm.SynLimitFilter(c,f,e,syncard)
sg:AddCard(c) return f and not f(e,c,syncard)
local ct=sg:GetCount()
local res=(ct>=min and f(sg,table.unpack(ext_params)))
or (ct<max and g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params))
sg:RemoveCard(c)
return res
end end
function cm.synfilter(c,syncard,lv,g2,g3,minc,maxc,tp) function cm.GetSynchroLevelFlowerCardian(c)
local tsg=c:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2 return 2
local f=c.tuner_filter
if c.tuner_filter then tsg=tsg:Filter(f,nil) end
return cm.CheckGroup(tsg,cm.goal,Group.FromCards(c),minc,maxc,tp,lv,syncard,c)
end end
function cm.goal(g,tp,lv,syncard,tuc) function cm.GetSynMaterials(tp,syncard)
if Duel.GetLocationCountFromEx(tp,tp,g,syncard)<=0 then return false end local mg=Duel.GetMatchingGroup(cm.SynMaterialFilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,syncard)
if tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g:IsExists(Card.IsLocation,2,tuc,LOCATION_HAND) then return false end if mg:IsExists(Card.GetHandSynchro,1,nil) then
local ct=g:GetCount() local mg2=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND,0,nil,syncard)
return g:CheckWithSumEqual(cm.val,lv,ct,ct,syncard) if mg2:GetCount()>0 then mg:Merge(mg2) end
end
return mg
end end
function cm.syncon(e,c,tuner,mg) 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==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false 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 tp=c:GetControler()
local minc=2 local mg
local maxc=c:GetLevel() local mgchk=false
local g1=nil if mg1 then
local g2=nil mg=mg1
local g3=nil mgchk=true
local sg=nil
local sg1=nil
local sg2=nil
if mg then
g1=mg:Filter(cm.matfilter1,nil,c,tp)
g2=mg:Filter(cm.matfilter2,nil,c)
g3=g2:Clone()
else
sg=Duel.GetOverlayGroup(tp,LOCATION_ONFIELD,0)
sg1=sg:Filter(cm.matfilter1,nil,c,tp)
sg2=sg:Filter(cm.matfilter1,nil,c,tp)
g1=Duel.GetMatchingGroup(cm.matfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c,tp)
g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c)
g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c)
g1:Merge(sg1)
g2:Merge(sg2)
end
local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL)
local lv=c:GetLevel()
local sg=nil
if tuner then
return cm.matfilter1(c,tp) and cm.synfilter(tuner,c,lv,g2,g3,minc,maxc,tp)
elseif pe then
return cm.matfilter1(pe:GetOwner(),tp) and cm.synfilter(pe:GetOwner(),c,lv,g2,g3,minc,maxc,tp)
else
return g1:IsExists(cm.synfilter,1,nil,c,lv,g2,g3,minc,maxc,tp)
end
end
function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk,c,tuner,mg)
local minc=2
local maxc=c:GetLevel()
local g1=nil
local g2=nil
local g3=nil
local sg=nil
local sg1=nil
local sg2=nil
if mg then
g1=mg:Filter(cm.matfilter1,nil,c,tp)
g2=mg:Filter(cm.matfilter2,nil,c)
g3=g2:Clone()
else else
sg=Duel.GetOverlayGroup(tp,LOCATION_ONFIELD,0) mg=cm.GetSynMaterials(tp,c)
sg1=sg:Filter(cm.matfilter1,nil,c,tp) end
sg2=sg:Filter(cm.matfilter1,nil,c,tp) if smat~=nil then mg:AddCard(smat) end
g1=Duel.GetMatchingGroup(cm.matfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c,tp) return mg:IsExists(cm.SynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk)
g2=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil,c) end
g3=Duel.GetMatchingGroup(cm.matfilter2,tp,LOCATION_MZONE+LOCATION_HAND,LOCATION_MZONE,nil,c) end
g1:Merge(sg1) function cm.SynMixTarget(f1,f2,f3,f4,minc,maxc,gc)
g2:Merge(sg2) return function(e,tp,eg,ep,ev,re,r,rp,chk,c,smat,mg1,min,max)
end local minc=minc
local pe=Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_SMATERIAL) local maxc=maxc
local lv=c:GetLevel() if min then
local tuc=nil if min>minc then minc=min end
if tuner then if max<maxc then maxc=max end
tuc=tuner if minc>maxc then return false end
end
local g=Group.CreateGroup()
local mg
if mg1 then
mg=mg1
else else
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) mg=cm.GetSynMaterials(tp,c)
if not pe then end
local t1=g1:FilterSelect(tp,cm.synfilter,1,1,nil,c,lv,g2,g3,minc,maxc,tp) if smat~=nil then mg:AddCard(smat) end
tuc=t1:GetFirst() 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):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):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):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 else
tuc=pe:GetOwner() mg2:Sub(g)
Group.FromCards(tuc):Select(tp,1,1,nil)
end end
local cg=mg2:Filter(cm.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,gc)
if cg:GetCount()==0 then break end
local minct=1
if cm.SynMixCheckGoal(tp,g4,minc,i,c,g,smat,gc) then
minct=0
end end
tuc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,1) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local tsg=tuc:IsHasEffect(EFFECT_HAND_SYNCHRO) and g3 or g2 local tg=cg:Select(tp,minct,1,nil)
local f=tuc.tuner_filter if tg:GetCount()==0 then break end
if tuc.tuner_filter then tsg=tsg:Filter(f,nil) end g4:Merge(tg)
local g=cm.SelectGroup(tp,HINTMSG_SMATERIAL,tsg,cm.goal,Group.FromCards(tuc),minc,maxc,tp,lv,c,tuc) end
if g then g:Merge(g4)
if g:GetCount()>0 then
g:KeepAlive() g:KeepAlive()
e:SetLabelObject(g) e:SetLabelObject(g)
return true return true
else return false end else return false end
end
end end
function cm.synop(e,tp,eg,ep,ev,re,r,rp,c,tuner,mg) 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() local g=e:GetLabelObject()
c:SetMaterial(g) c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO) Duel.SendtoGrave(g,REASON_MATERIAL+REASON_SYNCHRO)
g:DeleteGroup() g:DeleteGroup()
Duel.Hint(HINT_MUSIC,0,m*16+2) 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)
else
return mg:IsExists(cm.SynMixFilter4,1,c1,f4,minc,maxc,syncard,mg,smat,c1,nil,nil,gc,mgchk)
end
end
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)
else
return mg:IsExists(cm.SynMixFilter4,1,Group.FromCards(c1,c2),f4,minc,maxc,syncard,mg,smat,c1,c2,nil,gc,mgchk)
end
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
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 aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL) then return false end
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(cm.GetSynchroLevelFlowerCardian,syncard:GetLevel(),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
if c:IsLocation(LOCATION_OVERLAY) and c:IsSetCard(0x7e) then
if not c:IsSynchroType(TYPE_TUNER) and g:IsExists(Card.IsSynchroType,2,nil,TYPE_TUNER) then
return false
end
if c:IsSynchroType(TYPE_TUNER) and g:IsExists(Card.IsSynchroType,1,c,TYPE_TUNER) then
return false
end
end
if c:IsLocation(LOCATION_OVERLAY) and not c:IsSetCard(0x7e) then
if c:IsSynchroType(TYPE_TUNER) and g:IsExists(Card.IsSynchroType,1,c,TYPE_TUNER) then
return false
end
if not c:IsSynchroType(TYPE_TUNER) and g:IsExists(Card.IsSynchroType,2,nil,TYPE_TUNER) then
return false
end
end
if g:FilterCount(Card.IsSynchroType,nil,TYPE_TUNER)==0 and not g:IsExists(Card.IsLocation,1,nil,LOCATION_OVERLAY) then
return false
end
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
return true
end
function cm.SynMaterialFilter(c,syncard)
return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard)
end
function cm.SynLimitFilter(c,f,e,syncard)
return f and not f(e,c,syncard)
end
function cm.GetSynchroLevelFlowerCardian(c)
return 2
end
function cm.filtersyn(c,syncard)
return c:IsCanBeSynchroMaterial(syncard)
end
function cm.GetSynMaterials(tp,syncard)
local mg=Duel.GetMatchingGroup(cm.SynMaterialFilter,tp,LOCATION_MZONE+LOCATION_OVERLAY,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 sg=Duel.GetOverlayGroup(tp,LOCATION_ONFIELD,0)
sg:Filter(cm.filtersyn,nil,syncard)
mg:Merge(sg)
return mg
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x107f) and c:GetOverlayCount()>0 return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x107f) and c:GetOverlayCount()>0
......
...@@ -64,7 +64,7 @@ function c22020840.splimit(e,c) ...@@ -64,7 +64,7 @@ function c22020840.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK) return not c:IsAttribute(ATTRIBUTE_DARK)
end end
function c22020840.filter(c,e,tp) function c22020840.filter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_DRAGON)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c22020840.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22020840.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c22020840.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c22020840.filter(chkc,e,tp) end
......
--时崎狂三---时之战士 --时崎狂三---时之战士
function c33400008.initial_effect(c) function c33400008.initial_effect(c)
c:EnableCounterPermit(0x34f)
aux.AddLinkProcedure(c,c33400008.mfilter,2) aux.AddLinkProcedure(c,c33400008.mfilter,2)
c:EnableReviveLimit() c:EnableReviveLimit()
--activate from hand --activate from hand
...@@ -14,7 +15,7 @@ function c33400008.initial_effect(c) ...@@ -14,7 +15,7 @@ function c33400008.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_CHAIN_SOLVED) e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetCountLimit(1,33400008) e2:SetCountLimit(1,33400008)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
...@@ -75,9 +76,9 @@ end ...@@ -75,9 +76,9 @@ end
function c33400008.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33400008.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc~=c end if chkc then return chkc:IsOnField() and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c) local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c33400008.activate(e,tp,eg,ep,ev,re,r,rp) function c33400008.activate(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -17,7 +17,8 @@ function cm.initial_effect(c) ...@@ -17,7 +17,8 @@ function cm.initial_effect(c)
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,33413501)<(Duel.GetFlagEffect(tp,33403501)/2+1)and Duel.GetFlagEffect(tp,m+30000)==0 and Duel.GetFlagEffect(tp,33443500)==0 local ss=Duel.GetTurnCount()
return Duel.GetFlagEffect(tp,33413501)<ss and Duel.GetFlagEffect(tp,m+30000)==0 and Duel.GetFlagEffect(tp,33443500)==0
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -35,52 +36,18 @@ function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se) ...@@ -35,52 +36,18 @@ function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not se:GetHandler():IsSetCard(0x5349)and not c:IsCode(33403500) return not se:GetHandler():IsSetCard(0x5349)and not c:IsCode(33403500)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsType(TYPE_MONSTER)and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false)) return c:IsType(TYPE_MONSTER)and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false)) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_GRAVE+LOCATION_REMOVED and cm.filter(chkc,e,tp) end if chkc then return chkc:GetLocation()==LOCATION_GRAVE+LOCATION_REMOVED and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
if e:GetLabel()==1 then if e:GetLabel()==1 then
local c=e:GetHandler() Duel.RegisterFlagEffect(tp,m+20000,RESET_PHASE+PHASE_END,0,1) --t1
local e2=Effect.CreateEffect(c) Duel.RegisterFlagEffect(tp,33413501,RESET_PHASE+PHASE_END,0,1) --t1+t2
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop2)
e2:SetReset(RESET_EVENT+RESET_CHAIN+RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m+20000,RESET_PHASE+PHASE_END,0,1) --t2
Duel.RegisterFlagEffect(tp,33413501,RESET_PHASE+PHASE_END,0,1) --t1
Duel.RegisterFlagEffect(tp,33403501,0,0,0) --duel 1
e:SetLabel(2)
end
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsSetCard(0x5349) and rp==tp
end
function cm.regop2(e,tp,eg,ep,ev,re,r,rp)
local n1=Duel.GetFlagEffect(tp,33413501)
local n2=Duel.GetFlagEffect(tp,33403501)
local n3=Duel.GetFlagEffect(tp,m+20000)
Duel.ResetFlagEffect(tp,33413501)
Duel.ResetFlagEffect(tp,33403501)
Duel.ResetFlagEffect(tp,m+20000)
if n1>=2 then
for i=1,n1-1 do
Duel.RegisterFlagEffect(tp,33413501,RESET_PHASE+PHASE_END,0,1)
end
end
if n2>=2 then
for i=1,n2-1 do
Duel.RegisterFlagEffect(tp,33403501,0,0,0) Duel.RegisterFlagEffect(tp,33403501,0,0,0)
end e:SetLabel(2)
end
if n3>=2 then
for i=1,n3 do
Duel.RegisterFlagEffect(tp,m+20000,RESET_PHASE+PHASE_END,0,1)
end
end end
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
...@@ -98,6 +65,8 @@ local c=e:GetHandler() ...@@ -98,6 +65,8 @@ local c=e:GetHandler()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
--indes --indes
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,3))
e3:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e3:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
......
...@@ -11,13 +11,22 @@ function c33701323.initial_effect(c) ...@@ -11,13 +11,22 @@ function c33701323.initial_effect(c)
e1:SetCondition(c33701323.spcon) e1:SetCondition(c33701323.spcon)
e1:SetOperation(c33701323.spop) e1:SetOperation(c33701323.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- --cannot be material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e2:SetValue(c33701323.synlimit) e2:SetValue(c33701323.synlimit)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e4)
local e5=e2:Clone()
e5:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e5)
end end
function c33701323.spfil(c) function c33701323.spfil(c)
return c:IsCanBeLinkMaterial(nil) and (c:IsType(TYPE_SPELL+TYPE_TRAP) or c:IsRace(RACE_CYBERSE)) return c:IsCanBeLinkMaterial(nil) and (c:IsType(TYPE_SPELL+TYPE_TRAP) or c:IsRace(RACE_CYBERSE))
......
...@@ -42,20 +42,34 @@ function cm.initial_effect(c) ...@@ -42,20 +42,34 @@ function cm.initial_effect(c)
e4:SetOperation(cm.spop) e4:SetOperation(cm.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.matfilter(c) function cm.tgrfilter(c)
return c:IsCanOverlay() and c:IsType(TYPE_TUNER) and c:IsLevelAbove(1) and c:IsFaceup() return c:IsFaceup() and c:IsLevelAbove(1) and c:IsCanOverlay()
end end
function cm.gcheck(g,tp,c) function cm.tgrfilter1(c)
return g:CheckWithSumEqual(Card.GetLevel,8,2,2) and Duel.GetLocationCountFromEx(tp,tp,g,c)>0 return c:IsType(TYPE_TUNER) and c:IsLevelAbove(1)
end end
function cm.con(e,c,tp) function cm.mnfilter(c,g)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) return g:IsExists(cm.mnfilter2,1,c,c)
return g:CheckSubGroup(cm.gcheck,2,2,tp,c) end
function cm.mnfilter2(c,mc)
return c:GetLevel()+mc:GetLevel()==8
end
function cm.fselect(g,tp,sc)
return g:GetCount()==2
and g:IsExists(cm.tgrfilter1,2,nil)
and g:IsExists(cm.mnfilter,1,nil,g)
and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end
function cm.con(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.tgrfilter,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(cm.fselect,2,2,tp,c)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp,c) function cm.op(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.tgrfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local matg=g:SelectSubGroup(tp,cm.gcheck,false,2,2,tp,c) local matg=g:SelectSubGroup(tp,cm.fselect,false,2,2,tp,c)
local og = Group.CreateGroup() local og = Group.CreateGroup()
for tc in aux.Next(matg) do for tc in aux.Next(matg) do
og:Merge(tc:GetOverlayGroup()) og:Merge(tc:GetOverlayGroup())
......
...@@ -38,20 +38,34 @@ function cm.initial_effect(c) ...@@ -38,20 +38,34 @@ function cm.initial_effect(c)
e4:SetOperation(cm.rmop) e4:SetOperation(cm.rmop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.matfilter(c) function cm.tgrfilter(c)
return c:IsCanOverlay() and c:IsType(TYPE_TUNER) and c:IsLevelAbove(1) and c:IsFaceup() return c:IsFaceup() and c:IsLevelAbove(1) and c:IsCanOverlay()
end end
function cm.gcheck(g,tp,c) function cm.tgrfilter1(c)
return g:CheckWithSumEqual(Card.GetLevel,11,2,2) and Duel.GetLocationCountFromEx(tp,tp,g,c)>0 return c:IsType(TYPE_TUNER) and c:IsLevelAbove(1)
end end
function cm.con(e,c,tp) function cm.mnfilter(c,g)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) return g:IsExists(cm.mnfilter2,1,c,c)
return g:CheckSubGroup(cm.gcheck,2,2,tp,c) end
function cm.mnfilter2(c,mc)
return c:GetLevel()+mc:GetLevel()==11
end
function cm.fselect(g,tp,sc)
return g:GetCount()==2
and g:IsExists(cm.tgrfilter1,2,nil)
and g:IsExists(cm.mnfilter,1,nil,g)
and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
end
function cm.con(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.tgrfilter,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(cm.fselect,2,2,tp,c)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp,c) function cm.op(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(cm.tgrfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local matg=g:SelectSubGroup(tp,cm.gcheck,false,2,2,tp,c) local matg=g:SelectSubGroup(tp,cm.fselect,false,2,2,tp,c)
local og = Group.CreateGroup() local og = Group.CreateGroup()
for tc in aux.Next(matg) do for tc in aux.Next(matg) do
og:Merge(tc:GetOverlayGroup()) og:Merge(tc:GetOverlayGroup())
...@@ -81,7 +95,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,7 +95,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local sc=g:GetFirst() local sc=g:GetFirst()
if sc:IsLocation(LOCATION_REMOVED) and c:IsRelateToEffect(e) and c:IsFaceup() and sc:IsFaceup() and c:IsControler(tp) if sc:IsLocation(LOCATION_REMOVED) and c:IsRelateToEffect(e) and c:IsFaceup() and sc:IsFaceup() and c:IsControler(tp)
and c:IsCanBeXyzMaterial(sc) and sc:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsCanBeXyzMaterial(sc) and sc:IsCanBeSpecialSummoned(e,0,tp,true,true)
and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect() Duel.BreakEffect()
...@@ -91,7 +105,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,7 +105,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
end end
sc:SetMaterial(Group.FromCards(c)) sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c)) Duel.Overlay(sc,Group.FromCards(c))
Duel.SpecialSummon(sc,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(sc,0,tp,tp,true,true,POS_FACEUP)
sc:CompleteProcedure() sc:CompleteProcedure()
end end
end end
--克里斯汀·罗森塔尔 --克里斯汀·罗森塔尔
local m=81011002 local m=81011002
local cm=_G["c"..m] local cm=_G["c"..m]
xpcall(function() require("expansions/script/c81000000") end,function() require("script/c81000000") end)
function cm.initial_effect(c) function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
...@@ -11,23 +9,26 @@ function cm.initial_effect(c) ...@@ -11,23 +9,26 @@ function cm.initial_effect(c)
e1:SetHintTiming(0,TIMING_REMOVE+TIMING_END_PHASE) e1:SetHintTiming(0,TIMING_REMOVE+TIMING_END_PHASE)
e1:SetRange(LOCATION_REMOVED) e1:SetRange(LOCATION_REMOVED)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk) e1:SetCost(cm.cost)
local mg=Duel.GetMatchingGroup(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_REMOVED,LOCATION_REMOVED,e:GetHandler())
if chk==0 then return mg:GetCount()>=10 end
local g=mg:Select(tp,10,10,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end)
e1:SetTarget(cm.sptg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_REMOVED,LOCATION_REMOVED,e:GetHandler())>=10 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_REMOVED,LOCATION_REMOVED,10,10,e:GetHandler())
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
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 cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end end
end 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