Commit 3d3a25a1 authored by Grajade's avatar Grajade

Update c74563015.lua

parent faa9f404
Pipeline #11227 passed with stage
in 38 seconds
......@@ -130,71 +130,46 @@ function c74563015.eqop(e,tp,eg,ep,ev,re,r,rp)
tc=dg:GetNext()
end
end
function c74563015.exfilter1(c,fc)
return c74563015.allfilter1(c,fc) and c:IsCode(74563024) and c:IsAbleToRemove()
--
function c74563015.ExFusFilter(c,fc)
return c74563015.AllFusFilter(c,fc) and c:IsCode(74563024) and c:IsAbleToRemove()
end
function c74563015.allfilter1(c,fc)
return c:IsCanBeFusionMaterial(fc) and c:IsFusionType(TYPE_MONSTER)
and (c:IsFusionSetCard(0x258) or c:IsFusionAttribute(ATTRIBUTE_WATER) or c:IsFusionAttribute(ATTRIBUTE_LIGHT))
function c74563015.AllFusFilter(c,fc)
return c:IsCanBeFusionMaterial(fc) and c:IsFusionType(TYPE_MONSTER) and (c74563015.CheckFusFilter1(c) or c74563015.CheckFusFilter2(c))
end
--
function c74563015.CheckFusionFilter1(c,sg,tc)
local check1=0
local check2=0
local sc=sg:GetFirst()
while sc do
if sc:IsFusionSetCard(0x258) then check1=1 end
if (sc:IsFusionAttribute(ATTRIBUTE_WATER) or sc:IsFusionAttribute(ATTRIBUTE_LIGHT)) then check2=1 end
sc=sg:GetNext()
end
return (check1==0 and (tc:IsFusionSetCard(0x258)))
or (check2==0 and (tc:IsFusionAttribute(ATTRIBUTE_LIGHT) or tc:IsFusionAttribute(ATTRIBUTE_WATER)))
end
function c74563015.CheckRecursive1(c,mg,sg,exg,tp,fc,chkf)
--if exg and exg:IsContains(c) then return false end
if sg:GetCount()>0 and not sg:IsExists(c74563015.CheckFusionFilter1,1,nil,sg,c) then return false end
sg:AddCard(c)
if Duel.GetLocationCountFromEx(tp,tp,sg,c)<0 then return false end
local res=false
if sg:GetCount()==2 then
res=(chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(chkf,tp,sg,fc)>0)
if aux.FCheckAdditional and not aux.FCheckAdditional(tp,sg,fc) then res=false end
else
res=mg:IsExists(c74563015.CheckRecursive1,1,sg,mg,sg,exg,tp,fc,PLAYER_NONE)
end
sg:RemoveCard(c)
return res
function c74563015.CheckFusFilter1(c)
return c:IsFusionSetCard(0x258)
end
function c74563015.CheckFusFilter2(c)
return c:IsFusionAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_WATER)
end
function c74563015.CheckGroupFilter(sg,lc)
return (not lc) or (lc and sg:IsContains(lc))
end
--
function c74563015.con1(e,g,gc,chkfnf)
if g==nil then return true end
local sg=Group.CreateGroup()
local chkf=(chkfnf & 0xff)
local c=e:GetHandler()
local tp=c:GetControler()
local mg=g:Filter(c74563015.allfilter1,nil,c)
local exg=Duel.GetMatchingGroup(c74563015.exfilter1,tp,LOCATION_GRAVE,0,mg,c)
local mg=g:Filter(c74563015.AllFusFilter,nil,c)
local exg=Duel.GetMatchingGroup(c74563015.ExFusFilter,tp,LOCATION_GRAVE,0,mg,c)
mg:Merge(exg)
if gc then return c74563015.allfilter1(gc,c)
and c74563015.CheckRecursive1(gc,mg,sg,exg,tp,c,chkf) end
return mg:IsExists(c74563015.CheckRecursive1,1,sg,mg,sg,exg,tp,c,chkf)
local checks={c74563015.CheckFusFilter1,c74563015.CheckFusFilter2}
return mg:CheckSubGroupEach(checks,c74563015.CheckGroupFilter,gc)
end
--
function c74563015.op1(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local c=e:GetHandler()
local chkf=(chkfnf & 0xff)
local mg=eg:Filter(c74563015.allfilter1,nil,c)
local exg=Duel.GetMatchingGroup(c74563015.exfilter1,tp,LOCATION_GRAVE,0,mg,c)
local mg=eg:Filter(c74563015.AllFusFilter,nil,c)
local exg=Duel.GetMatchingGroup(c74563015.ExFusFilter,tp,LOCATION_GRAVE,0,mg,c)
mg:Merge(exg)
local sg=Group.CreateGroup()
if gc then sg:AddCard(gc) end
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g=mg:FilterSelect(tp,c74563015.CheckRecursive1,1,1,sg,mg,sg,exg,tp,c,chkf)
sg:Merge(g)
until sg:GetCount()==2
local checks={c74563015.CheckFusFilter1,c74563015.CheckFusFilter2}
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local sg=mg:SelectSubGroupEach(tp,checks,false,c74563015.CheckGroupFilter,gc)
Duel.SetFusionMaterial(sg)
end
--
c74563015.OriginalSetMaterial=Card.SetMaterial
function c74563015.SetMaterial(c,g)
c74563015.OriginalSetMaterial(c,g)
......
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