Commit cf828b7b authored by fallenstardust's avatar fallenstardust

Merge branch 'master' into 'master'

fix复原次世代控制员

See merge request pokeboyexn/pre-release-database-cdb!5
parents 1be87dc3 ea930342
...@@ -68,6 +68,11 @@ function s.smtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -68,6 +68,11 @@ function s.smtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.smop(e,tp,eg,ep,ev,re,r,rp) function s.smop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,s.smfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Summon(tp,g:GetFirst(),true,nil)
end
--splimit --splimit
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD) e0:SetType(EFFECT_TYPE_FIELD)
...@@ -77,28 +82,72 @@ function s.smop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,28 +82,72 @@ function s.smop(e,tp,eg,ep,ev,re,r,rp)
e0:SetTarget(s.splimit) e0:SetTarget(s.splimit)
e0:SetReset(RESET_PHASE+PHASE_END) e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp) Duel.RegisterEffect(e0,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON) --synchro level
local e1=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e3:SetCode(EFFECT_SYNCHRO_MATERIAL_CUSTOM)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE) e3:SetTarget(s.syntg)
e1:SetTargetRange(0xff,0xff) e3:SetValue(1)
e1:SetTarget(s.sptg2) e3:SetOperation(s.synop)
e1:SetValue(s.splimit2) local e31=Effect.CreateEffect(c)
e1:SetReset(RESET_PHASE+PHASE_END) e31:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
Duel.RegisterEffect(e1,tp) e31:SetReset(RESET_PHASE+PHASE_END)
local g=Duel.SelectMatchingCard(tp,s.smfilter,tp,LOCATION_HAND,0,1,1,nil) e31:SetTargetRange(LOCATION_MZONE,0)
if g:GetCount()>0 then e31:SetLabelObject(e3)
Duel.Summon(tp,g:GetFirst(),true,nil) Duel.RegisterEffect(e31,tp)
end end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se:IsHasType(EFFECT_TYPE_ACTIONS) and c:IsLocation(LOCATION_EXTRA) and bit.band(sumtype,SUMMON_TYPE_SYNCHRO)~=SUMMON_TYPE_SYNCHRO
end
function s.smcfilter(c)
return c:IsSetCard(0x2) and c:IsType(TYPE_TUNER)
end end
function s.splimit(e,c) function s.synfilter(c,syncard,tuner,f)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA) return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard,tuner) and (f==nil or f(c,syncard))
end end
function s.splimit2(e,c) function s.syncheck(c,g,mg,tp,lv,syncard,minc,maxc)
if not c then return false end g:AddCard(c)
return c:IsControler(e:GetHandlerPlayer()) local ct=g:GetCount()
local res=s.syngoal(g,tp,lv,syncard,minc,ct)
or (ct<maxc and mg:IsExists(s.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc))
g:RemoveCard(c)
return res
end end
function s.sptg2(e,c) function s.syngoal(g,tp,lv,syncard,minc,ct)
return not ((c:IsSetCard(0x2) and c:IsType(TYPE_TUNER)) or (not c:IsType(TYPE_TUNER))) return ct>=minc and Duel.GetLocationCountFromEx(tp,tp,g,syncard)>0
and g:CheckWithSumEqual(Card.GetSynchroLevel,lv,ct,ct,syncard)
and aux.MustMaterialCheck(g,tp,EFFECT_MUST_BE_SMATERIAL)
and g:IsExists(s.smcfilter,1,nil)
end
function s.syntg(e,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler()
local tp=syncard:GetControler()
local lv=syncard:GetLevel()
if lv<=c:GetLevel() then return false end
local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(s.synfilter,c,syncard,c,f)
return mg:IsExists(s.syncheck,1,g,g,mg,tp,lv,syncard,minc,maxc)
end
function s.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,min,max)
local minc=min+1
local maxc=max+1
local c=e:GetHandler()
local lv=syncard:GetLevel()
local g=Group.FromCards(c)
local mg=Duel.GetSynchroMaterial(tp):Filter(s.synfilter,c,syncard,c,f)
for i=1,maxc do
local cg=mg:Filter(s.syncheck,g,g,mg,tp,lv,syncard,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if s.syngoal(g,tp,lv,syncard,minc,i) then
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=cg:Select(tp,minct,1,nil)
if sg:GetCount()==0 then break end
g:Merge(sg)
end
Duel.SetSynchroMaterial(g)
end end
\ No newline at end of file
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