Commit fac3b86c authored by 2924713558's avatar 2924713558 Committed by GitHub

Update c1110115.lua

parent 0418ce22
......@@ -2,11 +2,13 @@
function c1110115.initial_effect(c)
--
aux.AddCodeList(c,1110196)
--
--[[
c1110115.Fusion_Muxu(c,
aux.OR(c1110115.FusFilter1,c1110115.FusFilter2),
c1110115.f(c1110115.FusFilter1,c1110115.FusFilter2),
2,2,true)
]]--
c1110115.AddFusionProcMix(c,true,true,1110196,c1110115.FusFilter2)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1110115,0))
......@@ -39,9 +41,9 @@ function c1110115.Fusion_Muxu(c,mf,f,min,max,myon,sub)
c:RegisterEffect(e1)
end
--
function c1110115.MyonCheckFilter(c,ec,myon)
return myon and c:IsFaceup() and c:IsCanBeFusionMaterial(ec)
end
--function c1110115.MyonCheckFilter(c,ec,myon)
-- return myon and c:IsFaceup() and c:IsCanBeFusionMaterial(ec)
--end
function c1110115.FusFilterALL(c,fc,mf,sub)
return c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579) and ((not mf or mf(c,fc,sub)))
end
......@@ -135,7 +137,8 @@ end
--
function c1110115.tfilter1(c,e,tp,fusc,mg)
return c:IsLocation(LOCATION_GRAVE)
and bit.band(c:GetReason(),0x40008)==0x40008 and c:GetReasonCard()==fusc
and c:GetReasonCard()==fusc
and bit.band(c:GetReason(),0x40008)==0x40008
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1110115.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -194,3 +197,89 @@ function c1110115.op1(e,tp,eg,ep,ev,re,r,rp)
end
end
--
function c1110115.AddFusionProcMix(c,sub,insf,...)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local val={...}
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
elseif type(val[i])=='table' then
fun[i]=function(c,fc,sub,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
else
if c:IsFusionCode(fcode) or (sub and c:CheckFusionSubstitute(fc)) then return true end
end
end
return false
end
for _,fcode in ipairs(val[i]) do
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
mat[val[i]]=true
end
end
if c.material==nil then
local mt=getmetatable(c)
mt.material=mat
end
for index,_ in pairs(mat) do
Auxiliary.AddCodeList(c,index)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(c1110115.FConditionMix(insf,sub,table.unpack(fun)))
e1:SetOperation(c1110115.FOperationMix(insf,sub,table.unpack(fun)))
c:RegisterEffect(e1)
end
--
function c1110115.MyonCheckFilter(c,ec)
return c:IsFaceup() and c:IsCanBeFusionMaterial(ec)
end
function c1110115.FConditionMix(insf,sub,...)
local funs={...}
return
function(e,g,gc,chkfnf)
if g==nil then return insf and Auxiliary.MustMaterialCheck(nil,e:GetHandlerPlayer(),EFFECT_MUST_BE_FMATERIAL) end
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=chkfnf&0x100>0
local concat_fusion=chkfnf&0x200>0
local sub=(sub or notfusion) and not concat_fusion
local mg=g:Filter(Auxiliary.FConditionFilterMix,c,c,sub,concat_fusion,table.unpack(funs))
local exg=Duel.GetMatchingGroup(c1110115.MyonCheckFilter,tp,0,LOCATION_MZONE,nil,c)
mg:Merge(exg)
if gc then
if not mg:IsContains(gc) then return false end
Duel.SetSelectedCard(Group.FromCards(gc))
end
return mg:CheckSubGroup(Auxiliary.FCheckMixGoal,#funs,#funs,tp,c,sub,chkfnf,table.unpack(funs))
end
end
--
function c1110115.FOperationMix(insf,sub,...)
local funs={...}
return
function(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=chkfnf&0x100>0
local concat_fusion=chkfnf&0x200>0
local sub=(sub or notfusion) and not concat_fusion
local mg=eg:Filter(Auxiliary.FConditionFilterMix,c,c,sub,concat_fusion,table.unpack(funs))
local exg=Duel.GetMatchingGroup(c1110115.MyonCheckFilter,tp,0,LOCATION_MZONE,nil,c)
mg:Merge(exg)
if gc then Duel.SetSelectedCard(Group.FromCards(gc)) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:SelectSubGroup(tp,Auxiliary.FCheckMixGoal,false,#funs,#funs,tp,c,sub,chkfnf,table.unpack(funs))
Duel.SetFusionMaterial(sg)
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