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

fix redefined local in aux.AddFusionProcMixRep()

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