Commit 5b0dd112 authored by Chen Bill's avatar Chen Bill

fix redefined local in aux.AddFusionProcMixRep()

parent e6477839
...@@ -808,6 +808,7 @@ end ...@@ -808,6 +808,7 @@ end
--Fusion Summon --Fusion Summon
--material: names in material list --material: names in material list
--Fusion monster, mixed materials --Fusion monster, mixed materials
function Auxiliary.AddFusionProcMix(fcard,sub,insf,...) function Auxiliary.AddFusionProcMix(fcard,sub,insf,...)
if fcard:IsStatus(STATUS_COPYING_EFFECT) then return end if fcard:IsStatus(STATUS_COPYING_EFFECT) then return end
...@@ -925,21 +926,21 @@ function Auxiliary.FCheckMixGoal(sg,tp,fc,sub,chkfnf,...) ...@@ -925,21 +926,21 @@ function Auxiliary.FCheckMixGoal(sg,tp,fc,sub,chkfnf,...)
and (not Auxiliary.FGoalCheckAdditional or Auxiliary.FGoalCheckAdditional(tp,sg,fc)) and (not Auxiliary.FGoalCheckAdditional or Auxiliary.FGoalCheckAdditional(tp,sg,fc))
end end
--Fusion monster, mixed material * minc to maxc + material + ... --Fusion monster, mixed material * minc to maxc + material + ...
function Auxiliary.AddFusionProcMixRep(c,sub,insf,fun1,minc,maxc,...) function Auxiliary.AddFusionProcMixRep(fcard,sub,insf,fun1,minc,maxc,...)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end if fcard:IsStatus(STATUS_COPYING_EFFECT) then return end
local val={fun1,...} local val={fun1,...}
local fun={} local fun={}
local mat={} local mat={}
for i=1,#val do for i=1,#val do
if type(val[i])=='function' then if type(val[i])=='function' then
fun[i]=function(c,fc,sub,mg,sg) return val[i](c,fc,sub,mg,sg) and not c:IsHasEffect(6205579) end fun[i]=function(c,fc,subm,mg,sg) return val[i](c,fc,subm,mg,sg) and not c:IsHasEffect(6205579) end
elseif type(val[i])=='table' then elseif type(val[i])=='table' then
fun[i]=function(c,fc,sub,mg,sg) fun[i]=function(c,fc,subm,mg,sg)
for _,fcode in ipairs(val[i]) do for _,fcode in ipairs(val[i]) do
if type(fcode)=='function' then if type(fcode)=='function' then
if fcode(c,fc,sub,mg,sg) and not c:IsHasEffect(6205579) then return true end if fcode(c,fc,subm,mg,sg) and not c:IsHasEffect(6205579) then return true end
else else
if c:IsFusionCode(fcode) or (sub and c:CheckFusionSubstitute(fc)) then return true end if c:IsFusionCode(fcode) or (subm and c:CheckFusionSubstitute(fc)) then return true end
end end
end end
return false return false
...@@ -948,11 +949,11 @@ function Auxiliary.AddFusionProcMixRep(c,sub,insf,fun1,minc,maxc,...) ...@@ -948,11 +949,11 @@ function Auxiliary.AddFusionProcMixRep(c,sub,insf,fun1,minc,maxc,...)
if type(fcode)~='function' then mat[fcode]=true end if type(fcode)~='function' then mat[fcode]=true end
end end
else else
fun[i]=function(c,fc,sub) return c:IsFusionCode(val[i]) or (sub and c:CheckFusionSubstitute(fc)) end fun[i]=function(c,fc,subm) return c:IsFusionCode(val[i]) or (subm and c:CheckFusionSubstitute(fc)) end
mat[val[i]]=true mat[val[i]]=true
end end
end end
local mt=getmetatable(c) local mt=getmetatable(fcard)
if mt.material==nil then if mt.material==nil then
mt.material=mat mt.material=mat
end end
...@@ -960,15 +961,15 @@ function Auxiliary.AddFusionProcMixRep(c,sub,insf,fun1,minc,maxc,...) ...@@ -960,15 +961,15 @@ function Auxiliary.AddFusionProcMixRep(c,sub,insf,fun1,minc,maxc,...)
mt.material_count={#fun+minc-1,#fun+maxc-1} mt.material_count={#fun+minc-1,#fun+maxc-1}
end end
for index,_ in pairs(mat) do for index,_ in pairs(mat) do
Auxiliary.AddCodeList(c,index) Auxiliary.AddCodeList(fcard,index)
end end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(fcard)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL) e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(Auxiliary.FConditionMixRep(insf,sub,fun[1],minc,maxc,table.unpack(fun,2))) e1:SetCondition(Auxiliary.FConditionMixRep(insf,sub,fun[1],minc,maxc,table.unpack(fun,2)))
e1:SetOperation(Auxiliary.FOperationMixRep(insf,sub,fun[1],minc,maxc,table.unpack(fun,2))) e1:SetOperation(Auxiliary.FOperationMixRep(insf,sub,fun[1],minc,maxc,table.unpack(fun,2)))
c:RegisterEffect(e1) fcard:RegisterEffect(e1)
end end
function Auxiliary.FConditionMixRep(insf,sub,fun1,minc,maxc,...) function Auxiliary.FConditionMixRep(insf,sub,fun1,minc,maxc,...)
local funs={...} local funs={...}
......
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