Commit 80013bb7 authored by VanillaSalt's avatar VanillaSalt

fix

parent dcecf199
...@@ -390,6 +390,7 @@ function Auxiliary.FConditionCode3(code1,code2,code3,sub,insf) ...@@ -390,6 +390,7 @@ function Auxiliary.FConditionCode3(code1,code2,code3,sub,insf)
if code==code1 then b1=1 if code==code1 then b1=1
elseif code==code2 then b2=1 elseif code==code2 then b2=1
elseif code==code3 then b3=1 elseif code==code3 then b3=1
else return false
end end
return b1+b2+b3>2 return b1+b2+b3>2
end end
...@@ -488,6 +489,7 @@ function Auxiliary.FConditionCode4(code1,code2,code3,code4,sub,insf) ...@@ -488,6 +489,7 @@ function Auxiliary.FConditionCode4(code1,code2,code3,code4,sub,insf)
elseif code==code2 then b2=1 elseif code==code2 then b2=1
elseif code==code3 then b3=1 elseif code==code3 then b3=1
elseif code==code4 then b4=1 elseif code==code4 then b4=1
else return false
end end
tc=g:GetNext() tc=g:GetNext()
end end
...@@ -595,8 +597,26 @@ end ...@@ -595,8 +597,26 @@ end
function Auxiliary.FConditionCodeFun(code,f,cc,sub,insf) function Auxiliary.FConditionCodeFun(code,f,cc,sub,insf)
return function(e,g,gc,chkf) return function(e,g,gc,chkf)
if g==nil then return insf end if g==nil then return insf end
if gc then return (gc:IsCode(code) or (sub and gc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE))) if gc then
and g:IsExists(f,cc,nil) end if gc:IsCode(code) or (sub and gc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)) then
return g:IsExists(f,cc,gc)
elseif f(gc) then
local g1=Group.CreateGroup() local g2=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
if tc:IsCode(code) or (sub and tc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE))
then g1:AddCard(tc) end
if f(tc) then g2:AddCard(tc) end
tc=g:GetNext()
end
if cc>1 then
g2:RemoveCard(gc)
return g1:IsExists(Auxiliary.FConditionFilterCF,1,nil,g2,cc-1)
else
return g1:GetCount()>0
end
else return false end
end
local g1=Group.CreateGroup() local g2=Group.CreateGroup() local fs=false local g1=Group.CreateGroup() local g2=Group.CreateGroup() local fs=false
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
...@@ -613,9 +633,35 @@ end ...@@ -613,9 +633,35 @@ end
function Auxiliary.FOperationCodeFun(code,f,cc,sub,insf) function Auxiliary.FOperationCodeFun(code,f,cc,sub,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf) return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then if gc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) if gc:IsCode(code) or (sub and gc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)) then
local g1=eg:FilterSelect(tp,f,cc,cc,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
Duel.SetFusionMaterial(g1) local g1=eg:FilterSelect(tp,f,cc,cc,gc)
Duel.SetFusionMaterial(g1)
else
local sg1=Group.CreateGroup() local sg2=Group.CreateGroup()
local tc=eg:GetFirst()
while tc do
if tc:IsCode(code) or (sub and tc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)) then sg1:AddCard(tc) end
if f(tc) then sg2:AddCard(tc) end
tc=eg:GetNext()
end
if cc>1 then
sg2:RemoveCard(gc)
if sg2:GetCount()==cc-1 then
sg1:Sub(sg2)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=sg1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=sg2:Select(tp,cc-1,cc-1,g1:GetFirst())
g1:Merge(g2)
Duel.SetFusionMaterial(g1)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=sg1:Select(tp,1,1,nil)
Duel.SetFusionMaterial(g1)
end
end
return return
end end
local sg1=Group.CreateGroup() local sg2=Group.CreateGroup() local fs=false local sg1=Group.CreateGroup() local sg2=Group.CreateGroup() local fs=false
...@@ -748,7 +794,7 @@ end ...@@ -748,7 +794,7 @@ end
function Auxiliary.FConditionCodeRep(code,cc,sub,insf) function Auxiliary.FConditionCodeRep(code,cc,sub,insf)
return function(e,g,gc,chkf) return function(e,g,gc,chkf)
if g==nil then return insf end if g==nil then return insf end
if gc then return gc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE) and g:IsExists(Card.IsCode,cc-1,nil,code) end if gc then return (gc:IsCode(code) or gc:IsHasEffect(EFFECT_FUSION_SUBSTITUTE)) and g:IsExists(Card.IsCode,cc-1,gc,code) end
local g1=g:Filter(Card.IsCode,nil,code) local g1=g:Filter(Card.IsCode,nil,code)
if not sub then if not sub then
if chkf~=PLAYER_NONE then return g1:GetCount()>=cc and g1:FilterCount(Card.IsOnField,nil)~=0 if chkf~=PLAYER_NONE then return g1:GetCount()>=cc and g1:FilterCount(Card.IsOnField,nil)~=0
...@@ -765,7 +811,7 @@ function Auxiliary.FOperationCodeRep(code,cc,sub,insf) ...@@ -765,7 +811,7 @@ function Auxiliary.FOperationCodeRep(code,cc,sub,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf) return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then if gc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,Card.IsCode,cc-1,cc-1,nil,code) local g1=eg:FilterSelect(tp,Card.IsCode,cc-1,cc-1,gc,code)
Duel.SetFusionMaterial(g1) Duel.SetFusionMaterial(g1)
return return
end end
...@@ -798,7 +844,7 @@ end ...@@ -798,7 +844,7 @@ end
function Auxiliary.FConditionFunRep(f,cc,insf) function Auxiliary.FConditionFunRep(f,cc,insf)
return function(e,g,gc,chkf) return function(e,g,gc,chkf)
if g==nil then return insf end if g==nil then return insf end
if gc then return f(gc) and g:IsExists(f,cc-1,nil) end if gc then return f(gc) and g:IsExists(f,cc-1,gc) end
local g1=g:Filter(f,nil) local g1=g:Filter(f,nil)
if chkf~=PLAYER_NONE then if chkf~=PLAYER_NONE then
return g1:FilterCount(Card.IsOnField,nil)~=0 and g1:GetCount()>=cc return g1:FilterCount(Card.IsOnField,nil)~=0 and g1:GetCount()>=cc
...@@ -809,7 +855,7 @@ function Auxiliary.FOperationFunRep(f,cc,insf) ...@@ -809,7 +855,7 @@ function Auxiliary.FOperationFunRep(f,cc,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf) return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then if gc then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=eg:FilterSelect(tp,f,cc-1,cc-1,nil) local g1=eg:FilterSelect(tp,f,cc-1,cc-1,gc)
Duel.SetFusionMaterial(g1) Duel.SetFusionMaterial(g1)
return return
end end
...@@ -1037,7 +1083,7 @@ function Auxiliary.PendOperation() ...@@ -1037,7 +1083,7 @@ function Auxiliary.PendOperation()
end end
end end
function Auxiliary.disfilter1(c) function Auxiliary.disfilter1(c)
return c:IsFaceup() and not c:IsDisabled() return c:IsFaceup() and not c:IsDisabled()
and (c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)>0) and (c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)>0)
end end
function Auxiliary.atrst(e,tp,eg,ep,ev,re,r,rp) function Auxiliary.atrst(e,tp,eg,ep,ev,re,r,rp)
......
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