Commit 9c72d0c3 authored by tianchenglipu's avatar tianchenglipu

changes

parent b485cbd9
......@@ -2,19 +2,13 @@
function c11039171.initial_effect(c)
--fusion material
c:EnableReviveLimit()
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(c11039171.fscon)
e1:SetOperation(c11039171.fsop)
c:RegisterEffect(e1)
aux.AddFusionProcCodeFunRep(c,30068120,aux.FilterBoolFunction(Card.IsSetCard,0xa9),1,63,false,false)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(c11039171.splimit)
e2:SetValue(aux.fuslimit)
c:RegisterEffect(e2)
--multi
local e3=Effect.CreateEffect(c)
......@@ -23,27 +17,6 @@ function c11039171.initial_effect(c)
e3:SetOperation(c11039171.atkop)
c:RegisterEffect(e3)
end
c11039171.material_count=1
c11039171.material={30068120}
function c11039171.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c11039171.mfilter(c,mg)
return c:IsCode(30068120) and mg:IsExists(Card.IsSetCard,1,c,0xa9)
end
function c11039171.fscon(e,mg,gc)
if mg==nil then return false end
if gc then return false end
return mg:IsExists(c11039171.mfilter,1,nil,mg)
end
function c11039171.fsop(e,tp,eg,ep,ev,re,r,rp,gc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,c11039171.mfilter,1,1,nil,eg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=eg:FilterSelect(tp,Card.IsSetCard,1,63,g1:GetFirst(),0xa9)
g1:Merge(g2)
Duel.SetFusionMaterial(g1)
end
function c11039171.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......
......@@ -3,13 +3,7 @@ function c464362.initial_effect(c)
c:SetUniqueOnField(1,0,464362)
--fusion material
c:EnableReviveLimit()
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(c464362.fscon)
e1:SetOperation(c464362.fsop)
c:RegisterEffect(e1)
aux.AddFusionProcCodeFunRep(c,30068120,aux.FilterBoolFunction(Card.IsSetCard,0xa9),1,63,true,true)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
......@@ -30,31 +24,6 @@ function c464362.initial_effect(c)
e3:SetValue(c464362.atkval)
c:RegisterEffect(e3)
end
c464362.material_count=1
c464362.material={30068120}
function c464362.mfilter(c,mg)
return (c:IsCode(30068120) or c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)) and mg:IsExists(Card.IsSetCard,1,c,0xa9)
end
function c464362.fscon(e,mg,gc)
if mg==nil then return true end
if gc then return (gc:IsCode(30068120) or gc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE))
and mg:IsExists(Card.IsSetCard,1,gc,0xa9) end
return mg:IsExists(c464362.mfilter,1,nil,mg)
end
function c464362.fsop(e,tp,eg,ep,ev,re,r,rp,gc)
if gc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,Card.IsSetCard,1,63,nil,0xa9)
Duel.SetFusionMaterial(g1)
return
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,c464362.mfilter,1,1,nil,eg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=eg:FilterSelect(tp,Card.IsSetCard,1,63,g1:GetFirst(),0xa9)
g1:Merge(g2)
Duel.SetFusionMaterial(g1)
end
function c464362.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
......
......@@ -2,13 +2,7 @@
function c64599569.initial_effect(c)
c:EnableReviveLimit()
--fusion material
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(c64599569.fscondition)
e1:SetOperation(c64599569.fsoperation)
c:RegisterEffect(e1)
aux.AddFusionProcCodeFunRep(c,70095154,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),1,63,true,true)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
......@@ -28,25 +22,6 @@ function c64599569.initial_effect(c)
e4:SetOperation(c64599569.tgop)
c:RegisterEffect(e4)
end
c64599569.material_count=1
c64599569.material={70095154}
function c64599569.spfilter(c,mg)
return (c:IsCode(70095154) or c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE))
and mg:IsExists(Card.IsRace,1,c,RACE_MACHINE)
end
function c64599569.fscondition(e,mg,gc)
if mg==nil then return false end
if gc then return false end
return mg:IsExists(c64599569.spfilter,1,nil,mg)
end
function c64599569.fsoperation(e,tp,eg,ep,ev,re,r,rp,gc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,c64599569.spfilter,1,1,nil,eg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=eg:FilterSelect(tp,Card.IsRace,1,63,g1:GetFirst(),RACE_MACHINE)
g1:Merge(g2)
Duel.SetFusionMaterial(g1)
end
function c64599569.sucop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
......
......@@ -2,13 +2,7 @@
function c80889750.initial_effect(c)
--fusion material
c:EnableReviveLimit()
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(c80889750.fscon)
e1:SetOperation(c80889750.fsop)
c:RegisterEffect(e1)
aux.AddFusionProcFunFunRep(c,c80889750.mfilter1,c80889750.mfilter2,1,63,true)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -36,25 +30,12 @@ function c80889750.initial_effect(c)
e4:SetOperation(c80889750.indop)
c:RegisterEffect(e4)
end
function c80889750.mfilter1(c,mg)
return c:IsSetCard(0xad) and c:IsType(TYPE_FUSION) and mg:IsExists(c80889750.mfilter2,1,c)
function c80889750.mfilter1(c)
return c:IsSetCard(0xad) and c:IsType(TYPE_FUSION)
end
function c80889750.mfilter2(c)
return c:IsSetCard(0xa9) or c:IsSetCard(0xc3)
end
function c80889750.fscon(e,mg,gc)
if mg==nil then return true end
if gc then return false end
return mg:IsExists(c80889750.mfilter1,1,nil,mg)
end
function c80889750.fsop(e,tp,eg,ep,ev,re,r,rp,gc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,c80889750.mfilter1,1,1,nil,eg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=eg:FilterSelect(tp,c80889750.mfilter2,1,63,g1:GetFirst())
g1:Merge(g2)
Duel.SetFusionMaterial(g1)
end
function c80889750.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
......
......@@ -996,6 +996,118 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
Duel.SetFusionMaterial(g1)
end
end
--Fusion monster, name + condition * minc to maxc
--may not be perfect for gc
function Auxiliary.AddFusionProcCodeFunRep(c,code,f,minc,maxc,sub,insf)
if c.material_count==nil then
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=1
mt.material={code}
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(Auxiliary.FConditionCodeFunRep(code,f,minc,maxc,sub,insf))
e1:SetOperation(Auxiliary.FOperationCodeFunRep(code,f,minc,maxc,sub,insf))
c:RegisterEffect(e1)
end
function Auxiliary.FConditionFilterCFR(c,code,sub,f,mg,minc)
return (c:IsCode(code) or (sub and c:IsHasEffect(EFFECT_FUSION_SUBSTITUTE))) and mg:IsExists(f,minc,c)
end
function Auxiliary.FConditionCodeFunRep(code,f,minc,maxc,sub,insf)
return function(e,g,gc,chkf)
if g==nil then return insf end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler())
if gc then return (gc:IsCode(code) or sub and gc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE))
and mg:IsExists(f,minc,gc)
end
local mg1=mg:Filter(aux.FConditionFilterCFR,nil,code,sub,f,mg,minc)
local mg2=mg:Filter(f,nil,minc)
if chkf~=PLAYER_NONE then return mg1:GetCount()>=1
and mg1:FilterCount(Card.IsOnField,nil)+mg2:FilterCount(Card.IsOnField,nil)~=0
else return mg1:GetCount()>=1 end
end
end
function Auxiliary.FOperationCodeFunRep(code,f,minc,maxc,sub,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,f,minc,maxc,nil)
Duel.SetFusionMaterial(g1)
return
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local mg1=eg:FilterSelect(tp,aux.FConditionFilterCFR,1,1,nil,code,sub,f,eg,minc)
local g2=eg:Filter(f,mg1:GetFirst())
local offset=false
if chkf~=PLAYER_NONE and not mg1:GetFirst():IsOnField() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local mg3=g2:FilterSelect(tp,Card.IsOnField,1,1,nil)
mg1:Merge(mg3)
g2:Sub(mg3)
offset=true
end
if offset and (maxc-1<1 or minc-1<1 and not Duel.SelectYesNo(tp,93)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local mg2=g2:Select(tp,minc-1,maxc-1,nil)
mg1:Merge(mg2)
Duel.SetFusionMaterial(mg1)
end
end
--Fusion monster, condition1 + condition2 * minc to maxc
--may not be perfect for gc
function Auxiliary.AddFusionProcFunFunRep(c,f1,f2,minc,maxc,insf)
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(Auxiliary.FConditionFunFunRep(f1,f2,minc,maxc,insf))
e1:SetOperation(Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf))
c:RegisterEffect(e1)
end
function Auxiliary.FConditionFilterFFR(c,f1,f2,mg,minc)
return f1(c) and mg:IsExists(f2,minc,c)
end
function Auxiliary.FConditionFunFunRep(f1,f2,minc,maxc,insf)
return function(e,g,gc,chkf)
if g==nil then return insf end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler())
if gc then return f1(gc) and mg:IsExists(f2,minc,gc) end
local mg1=mg:Filter(aux.FConditionFilterFFR,nil,f1,f2,mg,minc)
local mg2=mg:Filter(f2,nil,minc)
if chkf~=PLAYER_NONE then return mg1:GetCount()>=1
and mg1:FilterCount(Card.IsOnField,nil)+mg2:FilterCount(Card.IsOnField,nil)~=0
else return mg1:GetCount()>=1 end
end
end
function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,f2,minc,maxc,nil)
Duel.SetFusionMaterial(g1)
return
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local mg1=eg:FilterSelect(tp,aux.FConditionFilterFFR,1,1,nil,f1,f2,eg,minc)
local g2=eg:Filter(f2,mg1:GetFirst())
local offset=false
if chkf~=PLAYER_NONE and not mg1:GetFirst():IsOnField() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local mg3=g2:FilterSelect(tp,Card.IsOnField,1,1,nil)
mg1:Merge(mg3)
g2:Sub(mg3)
offset=true
end
if offset and (maxc-1<1 or minc-1<1 and not Duel.SelectYesNo(tp,93)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local mg2=g2:Select(tp,minc-1,maxc-1,nil)
mg1:Merge(mg2)
Duel.SetFusionMaterial(mg1)
end
end
--Ritual Summon, geq fixed lv
function Auxiliary.AddRitualProcGreater(c,filter)
local e1=Effect.CreateEffect(c)
......
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