Commit 528963af authored by VanillaSalt's avatar VanillaSalt

update

parent a0ed3abf
...@@ -56,7 +56,10 @@ function c31444249.filter2(c,e,tp,m,f,chkf) ...@@ -56,7 +56,10 @@ function c31444249.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0xbb) and (not f or f(c)) return c:IsType(TYPE_FUSION) and c:IsSetCard(0xbb) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c31444249.dmcon(e,tp,eg,ep,ev,re,r,rp) function c31444249.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=6
end
function c31444249.dmcon(tp)
return not Duel.IsExistingMatchingCard(aux.FilterEqualFunction(Card.GetSummonLocation,LOCATION_EXTRA),tp,LOCATION_MZONE,0,1,nil) return not Duel.IsExistingMatchingCard(aux.FilterEqualFunction(Card.GetSummonLocation,LOCATION_EXTRA),tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.FilterEqualFunction(Card.GetSummonLocation,LOCATION_EXTRA),tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(aux.FilterEqualFunction(Card.GetSummonLocation,LOCATION_EXTRA),tp,0,LOCATION_MZONE,1,nil)
end end
...@@ -64,11 +67,15 @@ function c31444249.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -64,11 +67,15 @@ function c31444249.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg1=Duel.GetFusionMaterial(tp) local mg1=Duel.GetFusionMaterial(tp)
if c31444249.dmcon(e,tp,eg,ep,ev,re,r,rp) then if c31444249.dmcon(tp) then
local sg=Duel.GetMatchingGroup(c31444249.filter0,tp,LOCATION_DECK,0,nil) local sg=Duel.GetMatchingGroup(c31444249.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(sg) if sg:GetCount()>0 then
mg1:Merge(sg)
Auxiliary.FCheckAdditional=c31444249.fcheck
end
end end
local res=Duel.IsExistingMatchingCard(c31444249.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(c31444249.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
if not res then if not res then
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
if ce~=nil then if ce~=nil then
...@@ -85,11 +92,17 @@ end ...@@ -85,11 +92,17 @@ end
function c31444249.spop(e,tp,eg,ep,ev,re,r,rp) function c31444249.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c31444249.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(c31444249.filter1,nil,e)
if c31444249.dmcon(e,tp,eg,ep,ev,re,r,rp) then local exmat=false
local dmg=Duel.GetMatchingGroup(c31444249.filter0,tp,LOCATION_DECK,0,nil) if c31444249.dmcon(tp) then
mg1:Merge(dmg) local sg=Duel.GetMatchingGroup(c31444249.filter0,tp,LOCATION_DECK,0,nil)
if sg:GetCount()>0 then
mg1:Merge(sg)
exmat=true
end
end end
if exmat then Auxiliary.FCheckAdditional=c31444249.fcheck end
local sg1=Duel.GetMatchingGroup(c31444249.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(c31444249.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
local ce=Duel.GetChainMaterial(tp) local ce=Duel.GetChainMaterial(tp)
...@@ -106,12 +119,9 @@ function c31444249.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -106,12 +119,9 @@ function c31444249.spop(e,tp,eg,ep,ev,re,r,rp)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if c31444249.dmcon(e,tp,eg,ep,ev,re,r,rp) then if exmat then Auxiliary.FCheckAdditional=c31444249.fcheck end
local mgd=Duel.GetMatchingGroup(c31444249.filter0,tp,LOCATION_DECK,0,nil)
mg1:Merge(mgd)
tc:RegisterFlagEffect(31444249,RESET_CHAIN,0,1)
end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -24,16 +24,18 @@ function c48144509.filter2(c,e,tp,m,f,chkf) ...@@ -24,16 +24,18 @@ function c48144509.filter2(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c48144509.fcheck(tp,sg,fc) function c48144509.fcheck(tp,sg,fc)
return not sg:IsContains(fc) and sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=2 return sg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=2
end end
function c48144509.target(e,tp,eg,ep,ev,re,r,rp,chk) function c48144509.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsAbleToGrave,nil) local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsAbleToGrave,nil)
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
Auxiliary.FCheckAdditional=c48144509.fcheck
local sg=Duel.GetMatchingGroup(c48144509.exfilter0,tp,LOCATION_EXTRA,0,nil) local sg=Duel.GetMatchingGroup(c48144509.exfilter0,tp,LOCATION_EXTRA,0,nil)
mg1:Merge(sg) if sg:GetCount()>0 then
mg1:Merge(sg)
Auxiliary.FCheckAdditional=c48144509.fcheck
end
end end
local res=Duel.IsExistingMatchingCard(c48144509.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf) local res=Duel.IsExistingMatchingCard(c48144509.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
Auxiliary.FCheckAdditional=nil Auxiliary.FCheckAdditional=nil
...@@ -55,9 +57,11 @@ function c48144509.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,9 +57,11 @@ function c48144509.activate(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetFusionMaterial(tp):Filter(c48144509.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(c48144509.filter1,nil,e)
local exmat=false local exmat=false
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
exmat=true
local sg=Duel.GetMatchingGroup(c48144509.exfilter1,tp,LOCATION_EXTRA,0,nil,e) local sg=Duel.GetMatchingGroup(c48144509.exfilter1,tp,LOCATION_EXTRA,0,nil,e)
mg1:Merge(sg) if sg:GetCount()>0 then
mg1:Merge(sg)
exmat=true
end
end end
if exmat then Auxiliary.FCheckAdditional=c48144509.fcheck end if exmat then Auxiliary.FCheckAdditional=c48144509.fcheck end
local sg1=Duel.GetMatchingGroup(c48144509.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf) local sg1=Duel.GetMatchingGroup(c48144509.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
......
...@@ -2,13 +2,7 @@ ...@@ -2,13 +2,7 @@
function c74506079.initial_effect(c) function c74506079.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
local e1=Effect.CreateEffect(c) aux.AddFusionProcFunRep2(c,c74506079.ffilter,2,63,true)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(c74506079.fscondition)
e1:SetOperation(c74506079.fsoperation)
c:RegisterEffect(e1)
--summon success --summon success
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
...@@ -17,17 +11,7 @@ function c74506079.initial_effect(c) ...@@ -17,17 +11,7 @@ function c74506079.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c74506079.ffilter(c,fc) function c74506079.ffilter(c,fc)
return c:IsFusionSetCard(0x3e) and c:IsRace(RACE_REPTILE) and not c:IsHasEffect(6205579) and c:IsCanBeFusionMaterial(fc) return c:IsFusionSetCard(0x3e) and c:IsRace(RACE_REPTILE)
end
function c74506079.fscondition(e,g,gc)
if g==nil then return true end
if gc then return false end
return g:IsExists(c74506079.ffilter,2,nil,e:GetHandler())
end
function c74506079.fsoperation(e,tp,eg,ep,ev,re,r,rp,gc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g=eg:FilterSelect(tp,c74506079.ffilter,2,63,nil,e:GetHandler())
Duel.SetFusionMaterial(g)
end end
function c74506079.matcheck(e,c) function c74506079.matcheck(e,c)
local ct=c:GetMaterial():GetClassCount(Card.GetCode) local ct=c:GetMaterial():GetClassCount(Card.GetCode)
......
--インフェルノイド・ティエラ --インフェルノイド・ティエラ
function c82734805.initial_effect(c) function c82734805.initial_effect(c)
c:EnableReviveLimit()
--fusion material --fusion material
local e1=Effect.CreateEffect(c) c:EnableReviveLimit()
e1:SetType(EFFECT_TYPE_SINGLE) aux.AddFusionProcCode2FunRep(c,14799437,23440231,aux.FilterBoolFunction(Card.IsFusionSetCard,0xbb),1,63,true,true)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(c82734805.fscon)
e1:SetOperation(c82734805.fsop)
c:RegisterEffect(e1)
--spsummon success --spsummon success
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(82734805,0)) e2:SetDescription(aux.Stringid(82734805,0))
...@@ -26,8 +20,6 @@ function c82734805.initial_effect(c) ...@@ -26,8 +20,6 @@ function c82734805.initial_effect(c)
e3:SetLabelObject(e2) e3:SetLabelObject(e2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
c82734805.material_count=2
c82734805.material={14799437,23440231}
function c82734805.valcheck(e,c) function c82734805.valcheck(e,c)
local ct=e:GetHandler():GetMaterial():GetClassCount(Card.GetCode) local ct=e:GetHandler():GetMaterial():GetClassCount(Card.GetCode)
e:GetLabelObject():SetLabel(ct) e:GetLabelObject():SetLabel(ct)
...@@ -101,145 +93,3 @@ function c82734805.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,145 +93,3 @@ function c82734805.op(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(g1,REASON_EFFECT) Duel.SendtoGrave(g1,REASON_EFFECT)
end end
end end
function c82734805.filter(c)
return c:IsFusionSetCard(0xbb) and not c:IsHasEffect(6205579)
end
function c82734805.fcfilter1(c,code1,code2,g)
return c:IsFusionCode(code1,code2) and g:IsExists(c82734805.filter,1,c)
end
function c82734805.fcfilter2(c,code,g,fc)
return (c:IsFusionCode(code) or c:CheckFusionSubstitute(fc)) and g:IsExists(c82734805.filter,1,c)
end
function c82734805.fcfilter22(c,fc)
return c:IsFusionCode(14799437,23440231) or c:CheckFusionSubstitute(fc)
end
function c82734805.fcfilter3(c,g,fc)
return ((c:IsFusionCode(14799437) or c:CheckFusionSubstitute(fc)) and g:IsExists(Card.IsFusionCode,1,c,23440231))
or ((c:IsFusionCode(23440231) or c:CheckFusionSubstitute(fc)) and g:IsExists(Card.IsFusionCode,1,c,14799437))
end
function c82734805.fcfilter4(c,code,fc)
return c:IsFusionCode(code) or c:CheckFusionSubstitute(fc)
end
function c82734805.fcfilter7(c,chkf,fc)
return aux.FConditionCheckF(c,chkf) and (c82734805.filter(c) or c:CheckFusionSubstitute(fc))
end
function c82734805.fscon(e,g,gc,chkf)
if g==nil then return true end
local c=e:GetHandler()
local mg=g:Filter(Card.IsCanBeFusionMaterial,gc,c)
if gc then
if gc:CheckFusionSubstitute(c) then
return mg:IsExists(c82734805.fcfilter1,1,nil,14799437,23440231,mg)
elseif gc:IsFusionCode(14799437) then
return mg:IsExists(c82734805.fcfilter2,1,nil,23440231,mg,c)
elseif gc:IsFusionCode(23440231) then
return mg:IsExists(c82734805.fcfilter2,1,nil,14799437,mg,c)
elseif c82734805.filter(gc) then
return mg:IsExists(c82734805.fcfilter3,1,nil,mg,c)
else
return false
end
end
local b1=0 local b2=0 local b3=0 local bs=0
local fs=false
local tc=mg:GetFirst()
while tc do
if tc:CheckFusionSubstitute(c) then
bs=1 if aux.FConditionCheckF(tc,chkf) then fs=true end
elseif tc:IsFusionCode(14799437) then
if b1==0 then b1=1 else b3=1 end if aux.FConditionCheckF(tc,chkf) then fs=true end
elseif tc:IsFusionCode(23440231) then
if b2==0 then b2=1 else b3=1 end if aux.FConditionCheckF(tc,chkf) then fs=true end
elseif c82734805.filter(tc) then
b3=1 if aux.FConditionCheckF(tc,chkf) then fs=true end
end
tc=mg:GetNext()
end
if chkf~=PLAYER_NONE then
return fs and b1+b2+b3+bs>=3
else
return b1+b2+b3+bs>=3
end
end
function c82734805.fsop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local c=e:GetHandler()
local mg=eg:Filter(Card.IsCanBeFusionMaterial,gc,c)
local g1=Group.CreateGroup()
if not gc and chkf~=PLAYER_NONE then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
gc=mg:FilterSelect(tp,c82734805.fcfilter7,1,1,nil,chkf,c):GetFirst()
g1:AddCard(gc)
end
local ok=false
if gc then
if gc:CheckFusionSubstitute(c) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:FilterSelect(tp,c82734805.fcfilter1,1,1,nil,14799437,23440231,mg)
g1:Merge(sg)
elseif gc:IsFusionCode(14799437) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:FilterSelect(tp,c82734805.fcfilter2,1,1,nil,23440231,mg,c)
g1:Merge(sg)
elseif gc:IsFusionCode(23440231) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:FilterSelect(tp,c82734805.fcfilter2,1,1,nil,14799437,mg,c)
g1:Merge(sg)
elseif c82734805.filter(gc) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:FilterSelect(tp,c82734805.fcfilter3,1,1,nil,mg,c)
g1:Merge(sg)
local tc1=sg:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if tc1:IsFusionCode(14799437) then
local sg=mg:FilterSelect(tp,c82734805.fcfilter4,1,1,nil,23440231,c)
g1:Merge(sg)
elseif tc1:IsFusionCode(23440231) then
local sg=mg:FilterSelect(tp,c82734805.fcfilter4,1,1,nil,14799437,c)
g1:Merge(sg)
else
local sg=mg:FilterSelect(tp,aux.FConditionFilter21,1,1,nil,14799437,23440231)
g1:Merge(sg)
end
ok=true
end
else
local mg2=mg:Filter(c82734805.fcfilter22,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg1=mg2:Select(tp,1,1,nil)
local tc1=sg1:GetFirst()
if not mg:IsExists(c82734805.filter,2,tc1) then
mg2:Remove(c82734805.filter,nil)
end
if tc1:CheckFusionSubstitute(c) then
mg2:Remove(Card.CheckFusionSubstitute,nil,c)
else mg2:Remove(Card.IsFusionCode,nil,tc1:GetCode()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg2=mg2:Select(tp,1,1,nil)
g1:Merge(sg1)
g1:Merge(sg2)
end
mg:Sub(g1)
mg=mg:Filter(c82734805.filter,nil)
if ok and (mg:GetCount()==0 or not Duel.SelectYesNo(tp,93)) then
Duel.SetFusionMaterial(g1)
return
end
if c:GetFlagEffect(31444249)~=0 then
local dmg=mg:Filter(Card.IsLocation,nil,LOCATION_DECK)
mg:Remove(Card.IsLocation,nil,LOCATION_DECK)
if mg:GetCount()==0 or (dmg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(31444249,0))) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=dmg:Select(tp,1,6-g1:FilterCount(Card.IsLocation,nil,LOCATION_DECK),nil)
g1:Merge(sg)
if mg:GetCount()==0 or not Duel.SelectYesNo(tp,93) then
Duel.SetFusionMaterial(g1)
return
end
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:Select(tp,1,99,nil)
g1:Merge(sg)
Duel.SetFusionMaterial(g1)
return
end
--キメラテック・ランページ・ドラゴン --キメラテック・ランページ・ドラゴン
function c84058253.initial_effect(c) function c84058253.initial_effect(c)
c:EnableReviveLimit()
--fusion material --fusion material
local e1=Effect.CreateEffect(c) c:EnableReviveLimit()
e1:SetType(EFFECT_TYPE_SINGLE) aux.AddFusionProcFunRep2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1093),2,63,true)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(c84058253.fscondition)
e1:SetOperation(c84058253.fsoperation)
c:RegisterEffect(e1)
--destroy --destroy
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
...@@ -29,38 +23,6 @@ function c84058253.initial_effect(c) ...@@ -29,38 +23,6 @@ function c84058253.initial_effect(c)
e3:SetOperation(c84058253.tgop) e3:SetOperation(c84058253.tgop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c84058253.ffilter(c,fc)
return c:IsFusionSetCard(0x1093) and not c:IsHasEffect(6205579) and c:IsCanBeFusionMaterial(fc)
end
function c84058253.fscondition(e,g,gc,chkf)
if g==nil then return false end
if gc then return c84058253.ffilter(gc,e:GetHandler()) and g:IsExists(c84058253.ffilter,1,gc,e:GetHandler()) end
local g1=g:Filter(c84058253.ffilter,nil,e:GetHandler())
if chkf~=PLAYER_NONE then
return g1:IsExists(aux.FConditionCheckF,1,nil,chkf) and g1:GetCount()>=2
else return g1:GetCount()>=2 end
end
function c84058253.fsoperation(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,c84058253.ffilter,1,63,gc,e:GetHandler())
Duel.SetFusionMaterial(g1)
return
end
local sg=eg:Filter(c84058253.ffilter,nil,e:GetHandler())
if chkf==PLAYER_NONE or sg:GetCount()==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=sg:Select(tp,2,63,nil)
Duel.SetFusionMaterial(g1)
return
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=sg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=sg:Select(tp,1,63,g1:GetFirst())
g1:Merge(g2)
Duel.SetFusionMaterial(g1)
end
function c84058253.descon(e,tp,eg,ep,ev,re,r,rp) function c84058253.descon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end end
......
...@@ -490,9 +490,9 @@ function Auxiliary.FConditionMix(insf,sub,...) ...@@ -490,9 +490,9 @@ function Auxiliary.FConditionMix(insf,sub,...)
local tp=c:GetControler() local tp=c:GetControler()
local notfusion=bit.rshift(chkfnf,8)~=0 local notfusion=bit.rshift(chkfnf,8)~=0
local sub=sub or notfusion local sub=sub or notfusion
local mg=g:Filter(Auxiliary.FConditionFilterMix,gc,c,sub,table.unpack(funs)) local mg=g:Filter(Auxiliary.FConditionFilterMix,c,c,sub,table.unpack(funs))
if gc then if gc then
if not gc:IsCanBeFusionMaterial(c) then return false end if not mg:IsContains(gc) then return false end
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
return Auxiliary.FSelectMix(gc,tp,mg,sg,c,sub,table.unpack(funs)) return Auxiliary.FSelectMix(gc,tp,mg,sg,c,sub,table.unpack(funs))
end end
...@@ -508,7 +508,7 @@ function Auxiliary.FOperationMix(insf,sub,...) ...@@ -508,7 +508,7 @@ function Auxiliary.FOperationMix(insf,sub,...)
local tp=c:GetControler() local tp=c:GetControler()
local notfusion=bit.rshift(chkfnf,8)~=0 local notfusion=bit.rshift(chkfnf,8)~=0
local sub=sub or notfusion local sub=sub or notfusion
local mg=eg:Filter(Auxiliary.FConditionFilterMix,gc,c,sub,table.unpack(funs)) local mg=eg:Filter(Auxiliary.FConditionFilterMix,c,c,sub,table.unpack(funs))
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
if gc then sg:AddCard(gc) end if gc then sg:AddCard(gc) end
while sg:GetCount()<#funs do while sg:GetCount()<#funs do
...@@ -529,8 +529,12 @@ end ...@@ -529,8 +529,12 @@ end
function Auxiliary.FCheckMix(c,mg,sg,fc,sub,fun1,fun2,...) function Auxiliary.FCheckMix(c,mg,sg,fc,sub,fun1,fun2,...)
if fun2 then if fun2 then
sg:AddCard(c) sg:AddCard(c)
local res=fun1(c,fc,false) and mg:IsExists(Auxiliary.FCheckMix,1,sg,mg,sg,fc,sub,fun2,...) local res=false
or sub and c:CheckFusionSubstitute(fc) and mg:IsExists(Auxiliary.FCheckMix,1,sg,mg,sg,fc,false,fun2,...) if fun1(c,fc,false) then
res=mg:IsExists(Auxiliary.FCheckMix,1,sg,mg,sg,fc,sub,fun2,...)
elseif sub and fun1(c,fc,true) then
res=mg:IsExists(Auxiliary.FCheckMix,1,sg,mg,sg,fc,false,fun2,...)
end
sg:RemoveCard(c) sg:RemoveCard(c)
return res return res
else else
...@@ -554,6 +558,147 @@ function Auxiliary.FSelectMix(c,tp,mg,sg,fc,sub,...) ...@@ -554,6 +558,147 @@ function Auxiliary.FSelectMix(c,tp,mg,sg,fc,sub,...)
sg:RemoveCard(c) sg:RemoveCard(c)
return res return res
end end
--Fusion monster, mixed material * 1 to cc (>1) + material + ...
function Auxiliary.AddFusionProcMixRep(c,sub,insf,cc,...)
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) return val[i](c) and not c:IsHasEffect(6205579) end
else
if sub then
fun[i]=function(c,fc,sub) return c:IsFusionCode(val[i]) or (sub and c:CheckFusionSubstitute(fc)) end
else
fun[i]=function(c) return c:IsFusionCode(val[i]) end
end
table.insert(mat,val[i])
end
end
if #mat>0 and c.material_count==nil then
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=#mat
mt.material=mat
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.FConditionMixRep(insf,sub,cc-1,table.unpack(fun)))
e1:SetOperation(Auxiliary.FOperationMixRep(insf,sub,cc-1,table.unpack(fun)))
c:RegisterEffect(e1)
end
function Auxiliary.FConditionMixRep(insf,sub,cc,...)
local funs={...}
return function(e,g,gc,chkfnf)
if g==nil then return insf end
local chkf=bit.band(chkfnf,0xff)
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=bit.rshift(chkfnf,8)~=0
local sub=sub or notfusion
local mg=g:Filter(Auxiliary.FConditionFilterMix,c,c,sub,table.unpack(funs))
if gc then
if not mg:IsContains(gc) then return false end
local sg=Group.CreateGroup()
return Auxiliary.FSelectMixRep(gc,tp,mg,sg,c,sub,cc,table.unpack(funs))
end
local sg=Group.CreateGroup()
return mg:IsExists(Auxiliary.FSelectMixRep,1,nil,tp,mg,sg,c,sub,cc,table.unpack(funs))
end
end
function Auxiliary.FOperationMixRep(insf,sub,cc,...)
local funs={...}
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local chkf=bit.band(chkfnf,0xff)
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=bit.rshift(chkfnf,8)~=0
local sub=sub or notfusion
local mg=eg:Filter(Auxiliary.FConditionFilterMix,c,c,sub,table.unpack(funs))
local sg=Group.CreateGroup()
if gc then sg:AddCard(gc) end
while sg:GetCount()<cc+#funs do
local cg=mg:Filter(Auxiliary.FSelectMixRep,sg,tp,mg,sg,c,sub,cc,table.unpack(funs))
if cg:GetCount()==0
or (Auxiliary.FCheckMixRepGoal(tp,sg,c,sub,cc,table.unpack(funs))
and not Duel.SelectYesNo(tp,210)) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g=cg:Select(tp,1,1,nil)
sg:Merge(g)
end
Duel.SetFusionMaterial(sg)
end
end
function Auxiliary.FCheckMixRep(c,sg,g,fc,sub,cc,fun1,fun2,...)
g:AddCard(c)
local res=false
if fun2 then
if fun2(c,fc,false) then
res=sg:IsExists(Auxiliary.FCheckMixRep,1,g,sg,g,fc,sub,cc,fun1,...)
elseif sub and fun2(c,fc,true) then
res=sg:IsExists(Auxiliary.FCheckMixRep,1,g,sg,g,fc,false,cc,fun1,...)
end
elseif sub then
local ct1=sg:FilterCount(fun1,g,fc,false)
local ct2=sg:FilterCount(fun1,g,fc,true)
res=ct2<=cc and ct2==sg:GetCount()-g:GetCount() and ct2-ct1<=1
else
local ct=sg:FilterCount(fun1,g,fc,false)
res=ct<=cc and ct==sg:GetCount()-g:GetCount()
end
g:RemoveCard(c)
return res
end
function Auxiliary.FCheckMixRepGoal(tp,sg,fc,sub,cc,...)
if sg:GetCount()<#{...} then return false end
local g=Group.CreateGroup()
return sg:IsExists(Auxiliary.FCheckMixRep,1,nil,sg,g,fc,sub,cc,...) and Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0
and (not Auxiliary.FCheckAdditional or Auxiliary.FCheckAdditional(tp,sg,fc))
end
function Auxiliary.FCheckSelectMixRep(c,tp,mg,sg,g,fc,sub,cc,fun1,fun2,...)
g:AddCard(c)
local res=false
if fun2 then
if fun2(c,fc,false) then
res=mg:IsExists(Auxiliary.FCheckSelectMixRep,1,g,tp,mg,sg,g,fc,sub,cc,fun1,...)
elseif sub and fun2(c,fc,true) then
res=mg:IsExists(Auxiliary.FCheckSelectMixRep,1,g,tp,mg,sg,g,fc,false,cc,fun1,...)
end
else
local ct1=sg:FilterCount(fun1,g,fc,sub)
local ct2=sg:FilterCount(fun1,g,fc,false)
if ct1<=cc and ct1==sg:FilterCount(aux.TRUE,g) and (not sub or ct1-ct2<=1) then
local g2=g:Clone()
g2:Merge(sg)
if Duel.GetLocationCountFromEx(tp,tp,g2,fc)>0 then
res=not Auxiliary.FCheckAdditional or Auxiliary.FCheckAdditional(tp,g2,fc)
elseif cc>0 then
if fun1(c,fc,false) then
res=mg:IsExists(Auxiliary.FCheckSelectMixRep,1,g,tp,mg,sg,g,fc,sub,cc-1,fun1)
elseif sub and fun1(c,fc,true) then
res=mg:IsExists(Auxiliary.FCheckSelectMixRep,1,g,tp,mg,sg,g,fc,false,cc-1,fun1)
end
end
end
end
g:RemoveCard(c)
return res
end
function Auxiliary.FSelectMixRep(c,tp,mg,sg,fc,sub,cc,...)
sg:AddCard(c)
local res=false
if Auxiliary.FCheckMixRepGoal(tp,sg,fc,sub,cc,...) then
res=true
else
local g=Group.CreateGroup()
res=mg:IsExists(Auxiliary.FCheckSelectMixRep,1,nil,tp,mg,sg,g,fc,sub,cc,...)
end
sg:RemoveCard(c)
return res
end
--Fusion monster, name + name --Fusion monster, name + name
function Auxiliary.AddFusionProcCode2(c,code1,code2,sub,insf) function Auxiliary.AddFusionProcCode2(c,code1,code2,sub,insf)
Auxiliary.AddFusionProcMix(c,sub,insf,code1,code2) Auxiliary.AddFusionProcMix(c,sub,insf,code1,code2)
...@@ -581,6 +726,21 @@ function Auxiliary.AddFusionProcCodeRep(c,code1,cc,sub,insf) ...@@ -581,6 +726,21 @@ function Auxiliary.AddFusionProcCodeRep(c,code1,cc,sub,insf)
end end
Auxiliary.AddFusionProcMix(c,sub,insf,table.unpack(code)) Auxiliary.AddFusionProcMix(c,sub,insf,table.unpack(code))
end end
--Fusion monster, name * minc to maxc
function Auxiliary.AddFusionProcCodeRep2(c,code1,minc,maxc,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local code={}
for i=1,minc-1 do
code[i]=code1
end
if c.material_count==nil then
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=1
mt.material={code1}
end
Auxiliary.AddFusionProcMixRep(c,sub,insf,maxc-minc+1,code1,table.unpack(code))
end
--Fusion monster, name + condition * n --Fusion monster, name + condition * n
function Auxiliary.AddFusionProcCodeFun(c,code1,f,cc,sub,insf) function Auxiliary.AddFusionProcCodeFun(c,code1,f,cc,sub,insf)
local fun={} local fun={}
...@@ -601,6 +761,15 @@ function Auxiliary.AddFusionProcFunRep(c,f,cc,insf) ...@@ -601,6 +761,15 @@ function Auxiliary.AddFusionProcFunRep(c,f,cc,insf)
end end
Auxiliary.AddFusionProcMix(c,false,insf,table.unpack(fun)) Auxiliary.AddFusionProcMix(c,false,insf,table.unpack(fun))
end end
--Fusion monster, condition * minc to maxc
function Auxiliary.AddFusionProcFunRep2(c,f,minc,maxc,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local fun={}
for i=1,minc-1 do
fun[i]=f
end
Auxiliary.AddFusionProcMixRep(c,false,insf,maxc-minc+1,f,table.unpack(fun))
end
--Fusion monster, condition1 + condition2 * n --Fusion monster, condition1 + condition2 * n
function Auxiliary.AddFusionProcFunFun(c,f1,f2,cc,insf) function Auxiliary.AddFusionProcFunFun(c,f1,f2,cc,insf)
local fun={} local fun={}
...@@ -611,168 +780,27 @@ function Auxiliary.AddFusionProcFunFun(c,f1,f2,cc,insf) ...@@ -611,168 +780,27 @@ function Auxiliary.AddFusionProcFunFun(c,f1,f2,cc,insf)
end end
--Fusion monster, condition1 + condition2 * minc to maxc --Fusion monster, condition1 + condition2 * minc to maxc
function Auxiliary.AddFusionProcFunFunRep(c,f1,f2,minc,maxc,insf) function Auxiliary.AddFusionProcFunFunRep(c,f1,f2,minc,maxc,insf)
local f1=function(c) return f1(c) and not c:IsHasEffect(6205579) end local fun={}
local f2=function(c) return f2(c) and not c:IsHasEffect(6205579) end for i=1,minc-1 do
local e1=Effect.CreateEffect(c) fun[i]=f2
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,chkf)
if not f1(c) then return false end
if chkf==PLAYER_NONE or aux.FConditionCheckF(c,chkf) then
return minc<=0 or mg:IsExists(f2,minc,c)
else
local mg2=mg:Filter(f2,c)
return mg2:GetCount()>=minc and mg2:IsExists(aux.FConditionCheckF,1,nil,chkf)
end end
end Auxiliary.AddFusionProcMixRep(c,false,insf,maxc-minc+1,f2,f1,table.unpack(fun))
function Auxiliary.FConditionFunFunRep(f1,f2,minc,maxc,insf)
return function(e,g,gc,chkfnf)
if g==nil then return insf end
local chkf=bit.band(chkfnf,0xff)
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler())
if gc then
if not gc:IsCanBeFusionMaterial(e:GetHandler()) then return false end
if aux.FConditionFilterFFR(gc,f1,f2,mg,minc,chkf) then
return true
elseif f2(gc) then
mg:RemoveCard(gc)
if aux.FConditionCheckF(gc,chkf) then chkf=PLAYER_NONE end
return mg:IsExists(aux.FConditionFilterFFR,1,nil,f1,f2,mg,minc-1,chkf)
else return false end
end
return mg:IsExists(aux.FConditionFilterFFR,1,nil,f1,f2,mg,minc,chkf)
end
end
function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local chkf=bit.band(chkfnf,0xff)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler())
local minct=minc
local maxct=maxc
if gc then
g:RemoveCard(gc)
if aux.FConditionFilterFFR(gc,f1,f2,g,minct,chkf) then
if aux.FConditionCheckF(gc,chkf) then chkf=PLAYER_NONE end
local g1=Group.CreateGroup()
if f2(gc) then
local mg1=g:Filter(aux.FConditionFilterFFR,nil,f1,f2,g,minct-1,chkf)
if mg1:GetCount()>0 then
--if gc fits both, should allow an extra material that fits f1 but doesn't fit f2
local mg2=g:Filter(f2,nil)
mg1:Merge(mg2)
if chkf~=PLAYER_NONE then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg1:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
g1:Merge(sg)
mg1:Sub(sg)
minct=minct-1
maxct=maxct-1
if not f2(sg:GetFirst()) then
if mg1:GetCount()>0 and maxct>0 and (minct>0 or Duel.SelectYesNo(tp,93)) then
if minct<=0 then minct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg1:FilterSelect(tp,f2,minct,maxct,nil)
g1:Merge(sg)
end
Duel.SetFusionMaterial(g1)
return
end
end
if maxct>1 and (minct>1 or Duel.SelectYesNo(tp,93)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg1:FilterSelect(tp,f2,minct-1,maxct-1,nil)
g1:Merge(sg)
mg1:Sub(sg)
local ct=sg:GetCount()
minct=minct-ct
maxct=maxct-ct
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg1:Select(tp,1,1,nil)
g1:Merge(sg)
mg1:Sub(sg)
minct=minct-1
maxct=maxct-1
if mg1:GetCount()>0 and maxct>0 and (minct>0 or Duel.SelectYesNo(tp,93)) then
if minct<=0 then minct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg1:FilterSelect(tp,f2,minct,maxct,nil)
g1:Merge(sg)
end
Duel.SetFusionMaterial(g1)
return
end
end
local mg=g:Filter(f2,nil)
if chkf~=PLAYER_NONE then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
g1:Merge(sg)
mg:Sub(sg)
minct=minct-1
maxct=maxct-1
end
if mg:GetCount()>0 and maxct>0 and (minct>0 or Duel.SelectYesNo(tp,93)) then
if minct<=0 then minct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:Select(tp,minct,maxct,nil)
g1:Merge(sg)
end
Duel.SetFusionMaterial(g1)
return
else
if aux.FConditionCheckF(gc,chkf) then chkf=PLAYER_NONE end
minct=minct-1
maxct=maxct-1
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=g:FilterSelect(tp,aux.FConditionFilterFFR,1,1,nil,f1,f2,g,minct,chkf)
local mg=g:Filter(f2,g1:GetFirst())
if chkf~=PLAYER_NONE and not aux.FConditionCheckF(g1:GetFirst(),chkf) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
g1:Merge(sg)
mg:Sub(sg)
minct=minct-1
maxct=maxct-1
end
if mg:GetCount()>0 and maxct>0 and (minct>0 or Duel.SelectYesNo(tp,93)) then
if minct<=0 then minct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:Select(tp,minct,maxct,nil)
g1:Merge(sg)
end
Duel.SetFusionMaterial(g1)
end
end
function Auxiliary.FilterBoolFunctionCFR(code,sub,fc)
return function(target)
return target:IsFusionCode(code) or (sub and target:CheckFusionSubstitute(fc))
end
end end
--Fusion monster, name + condition * minc to maxc --Fusion monster, name + condition * minc to maxc
function Auxiliary.AddFusionProcCodeFunRep(c,code1,f,minc,maxc,sub,insf) function Auxiliary.AddFusionProcCodeFunRep(c,code1,f,minc,maxc,sub,insf)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end local fun={}
if c.material_count==nil then for i=1,minc-1 do
local code=c:GetOriginalCode() fun[i]=f
local mt=_G["c" .. code]
mt.material_count=1
mt.material={code1}
end end
local f=function(c) return f(c) and not c:IsHasEffect(6205579) end Auxiliary.AddFusionProcMixRep(c,sub,insf,maxc-minc+1,f,code1,table.unpack(fun))
local e1=Effect.CreateEffect(c) end
e1:SetType(EFFECT_TYPE_SINGLE) --Fusion monster, name + name + condition * minc to maxc
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) function Auxiliary.AddFusionProcCode2FunRep(c,code1,code2,f,minc,maxc,sub,insf)
e1:SetCode(EFFECT_FUSION_MATERIAL) local fun={}
e1:SetCondition(Auxiliary.FConditionFunFunRep(Auxiliary.FilterBoolFunctionCFR(code1,sub,c),f,minc,maxc,insf)) for i=1,minc-1 do
e1:SetOperation(Auxiliary.FOperationFunFunRep(Auxiliary.FilterBoolFunctionCFR(code1,sub,c),f,minc,maxc,insf)) fun[i]=f
c:RegisterEffect(e1) end
Auxiliary.AddFusionProcMixRep(c,sub,insf,maxc-minc+1,f,code1,code2,table.unpack(fun))
end end
--Ritual Summon, geq fixed lv --Ritual Summon, geq fixed lv
function Auxiliary.AddRitualProcGreater(c,filter) function Auxiliary.AddRitualProcGreater(c,filter)
...@@ -1142,14 +1170,14 @@ end ...@@ -1142,14 +1170,14 @@ end
function Auxiliary.LCheckRecursive(c,tp,sg,mg,lc,ct,minc,maxc) function Auxiliary.LCheckRecursive(c,tp,sg,mg,lc,ct,minc,maxc)
sg:AddCard(c) sg:AddCard(c)
ct=ct+1 ct=ct+1
local res=(ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc)) local res=Auxiliary.LCheckGoal(tp,sg,lc,minc,ct)
or (ct>=minc and Auxiliary.LCheckGoal(tp,sg,lc,ct)) or (ct<maxc and mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,lc,ct,minc,maxc))
sg:RemoveCard(c) sg:RemoveCard(c)
ct=ct-1 ct=ct-1
return res return res
end end
function Auxiliary.LCheckGoal(tp,sg,lc,ct) function Auxiliary.LCheckGoal(tp,sg,lc,minc,ct)
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 return ct>=minc and sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
end end
function Auxiliary.LinkCondition(f,minc,maxc) function Auxiliary.LinkCondition(f,minc,maxc)
return function(e,c) return function(e,c)
...@@ -1165,12 +1193,12 @@ function Auxiliary.LinkOperation(f,minc,maxc) ...@@ -1165,12 +1193,12 @@ function Auxiliary.LinkOperation(f,minc,maxc)
return function(e,tp,eg,ep,ev,re,r,rp,c) return function(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f) local mg=Duel.GetMatchingGroup(Auxiliary.LConditionFilter,tp,LOCATION_MZONE,0,nil,f)
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
for i=1,maxc do for i=0,maxc-1 do
local g=mg:FilterSelect(tp,Auxiliary.LCheckRecursive,1,1,sg,tp,sg,mg,c,i-1,minc,maxc) local cg=mg:Filter(Auxiliary.LCheckRecursive,sg,tp,sg,mg,c,i,minc,maxc)
if cg:GetCount()==0
or (Auxiliary.LCheckGoal(tp,sg,c,minc,i) and not Duel.SelectYesNo(tp,210)) then break end
local g=cg:Select(tp,1,1,nil)
sg:Merge(g) sg:Merge(g)
if i>=minc and i<maxc and Auxiliary.LCheckGoal(tp,sg,c,i)
and (not mg:IsExists(Auxiliary.LCheckRecursive,1,sg,tp,sg,mg,c,i,minc,maxc)
or not Duel.SelectYesNo(tp,210)) then break end
end end
c:SetMaterial(sg) c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK) Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK)
......
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