Commit 600d5cc4 authored by POLYMER's avatar POLYMER

fix

parent 065a2d95
...@@ -6,7 +6,6 @@ function s.initial_effect(c) ...@@ -6,7 +6,6 @@ function s.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.rstg) e1:SetTarget(s.rstg)
e1:SetOperation(s.rsop) e1:SetOperation(s.rsop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -15,7 +14,7 @@ function s.initial_effect(c) ...@@ -15,7 +14,7 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+1) e2:SetCountLimit(1,id)
e2:SetCost(s.thcost) e2:SetCost(s.thcost)
e2:SetTarget(s.thtg) e2:SetTarget(s.thtg)
e2:SetOperation(s.thop) e2:SetOperation(s.thop)
......
--幻叙支配者-水仙 --幻叙支配者-水仙
local s,id,o=GetID() local s,id,o=GetID()
local _IsCanBeSynchroMaterial=Card.IsCanBeSynchroMaterial
function Card.IsCanBeSynchroMaterial(c,...)
local ext_params={...}
if #ext_params==0 then return _IsCanBeSynchroMaterial(c,...) end
local sc=ext_params[1]
local tp=sc:GetControler()
if c:IsLocation(LOCATION_MZONE) and not c:IsControler(tp) then
local mg=Duel.GetSynchroMaterial(tp)
return mg:IsContains(c) and _IsCanBeSynchroMaterial(c,sc,...)
end
return _IsCanBeSynchroMaterial(c,...)
end
--
function s.initial_effect(c) function s.initial_effect(c)
--synchro summon aux.AddSynchroProcedure(c,nil,aux.NonTuner(s.synfilter),1)
c:EnableReviveLimit()
--synchro level
local ge0=Effect.CreateEffect(c)
ge0:SetType(EFFECT_TYPE_SINGLE)
ge0:SetCode(EFFECT_SYNCHRO_LEVEL)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetRange(0xff)
ge0:SetValue(s.synclv)
--effect gain
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(1164) e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA) e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(s.SynMixCondition(s.matfilter,nil,nil,aux.NonTuner(Card.IsSetCard,0x838),1,99,gc)) e0:SetTargetRange(0xff,0)
e0:SetTarget(s.SynMixTarget(s.matfilter,nil,nil,aux.NonTuner(Card.IsSetCard,0x838),1,99,gc)) e0:SetTarget(s.syntarget)
e0:SetOperation(aux.SynOperation(nil,aux.NonTuner(Card.IsSetCard,0x838),1,99)) e0:SetLabelObject(ge0)
e0:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e0) c:RegisterEffect(e0)
c:EnableReviveLimit()
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -55,181 +46,23 @@ function s.initial_effect(c) ...@@ -55,181 +46,23 @@ function s.initial_effect(c)
c:RegisterEffect(ex) c:RegisterEffect(ex)
end end
--synchro summon --synchro summon
function s.matfilter(c) function s.synfilter(c)
return c:IsSynchroType(TYPE_TUNER) or c:IsSetCard(0x838) return c:IsSetCard(0x838)
end
function s.SynMaterialFilter(c,syncard)
return c:IsFaceup() and (c:IsCanBeSynchroMaterial(syncard) or c:GetSynchroLevel(syncard)==0)
end
function s.SynLimitFilter(c,f,e,syncard)
return f and not f(e,c,syncard)
end
function s.GetSynchroLevelFlowerCardian(c)
return 2
end
function s.GetSynMaterials(tp,syncard)
local mg=Duel.GetMatchingGroup(s.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
return mg
end
function s.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=s.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
return mg:IsExists(s.SynMixFilter1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk)
end
end
function s.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=s.GetSynMaterials(tp,c)
end
if smat~=nil then mg:AddCard(smat) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local c1=mg:FilterSelect(tp,s.SynMixFilter1,1,1,nil,f1,f2,f3,f4,minc,maxc,c,mg,smat,gc,mgchk):GetFirst()
g:AddCard(c1)
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(s.SynMixCheckRecursive,g4,tp,g4,mg2,i,minc,maxc,c,g,smat,c1,gc,mgchk)
if cg:GetCount()==0 then break end
local minct=1
if s.SynMixCheckGoal(tp,g4,minc,i,c,g,smat,c1,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 s.SynMixFilter1(c,f1,f2,f3,f4,minc,maxc,syncard,mg,smat,gc,mgchk)
return (not f1 or f1(c,syncard)) and mg:IsExists(s.SynMixFilter4,1,c,f4,minc,maxc,syncard,mg,smat,c,gc,mgchk)
end
function s.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,gc,mgchk)
if f4 and not f4(c,syncard,c1) then return false end
local sg=Group.FromCards(c1,c)
sg:AddCard(c1)
local mg=mg1:Clone()
if f4 then
mg=mg:Filter(f4,sg,syncard)
else
mg:Sub(sg)
end
return s.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,c1,gc,mgchk)
end
function s.SynMixCheck(mg,sg1,minc,maxc,syncard,smat,c1,gc,mgchk)
local tp=syncard:GetControler()
local sg=Group.CreateGroup()
if minc<=0 and s.SynMixCheckGoal(tp,sg1,0,0,syncard,sg,smat,c1,gc,mgchk) then return true end
if maxc==0 then return false end
return mg:IsExists(s.SynMixCheckRecursive,1,nil,tp,sg,mg,0,minc,maxc,syncard,sg1,smat,c1,gc,mgchk)
end
function s.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,c1,gc,mgchk)
sg:AddCard(c)
ct=ct+1
local res=s.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,c1,gc,mgchk)
or (ct<maxc and mg:IsExists(s.SynMixCheckRecursive,1,sg,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat,c1,gc,mgchk))
sg:RemoveCard(c)
ct=ct-1
return res
end end
function s.val(c,syncard,c1) function s.synclv(e,c)
if c:IsSetCard(0x838) then local lv=aux.GetCappedLevel(e:GetHandler())
local lv=c:GetSynchroLevel(syncard) if c:IsCode(id) then
if lv~=0 then if c:IsLevelAbove(1) then
return (3<<16)+lv return (3<<16)+lv
else else
return 3 return 3
end end
else else
return c:GetSynchroLevel(syncard) return lv
end end
end end
function s.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,c1,gc,mgchk) function s.syntarget(e,c)
if ct<minc then return false end return c:IsSetCard(0x838)
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(s.val,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard,c1)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(s.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(s.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(s.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 s.hspval(e,c) function s.hspval(e,c)
return 0,0x4 return 0,0x4
......
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