Commit 42ffded1 authored by VanillaSalt's avatar VanillaSalt

fix

parent 674bfdde
...@@ -37,118 +37,70 @@ function c19261966.initial_effect(c) ...@@ -37,118 +37,70 @@ function c19261966.initial_effect(c)
e4:SetOperation(c19261966.thop) e4:SetOperation(c19261966.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c19261966.ffilter(c,fc)
return (c19261966.ffilter1(c) or c19261966.ffilter2(c)) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c19261966.exfilter(c,fc)
return c:IsFaceup() and c19261966.ffilter(c,fc)
end
function c19261966.ffilter1(c) function c19261966.ffilter1(c)
return c:IsFusionSetCard(0x9d) and not c:IsHasEffect(6205579) return c:IsFusionSetCard(0x9d)
end end
function c19261966.ffilter2(c) function c19261966.ffilter2(c)
return (c:IsFusionAttribute(ATTRIBUTE_WATER) or c:IsHasEffect(4904633)) and not c:IsHasEffect(6205579) return c:IsFusionAttribute(ATTRIBUTE_WATER) or c:IsHasEffect(4904633)
end
function c19261966.spfilter1(c,tp,mg,exg)
return mg:IsExists(c19261966.spfilter2,1,c,tp,c) or (exg and exg:IsExists(c19261966.spfilter2,1,c,tp,c))
end end
function c19261966.exfilter(c,g) function c19261966.spfilter2(c,tp,mc)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not g:IsContains(c) return (c19261966.ffilter1(c) and c19261966.ffilter2(mc)
or c19261966.ffilter2(c) and c19261966.ffilter1(mc))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end end
function c19261966.fuscon(e,g,gc,chkf) function c19261966.fuscon(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=g:Filter(c19261966.ffilter,nil,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c19261966.exfilter,tp,0,LOCATION_MZONE,nil,mg) exg=Duel.GetMatchingGroup(c19261966.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
if gc then if gc then
if not gc:IsCanBeFusionMaterial(e:GetHandler()) then return false end if not mg:IsContains(gc) then return false end
return (c19261966.ffilter1(gc) and (mg:IsExists(c19261966.ffilter2,1,gc) or exg:IsExists(c19261966.ffilter2,1,gc))) return c19261966.spfilter1(gc,tp,mg,exg)
or (c19261966.ffilter2(gc) and (mg:IsExists(c19261966.ffilter1,1,gc) or exg:IsExists(c19261966.ffilter1,1,gc)))
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local g3=Group.CreateGroup()
local g4=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
if c19261966.ffilter1(tc) then
g1:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g3:AddCard(tc) end
end
if c19261966.ffilter2(tc) then
g2:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g4:AddCard(tc) end
end
tc=mg:GetNext()
end
local exg1=exg:Filter(c19261966.ffilter1,nil)
local exg2=exg:Filter(c19261966.ffilter2,nil)
if chkf~=PLAYER_NONE then
return (g3:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g3:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g4:IsExists(aux.FConditionFilterF2,1,nil,g1)
or g4:IsExists(aux.FConditionFilterF2,1,nil,exg1))
else
return (g1:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g1:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g2:IsExists(aux.FConditionFilterF2,1,nil,exg1))
end end
return mg:IsExists(c19261966.spfilter1,1,nil,tp,mg,exg)
end end
function c19261966.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) function c19261966.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=eg:Filter(c19261966.ffilter,nil,c)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c19261966.exfilter,tp,0,LOCATION_MZONE,nil,g) exg=Duel.GetMatchingGroup(c19261966.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
local g=nil
if gc then if gc then
local sg1=Group.CreateGroup() g=Group.FromCards(gc)
local sg2=Group.CreateGroup() mg:RemoveCard(gc)
if c19261966.ffilter1(gc) then else
sg1:Merge(g:Filter(c19261966.ffilter2,gc)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg2:Merge(exg:Filter(c19261966.ffilter2,gc)) g=mg:FilterSelect(tp,c19261966.spfilter1,1,1,nil,tp,mg,exg)
end mg:Sub(g)
if c19261966.ffilter2(gc) then
sg1:Merge(g:Filter(c19261966.ffilter1,gc))
sg2:Merge(exg:Filter(c19261966.ffilter1,gc))
end
local g1=nil
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg2:Select(tp,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg1:Select(tp,1,1,nil)
end
Duel.SetFusionMaterial(g1)
return
end
local sg=g:Filter(aux.FConditionFilterF2c,nil,c19261966.ffilter1,c19261966.ffilter2)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then
g1=sg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
local sg1=Group.CreateGroup()
local sg2=Group.CreateGroup()
if c19261966.ffilter1(tc1) then
sg1:Merge(sg:Filter(c19261966.ffilter2,tc1))
sg2:Merge(exg:Filter(c19261966.ffilter2,tc1))
end
if c19261966.ffilter2(tc1) then
sg1:Merge(sg:Filter(c19261966.ffilter1,tc1))
sg2:Merge(exg:Filter(c19261966.ffilter1,tc1))
end end
local g2=nil if exg and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT) fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg2:Select(tp,1,1,nil) local sg=exg:FilterSelect(tp,c19261966.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg1:Select(tp,1,1,nil) local sg=mg:FilterSelect(tp,c19261966.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
end end
g1:Merge(g2) Duel.SetFusionMaterial(g)
Duel.SetFusionMaterial(g1)
end end
function c19261966.splimit(e,se,sp,st) function c19261966.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
......
...@@ -48,118 +48,70 @@ function c20366274.initial_effect(c) ...@@ -48,118 +48,70 @@ function c20366274.initial_effect(c)
e5:SetOperation(c20366274.thop) e5:SetOperation(c20366274.thop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c20366274.ffilter(c,fc)
return (c20366274.ffilter1(c) or c20366274.ffilter2(c)) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c20366274.exfilter(c,fc)
return c:IsFaceup() and c20366274.ffilter(c,fc)
end
function c20366274.ffilter1(c) function c20366274.ffilter1(c)
return c:IsFusionSetCard(0x9d) and not c:IsHasEffect(6205579) return c:IsFusionSetCard(0x9d)
end end
function c20366274.ffilter2(c) function c20366274.ffilter2(c)
return (c:IsFusionAttribute(ATTRIBUTE_LIGHT) or c:IsHasEffect(4904633)) and not c:IsHasEffect(6205579) return c:IsFusionAttribute(ATTRIBUTE_LIGHT) or c:IsHasEffect(4904633)
end
function c20366274.spfilter1(c,tp,mg,exg)
return mg:IsExists(c20366274.spfilter2,1,c,tp,c) or (exg and exg:IsExists(c20366274.spfilter2,1,c,tp,c))
end end
function c20366274.exfilter(c,g) function c20366274.spfilter2(c,tp,mc)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not g:IsContains(c) return (c20366274.ffilter1(c) and c20366274.ffilter2(mc)
or c20366274.ffilter2(c) and c20366274.ffilter1(mc))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end end
function c20366274.fuscon(e,g,gc,chkf) function c20366274.fuscon(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=g:Filter(c20366274.ffilter,nil,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c20366274.exfilter,tp,0,LOCATION_MZONE,nil,mg) exg=Duel.GetMatchingGroup(c20366274.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
if gc then if gc then
if not gc:IsCanBeFusionMaterial(e:GetHandler()) then return false end if not mg:IsContains(gc) then return false end
return (c20366274.ffilter1(gc) and (mg:IsExists(c20366274.ffilter2,1,gc) or exg:IsExists(c20366274.ffilter2,1,gc))) return c20366274.spfilter1(gc,tp,mg,exg)
or (c20366274.ffilter2(gc) and (mg:IsExists(c20366274.ffilter1,1,gc) or exg:IsExists(c20366274.ffilter1,1,gc)))
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local g3=Group.CreateGroup()
local g4=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
if c20366274.ffilter1(tc) then
g1:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g3:AddCard(tc) end
end
if c20366274.ffilter2(tc) then
g2:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g4:AddCard(tc) end
end
tc=mg:GetNext()
end
local exg1=exg:Filter(c20366274.ffilter1,nil)
local exg2=exg:Filter(c20366274.ffilter2,nil)
if chkf~=PLAYER_NONE then
return (g3:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g3:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g4:IsExists(aux.FConditionFilterF2,1,nil,g1)
or g4:IsExists(aux.FConditionFilterF2,1,nil,exg1))
else
return (g1:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g1:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g2:IsExists(aux.FConditionFilterF2,1,nil,exg1))
end end
return mg:IsExists(c20366274.spfilter1,1,nil,tp,mg,exg)
end end
function c20366274.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) function c20366274.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=eg:Filter(c20366274.ffilter,nil,c)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c20366274.exfilter,tp,0,LOCATION_MZONE,nil,g) exg=Duel.GetMatchingGroup(c20366274.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
local g=nil
if gc then if gc then
local sg1=Group.CreateGroup() g=Group.FromCards(gc)
local sg2=Group.CreateGroup() mg:RemoveCard(gc)
if c20366274.ffilter1(gc) then else
sg1:Merge(g:Filter(c20366274.ffilter2,gc)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg2:Merge(exg:Filter(c20366274.ffilter2,gc)) g=mg:FilterSelect(tp,c20366274.spfilter1,1,1,nil,tp,mg,exg)
end mg:Sub(g)
if c20366274.ffilter2(gc) then
sg1:Merge(g:Filter(c20366274.ffilter1,gc))
sg2:Merge(exg:Filter(c20366274.ffilter1,gc))
end
local g1=nil
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg2:Select(tp,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg1:Select(tp,1,1,nil)
end
Duel.SetFusionMaterial(g1)
return
end
local sg=g:Filter(aux.FConditionFilterF2c,nil,c20366274.ffilter1,c20366274.ffilter2)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then
g1=sg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
local sg1=Group.CreateGroup()
local sg2=Group.CreateGroup()
if c20366274.ffilter1(tc1) then
sg1:Merge(sg:Filter(c20366274.ffilter2,tc1))
sg2:Merge(exg:Filter(c20366274.ffilter2,tc1))
end
if c20366274.ffilter2(tc1) then
sg1:Merge(sg:Filter(c20366274.ffilter1,tc1))
sg2:Merge(exg:Filter(c20366274.ffilter1,tc1))
end end
local g2=nil if exg and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT) fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg2:Select(tp,1,1,nil) local sg=exg:FilterSelect(tp,c20366274.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg1:Select(tp,1,1,nil) local sg=mg:FilterSelect(tp,c20366274.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
end end
g1:Merge(g2) Duel.SetFusionMaterial(g)
Duel.SetFusionMaterial(g1)
end end
function c20366274.splimit(e,se,sp,st) function c20366274.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
......
...@@ -25,65 +25,63 @@ function c22198672.initial_effect(c) ...@@ -25,65 +25,63 @@ function c22198672.initial_effect(c)
e3:SetOperation(c22198672.chop) e3:SetOperation(c22198672.chop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c22198672.filter(c,tp) function c22198672.filter(c)
if c:IsFacedown() or not c:IsType(TYPE_LINK) then return false end if not c:IsType(TYPE_LINK) then return false end
local zone=c:GetLinkedZone() local p=c:GetControler()
if c:GetSequence()>4 then zone=bit.band(zone,0xfff) end local zone=bit.band(c:GetLinkedZone(),0x1f)
if c:IsControler(1-tp) then zone=bit.lshift(zone,0x10) end return Duel.GetLocationCount(p,LOCATION_MZONE,p,LOCATION_REASON_CONTROL,zone)>0
return zone~=0
end end
function c22198672.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22198672.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22198672.filter(chkc,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22198672.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22198672.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(c22198672.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(22198672,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(22198672,2))
Duel.SelectTarget(tp,c22198672.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp) Duel.SelectTarget(tp,c22198672.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end end
function c22198672.seqop(e,tp,eg,ep,ev,re,r,rp) function c22198672.seqop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
local zone=tc:GetLinkedZone() local p=tc:GetControler()
if tc:GetSequence()>4 then zone=bit.band(zone,0xfff) end local zone=bit.band(tc:GetLinkedZone(),0x1f)
if tc:IsControler(1-tp) then zone=bit.lshift(zone,0x10) end if Duel.GetLocationCount(p,LOCATION_MZONE,p,LOCATION_REASON_CONTROL,zone)>0 then
if zone~=0 then
local flag=0
local s=0 local s=0
if tc:IsControler(tp) then if tc:IsControler(tp) then
flag=bit.bxor(zone,0xff) local flag=bit.bxor(zone,0xff)
Duel.Hint(HINT_SELECTMSG,tp,571) Duel.Hint(HINT_SELECTMSG,tp,571)
s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag) s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
else else
flag=bit.bxor(zone,0xff0000) local flag=bit.bxor(zone,0xff)*0x10000
Duel.Hint(HINT_SELECTMSG,tp,571) Duel.Hint(HINT_SELECTMSG,tp,571)
s=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,flag) s=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,flag)/0x10000
end end
local nseq=0 local nseq=0
if s==1 or s==0x10000 then nseq=0 if s==1 then nseq=0
elseif s==2 or s==0x20000 then nseq=1 elseif s==2 then nseq=1
elseif s==4 or s==0x40000 then nseq=2 elseif s==4 then nseq=2
elseif s==8 or s==0x80000 then nseq=3 elseif s==8 then nseq=3
else nseq=4 end else nseq=4 end
Duel.MoveSequence(tc,nseq) Duel.MoveSequence(tc,nseq)
end end
end end
function c22198672.chfilter1(c,tp) function c22198672.chfilter1(c)
return c:GetSequence()<5 and Duel.IsExistingMatchingCard(c22198672.chfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetControler()) return c:IsType(TYPE_LINK) and c:GetSequence()<5
and Duel.IsExistingMatchingCard(c22198672.chfilter2,c:GetControler(),LOCATION_MZONE,0,1,c)
end end
function c22198672.chfilter2(c,tp) function c22198672.chfilter2(c)
return c:GetSequence()<5 and c:IsControler(tp) return c:IsType(TYPE_LINK) and c:GetSequence()<5
end end
function c22198672.chtg(e,tp,eg,ep,ev,re,r,rp,chk) function c22198672.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22198672.chfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c22198672.chfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end end
function c22198672.chop(e,tp,eg,ep,ev,re,r,rp) function c22198672.chop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) if not e:GetHandler():IsRelateToEffect(e) then return end
or not Duel.IsExistingMatchingCard(c22198672.chfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectMatchingCard(tp,c22198672.chfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp) local g1=Duel.SelectMatchingCard(tp,c22198672.chfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g1)
local tc1=g1:GetFirst() local tc1=g1:GetFirst()
if not tc1 then return end
Duel.HintSelection(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectMatchingCard(tp,c22198672.chfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,tc1,tc1:GetControler()) local g2=Duel.SelectMatchingCard(tp,c22198672.chfilter2,tc1:GetControler(),LOCATION_MZONE,0,1,1,tc1)
Duel.HintSelection(g2) Duel.HintSelection(g2)
local tc2=g2:GetFirst() local tc2=g2:GetFirst()
Duel.SwapSequence(tc1,tc2) Duel.SwapSequence(tc1,tc2)
......
...@@ -14,11 +14,11 @@ function c33252803.filter1(c,e,tp) ...@@ -14,11 +14,11 @@ function c33252803.filter1(c,e,tp)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return c:IsFaceup() and c:IsSetCard(0x48) and not c:IsSetCard(0x1048) and m return c:IsFaceup() and c:IsSetCard(0x48) and not c:IsSetCard(0x1048) and m
and Duel.IsExistingMatchingCard(c33252803.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1,m.xyz_number) and Duel.IsExistingMatchingCard(c33252803.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank()+1,m.xyz_number)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c33252803.filter2(c,e,tp,mc,rk,no) function c33252803.filter2(c,e,tp,mc,rk,no)
return c:GetRank()==rk and c:IsSetCard(0x1048) and c.xyz_number==no and mc:IsCanBeXyzMaterial(c) return c:GetRank()==rk and c:IsSetCard(0x1048) and c.xyz_number==no and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end end
function c33252803.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33252803.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c33252803.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c33252803.filter1(chkc,e,tp) end
......
...@@ -40,118 +40,70 @@ function c48424886.initial_effect(c) ...@@ -40,118 +40,70 @@ function c48424886.initial_effect(c)
e4:SetOperation(c48424886.thop) e4:SetOperation(c48424886.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c48424886.ffilter(c,fc)
return (c48424886.ffilter1(c) or c48424886.ffilter2(c)) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c48424886.exfilter(c,fc)
return c:IsFaceup() and c48424886.ffilter(c,fc)
end
function c48424886.ffilter1(c) function c48424886.ffilter1(c)
return c:IsFusionSetCard(0x9d) and not c:IsHasEffect(6205579) return c:IsFusionSetCard(0x9d)
end end
function c48424886.ffilter2(c) function c48424886.ffilter2(c)
return (c:IsFusionAttribute(ATTRIBUTE_FIRE) or c:IsHasEffect(4904633)) and not c:IsHasEffect(6205579) return c:IsFusionAttribute(ATTRIBUTE_FIRE) or c:IsHasEffect(4904633)
end
function c48424886.spfilter1(c,tp,mg,exg)
return mg:IsExists(c48424886.spfilter2,1,c,tp,c) or (exg and exg:IsExists(c48424886.spfilter2,1,c,tp,c))
end end
function c48424886.exfilter(c,g) function c48424886.spfilter2(c,tp,mc)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not g:IsContains(c) return (c48424886.ffilter1(c) and c48424886.ffilter2(mc)
or c48424886.ffilter2(c) and c48424886.ffilter1(mc))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end end
function c48424886.fuscon(e,g,gc,chkf) function c48424886.fuscon(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=g:Filter(c48424886.ffilter,nil,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c48424886.exfilter,tp,0,LOCATION_MZONE,nil,mg) exg=Duel.GetMatchingGroup(c48424886.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
if gc then if gc then
if not gc:IsCanBeFusionMaterial(e:GetHandler()) then return false end if not mg:IsContains(gc) then return false end
return (c48424886.ffilter1(gc) and (mg:IsExists(c48424886.ffilter2,1,gc) or exg:IsExists(c48424886.ffilter2,1,gc))) return c48424886.spfilter1(gc,tp,mg,exg)
or (c48424886.ffilter2(gc) and (mg:IsExists(c48424886.ffilter1,1,gc) or exg:IsExists(c48424886.ffilter1,1,gc)))
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local g3=Group.CreateGroup()
local g4=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
if c48424886.ffilter1(tc) then
g1:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g3:AddCard(tc) end
end
if c48424886.ffilter2(tc) then
g2:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g4:AddCard(tc) end
end
tc=mg:GetNext()
end
local exg1=exg:Filter(c48424886.ffilter1,nil)
local exg2=exg:Filter(c48424886.ffilter2,nil)
if chkf~=PLAYER_NONE then
return (g3:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g3:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g4:IsExists(aux.FConditionFilterF2,1,nil,g1)
or g4:IsExists(aux.FConditionFilterF2,1,nil,exg1))
else
return (g1:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g1:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g2:IsExists(aux.FConditionFilterF2,1,nil,exg1))
end end
return mg:IsExists(c48424886.spfilter1,1,nil,tp,mg,exg)
end end
function c48424886.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) function c48424886.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=eg:Filter(c48424886.ffilter,nil,c)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c48424886.exfilter,tp,0,LOCATION_MZONE,nil,g) exg=Duel.GetMatchingGroup(c48424886.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
local g=nil
if gc then if gc then
local sg1=Group.CreateGroup() g=Group.FromCards(gc)
local sg2=Group.CreateGroup() mg:RemoveCard(gc)
if c48424886.ffilter1(gc) then else
sg1:Merge(g:Filter(c48424886.ffilter2,gc)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg2:Merge(exg:Filter(c48424886.ffilter2,gc)) g=mg:FilterSelect(tp,c48424886.spfilter1,1,1,nil,tp,mg,exg)
end mg:Sub(g)
if c48424886.ffilter2(gc) then
sg1:Merge(g:Filter(c48424886.ffilter1,gc))
sg2:Merge(exg:Filter(c48424886.ffilter1,gc))
end
local g1=nil
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg2:Select(tp,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg1:Select(tp,1,1,nil)
end
Duel.SetFusionMaterial(g1)
return
end
local sg=g:Filter(aux.FConditionFilterF2c,nil,c48424886.ffilter1,c48424886.ffilter2)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then
g1=sg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
local sg1=Group.CreateGroup()
local sg2=Group.CreateGroup()
if c48424886.ffilter1(tc1) then
sg1:Merge(sg:Filter(c48424886.ffilter2,tc1))
sg2:Merge(exg:Filter(c48424886.ffilter2,tc1))
end
if c48424886.ffilter2(tc1) then
sg1:Merge(sg:Filter(c48424886.ffilter1,tc1))
sg2:Merge(exg:Filter(c48424886.ffilter1,tc1))
end end
local g2=nil if exg and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT) fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg2:Select(tp,1,1,nil) local sg=exg:FilterSelect(tp,c48424886.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg1:Select(tp,1,1,nil) local sg=mg:FilterSelect(tp,c48424886.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
end end
g1:Merge(g2) Duel.SetFusionMaterial(g)
Duel.SetFusionMaterial(g1)
end end
function c48424886.splimit(e,se,sp,st) function c48424886.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
...@@ -167,7 +119,7 @@ function c48424886.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -167,7 +119,7 @@ function c48424886.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end end
function c48424886.operation(e,tp,eg,ep,ev,re,r,rp,chk) function c48424886.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg) Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......
...@@ -71,10 +71,8 @@ function c73511233.spfilter1(c,e) ...@@ -71,10 +71,8 @@ function c73511233.spfilter1(c,e)
return c73511233.spfilter0(c) and not c:IsImmuneToEffect(e) return c73511233.spfilter0(c) and not c:IsImmuneToEffect(e)
end end
function c73511233.spfilter2(c,e,tp,m,f,gc) function c73511233.spfilter2(c,e,tp,m,f,gc)
local mg=m:Clone()
mg:AddCard(gc)
return c:IsType(TYPE_FUSION) and (not f or f(c)) return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(mg,gc) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc)
end end
function c73511233.spfilter3(c) function c73511233.spfilter3(c)
return c:IsCanBeFusionMaterial() and c:IsRace(RACE_DRAGON) return c:IsCanBeFusionMaterial() and c:IsRace(RACE_DRAGON)
...@@ -83,12 +81,14 @@ function c73511233.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -83,12 +81,14 @@ function c73511233.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter0,nil) local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter0,nil)
mg1:AddCard(c)
local res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c) local res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
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
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil) local mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil)
mg2:AddCard(c)
local mf=ce:GetValue() local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c) res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c)
end end
...@@ -101,6 +101,7 @@ function c73511233.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -101,6 +101,7 @@ function c73511233.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or c:IsControler(1-tp) then return end if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or c:IsControler(1-tp) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter1,nil,e)
mg1:AddCard(c)
local sg1=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c) local sg1=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil local mg2=nil
local sg2=nil local sg2=nil
...@@ -108,6 +109,7 @@ function c73511233.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -108,6 +109,7 @@ function c73511233.spop(e,tp,eg,ep,ev,re,r,rp)
if ce~=nil then if ce~=nil then
local fgroup=ce:GetTarget() local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil) mg2=fgroup(ce,e,tp):Filter(c73511233.spfilter3,nil)
mg2:AddCard(c)
local mf=ce:GetValue() local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c) sg2=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c)
end end
......
...@@ -39,118 +39,70 @@ function c74009824.initial_effect(c) ...@@ -39,118 +39,70 @@ function c74009824.initial_effect(c)
e4:SetOperation(c74009824.thop) e4:SetOperation(c74009824.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c74009824.ffilter(c,fc)
return (c74009824.ffilter1(c) or c74009824.ffilter2(c)) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c74009824.exfilter(c,fc)
return c:IsFaceup() and c74009824.ffilter(c,fc)
end
function c74009824.ffilter1(c) function c74009824.ffilter1(c)
return c:IsFusionSetCard(0x9d) and not c:IsHasEffect(6205579) return c:IsFusionSetCard(0x9d)
end end
function c74009824.ffilter2(c) function c74009824.ffilter2(c)
return (c:IsFusionAttribute(ATTRIBUTE_WIND) or c:IsHasEffect(4904633)) and not c:IsHasEffect(6205579) return c:IsFusionAttribute(ATTRIBUTE_WIND) or c:IsHasEffect(4904633)
end
function c74009824.spfilter1(c,tp,mg,exg)
return mg:IsExists(c74009824.spfilter2,1,c,tp,c) or (exg and exg:IsExists(c74009824.spfilter2,1,c,tp,c))
end end
function c74009824.exfilter(c,g) function c74009824.spfilter2(c,tp,mc)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not g:IsContains(c) return (c74009824.ffilter1(c) and c74009824.ffilter2(mc)
or c74009824.ffilter2(c) and c74009824.ffilter1(mc))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end end
function c74009824.fuscon(e,g,gc,chkf) function c74009824.fuscon(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=g:Filter(c74009824.ffilter,nil,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c74009824.exfilter,tp,0,LOCATION_MZONE,nil,mg) exg=Duel.GetMatchingGroup(c74009824.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
if gc then if gc then
if not gc:IsCanBeFusionMaterial(e:GetHandler()) then return false end if not mg:IsContains(gc) then return false end
return (c74009824.ffilter1(gc) and (mg:IsExists(c74009824.ffilter2,1,gc) or exg:IsExists(c74009824.ffilter2,1,gc))) return c74009824.spfilter1(gc,tp,mg,exg)
or (c74009824.ffilter2(gc) and (mg:IsExists(c74009824.ffilter1,1,gc) or exg:IsExists(c74009824.ffilter1,1,gc)))
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local g3=Group.CreateGroup()
local g4=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
if c74009824.ffilter1(tc) then
g1:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g3:AddCard(tc) end
end
if c74009824.ffilter2(tc) then
g2:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g4:AddCard(tc) end
end
tc=mg:GetNext()
end
local exg1=exg:Filter(c74009824.ffilter1,nil)
local exg2=exg:Filter(c74009824.ffilter2,nil)
if chkf~=PLAYER_NONE then
return (g3:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g3:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g4:IsExists(aux.FConditionFilterF2,1,nil,g1)
or g4:IsExists(aux.FConditionFilterF2,1,nil,exg1))
else
return (g1:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g1:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g2:IsExists(aux.FConditionFilterF2,1,nil,exg1))
end end
return mg:IsExists(c74009824.spfilter1,1,nil,tp,mg,exg)
end end
function c74009824.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) function c74009824.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=eg:Filter(c74009824.ffilter,nil,c)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c74009824.exfilter,tp,0,LOCATION_MZONE,nil,g) exg=Duel.GetMatchingGroup(c74009824.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
local g=nil
if gc then if gc then
local sg1=Group.CreateGroup() g=Group.FromCards(gc)
local sg2=Group.CreateGroup() mg:RemoveCard(gc)
if c74009824.ffilter1(gc) then else
sg1:Merge(g:Filter(c74009824.ffilter2,gc)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg2:Merge(exg:Filter(c74009824.ffilter2,gc)) g=mg:FilterSelect(tp,c74009824.spfilter1,1,1,nil,tp,mg,exg)
end mg:Sub(g)
if c74009824.ffilter2(gc) then
sg1:Merge(g:Filter(c74009824.ffilter1,gc))
sg2:Merge(exg:Filter(c74009824.ffilter1,gc))
end
local g1=nil
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg2:Select(tp,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg1:Select(tp,1,1,nil)
end
Duel.SetFusionMaterial(g1)
return
end
local sg=g:Filter(aux.FConditionFilterF2c,nil,c74009824.ffilter1,c74009824.ffilter2)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then
g1=sg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
local sg1=Group.CreateGroup()
local sg2=Group.CreateGroup()
if c74009824.ffilter1(tc1) then
sg1:Merge(sg:Filter(c74009824.ffilter2,tc1))
sg2:Merge(exg:Filter(c74009824.ffilter2,tc1))
end
if c74009824.ffilter2(tc1) then
sg1:Merge(sg:Filter(c74009824.ffilter1,tc1))
sg2:Merge(exg:Filter(c74009824.ffilter1,tc1))
end end
local g2=nil if exg and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT) fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg2:Select(tp,1,1,nil) local sg=exg:FilterSelect(tp,c74009824.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg1:Select(tp,1,1,nil) local sg=mg:FilterSelect(tp,c74009824.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
end end
g1:Merge(g2) Duel.SetFusionMaterial(g)
Duel.SetFusionMaterial(g1)
end end
function c74009824.splimit(e,se,sp,st) function c74009824.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
......
...@@ -41,118 +41,70 @@ function c74822425.initial_effect(c) ...@@ -41,118 +41,70 @@ function c74822425.initial_effect(c)
e4:SetOperation(c74822425.thop) e4:SetOperation(c74822425.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c74822425.ffilter(c,fc)
return (c74822425.ffilter1(c) or c74822425.ffilter2(c)) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c74822425.exfilter(c,fc)
return c:IsFaceup() and c74822425.ffilter(c,fc)
end
function c74822425.ffilter1(c) function c74822425.ffilter1(c)
return c:IsFusionSetCard(0x9d) and not c:IsHasEffect(6205579) return c:IsFusionSetCard(0x9d)
end end
function c74822425.ffilter2(c) function c74822425.ffilter2(c)
return (c:IsFusionAttribute(ATTRIBUTE_EARTH) or c:IsHasEffect(4904633)) and not c:IsHasEffect(6205579) return c:IsFusionAttribute(ATTRIBUTE_EARTH) or c:IsHasEffect(4904633)
end end
function c74822425.exfilter(c,g) function c74822425.spfilter1(c,tp,mg,exg)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not g:IsContains(c) return mg:IsExists(c74822425.spfilter2,1,c,tp,c) or (exg and exg:IsExists(c74822425.spfilter2,1,c,tp,c))
end
function c74822425.spfilter2(c,tp,mc)
return (c74822425.ffilter1(c) and c74822425.ffilter2(mc)
or c74822425.ffilter2(c) and c74822425.ffilter1(mc))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end end
function c74822425.fuscon(e,g,gc,chkf) function c74822425.fuscon(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=g:Filter(c74822425.ffilter,nil,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c74822425.exfilter,tp,0,LOCATION_MZONE,nil,mg) exg=Duel.GetMatchingGroup(c74822425.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
if gc then if gc then
if not gc:IsCanBeFusionMaterial(e:GetHandler()) then return false end if not mg:IsContains(gc) then return false end
return (c74822425.ffilter1(gc) and (mg:IsExists(c74822425.ffilter2,1,gc) or exg:IsExists(c74822425.ffilter2,1,gc))) return c74822425.spfilter1(gc,tp,mg,exg)
or (c74822425.ffilter2(gc) and (mg:IsExists(c74822425.ffilter1,1,gc) or exg:IsExists(c74822425.ffilter1,1,gc)))
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local g3=Group.CreateGroup()
local g4=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
if c74822425.ffilter1(tc) then
g1:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g3:AddCard(tc) end
end
if c74822425.ffilter2(tc) then
g2:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g4:AddCard(tc) end
end
tc=mg:GetNext()
end
local exg1=exg:Filter(c74822425.ffilter1,nil)
local exg2=exg:Filter(c74822425.ffilter2,nil)
if chkf~=PLAYER_NONE then
return (g3:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g3:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g4:IsExists(aux.FConditionFilterF2,1,nil,g1)
or g4:IsExists(aux.FConditionFilterF2,1,nil,exg1))
else
return (g1:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g1:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g2:IsExists(aux.FConditionFilterF2,1,nil,exg1))
end end
return mg:IsExists(c74822425.spfilter1,1,nil,tp,mg,exg)
end end
function c74822425.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) function c74822425.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=eg:Filter(c74822425.ffilter,nil,c)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c74822425.exfilter,tp,0,LOCATION_MZONE,nil,g) exg=Duel.GetMatchingGroup(c74822425.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
local g=nil
if gc then if gc then
local sg1=Group.CreateGroup() g=Group.FromCards(gc)
local sg2=Group.CreateGroup() mg:RemoveCard(gc)
if c74822425.ffilter1(gc) then else
sg1:Merge(g:Filter(c74822425.ffilter2,gc)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg2:Merge(exg:Filter(c74822425.ffilter2,gc)) g=mg:FilterSelect(tp,c74822425.spfilter1,1,1,nil,tp,mg,exg)
end mg:Sub(g)
if c74822425.ffilter2(gc) then
sg1:Merge(g:Filter(c74822425.ffilter1,gc))
sg2:Merge(exg:Filter(c74822425.ffilter1,gc))
end
local g1=nil
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg2:Select(tp,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg1:Select(tp,1,1,nil)
end
Duel.SetFusionMaterial(g1)
return
end
local sg=g:Filter(aux.FConditionFilterF2c,nil,c74822425.ffilter1,c74822425.ffilter2)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then
g1=sg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
local sg1=Group.CreateGroup()
local sg2=Group.CreateGroup()
if c74822425.ffilter1(tc1) then
sg1:Merge(sg:Filter(c74822425.ffilter2,tc1))
sg2:Merge(exg:Filter(c74822425.ffilter2,tc1))
end
if c74822425.ffilter2(tc1) then
sg1:Merge(sg:Filter(c74822425.ffilter1,tc1))
sg2:Merge(exg:Filter(c74822425.ffilter1,tc1))
end end
local g2=nil if exg and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT) fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg2:Select(tp,1,1,nil) local sg=exg:FilterSelect(tp,c74822425.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg1:Select(tp,1,1,nil) local sg=mg:FilterSelect(tp,c74822425.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
end end
g1:Merge(g2) Duel.SetFusionMaterial(g)
Duel.SetFusionMaterial(g1)
end end
function c74822425.splimit(e,se,sp,st) function c74822425.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
......
...@@ -40,6 +40,7 @@ function c86196216.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -40,6 +40,7 @@ function c86196216.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c86196216.filter1(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c86196216.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2) if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(c86196216.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c86196216.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c86196216.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c86196216.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
...@@ -50,6 +51,7 @@ function c86196216.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,6 +51,7 @@ function c86196216.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end if not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c86196216.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()*2) local g=Duel.SelectMatchingCard(tp,c86196216.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()*2)
local sc=g:GetFirst() local sc=g:GetFirst()
......
...@@ -103,12 +103,12 @@ function c87460579.spfilter(c,e,tp) ...@@ -103,12 +103,12 @@ function c87460579.spfilter(c,e,tp)
return c:IsSetCard(0xe6) and not c:IsCode(87460579) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xe6) and not c:IsCode(87460579) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c87460579.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c87460579.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c87460579.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c87460579.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c87460579.spop(e,tp,eg,ep,ev,re,r,rp) function c87460579.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c87460579.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c87460579.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -28,18 +28,18 @@ function c88482761.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,18 +28,18 @@ function c88482761.condition(e,tp,eg,ep,ev,re,r,rp)
end end
function c88482761.rmfilter1(c,e,tp) function c88482761.rmfilter1(c,e,tp)
return c:IsSetCard(0x2016) and c:IsAbleToRemove() return c:IsSetCard(0x2016) and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(c88482761.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetOriginalLevel()) and Duel.IsExistingMatchingCard(c88482761.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,c:GetOriginalLevel())
end end
function c88482761.rmfilter2(c,lv) function c88482761.rmfilter2(c,e,tp,lv)
return c:IsSetCard(0x2016) and c:IsType(TYPE_TUNER) and c:IsAbleToRemove() and c:GetOriginalLevel()==lv return c:IsSetCard(0x2016) and c:IsType(TYPE_TUNER) and c:IsAbleToRemove()
and Duel.IsExistingMatchingCard(c88482761.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetOriginalLevel()+lv)
end end
function c88482761.spfilter(c,e,tp,lv) function c88482761.spfilter(c,e,tp,lv)
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetLevel()==lv and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c88482761.rmfilter2,tp,LOCATION_HAND,0,1,nil,c:GetLevel()-lv)
end end
function c88482761.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c88482761.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c88482761.rmfilter1(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c88482761.rmfilter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(c88482761.rmfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c88482761.rmfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c88482761.rmfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c88482761.rmfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
...@@ -49,14 +49,17 @@ end ...@@ -49,14 +49,17 @@ end
function c88482761.operation(e,tp,eg,ep,ev,re,r,rp) function c88482761.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local lv=tc:GetOriginalLevel()
local g=Duel.SelectMatchingCard(tp,c88482761.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetOriginalLevel()) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c88482761.rmfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp,lv)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) lv=lv+g:GetFirst():GetOriginalLevel()
local rg=Duel.SelectMatchingCard(tp,c88482761.rmfilter2,tp,LOCATION_HAND,0,1,1,nil,g:GetFirst():GetLevel()-tc:GetOriginalLevel()) g:AddCard(tc)
rg:AddCard(tc) if Duel.Remove(g,POS_FACEUP,REASON_EFFECT)==2 then
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 then if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c88482761.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end end
end end
end end
......
...@@ -49,7 +49,7 @@ function c88696724.filter2(c,e,tp,code) ...@@ -49,7 +49,7 @@ function c88696724.filter2(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c88696724.operation(e,tp,eg,ep,ev,re,r,rp) function c88696724.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCountFromEx(tp)<=0 then return end
local code=e:GetLabel() local code=e:GetLabel()
local tc=Duel.GetFirstMatchingCard(c88696724.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,code) local tc=Duel.GetFirstMatchingCard(c88696724.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,code)
if tc then if tc then
......
...@@ -63,12 +63,12 @@ function c88722973.spfilter(c,e,tp) ...@@ -63,12 +63,12 @@ function c88722973.spfilter(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c88722973.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c88722973.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c88722973.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c88722973.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c88722973.spop(e,tp,eg,ep,ev,re,r,rp) function c88722973.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c88722973.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c88722973.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -11,49 +11,46 @@ function c90812044.initial_effect(c) ...@@ -11,49 +11,46 @@ function c90812044.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c90812044.cfilter(c) function c90812044.cfilter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup() return c:IsFaceup() and c:IsType(TYPE_XYZ)
end end
function c90812044.cfilter2(c,r) function c90812044.filter(c,e,tp,rk)
return c:IsType(TYPE_XYZ) and c:GetRank()==r and c:IsFaceup() return c:IsType(TYPE_XYZ) and c:GetRank()<rk
end
function c90812044.filter(c,e,tp,r)
return c:IsType(TYPE_XYZ) and c:GetRank()<r
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c90812044.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c90812044.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c90812044.cfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c90812044.cfilter,tp,LOCATION_MZONE,0,nil)
local rg,r=g:GetMinGroup(Card.GetRank) local rg,rk=g:GetMinGroup(Card.GetRank)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c90812044.cfilter2(chkc,r) end if chkc then return rg:IsContains(chkc) end
if chk==0 then return g:GetCount()>=2 and rg:IsExists(Card.IsCanBeEffectTarget,1,nil,e) if chk==0 then return g:GetCount()>=2 and rg:IsExists(Card.IsCanBeEffectTarget,1,nil,e)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c90812044.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,r) end and Duel.IsExistingMatchingCard(c90812044.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,rk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=rg:FilterSelect(tp,Card.IsCanBeEffectTarget,1,1,nil,e) local sg=rg:FilterSelect(tp,Card.IsCanBeEffectTarget,1,1,nil,e)
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c90812044.activate(e,tp,eg,ep,ev,re,r,rp) function c90812044.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCountFromEx(tp)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local r=tc:GetRank() local rk=tc:GetRank()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c90812044.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,r) local g=Duel.SelectMatchingCard(tp,c90812044.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,rk)
local tc=g:GetFirst() local sc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK) e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true) sc:RegisterEffect(e1,true)
tc:RegisterFlagEffect(90812044,RESET_EVENT+0x1fe0000,0,1) sc:RegisterFlagEffect(90812044,RESET_EVENT+0x1fe0000,0,1)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1) e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc) e2:SetLabelObject(sc)
e2:SetCondition(c90812044.retcon) e2:SetCondition(c90812044.retcon)
e2:SetOperation(c90812044.retop) e2:SetOperation(c90812044.retop)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
......
...@@ -46,118 +46,70 @@ function c94977269.initial_effect(c) ...@@ -46,118 +46,70 @@ function c94977269.initial_effect(c)
e5:SetOperation(c94977269.thop) e5:SetOperation(c94977269.thop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c94977269.ffilter(c,fc)
return (c94977269.ffilter1(c) or c94977269.ffilter2(c)) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c94977269.exfilter(c,fc)
return c:IsFaceup() and c94977269.ffilter(c,fc)
end
function c94977269.ffilter1(c) function c94977269.ffilter1(c)
return c:IsFusionSetCard(0x9d) and not c:IsHasEffect(6205579) return c:IsFusionSetCard(0x9d)
end end
function c94977269.ffilter2(c) function c94977269.ffilter2(c)
return (c:IsFusionAttribute(ATTRIBUTE_DARK) or c:IsHasEffect(4904633)) and not c:IsHasEffect(6205579) return c:IsFusionAttribute(ATTRIBUTE_DARK) or c:IsHasEffect(4904633)
end
function c94977269.spfilter1(c,tp,mg,exg)
return mg:IsExists(c94977269.spfilter2,1,c,tp,c) or (exg and exg:IsExists(c94977269.spfilter2,1,c,tp,c))
end end
function c94977269.exfilter(c,g) function c94977269.spfilter2(c,tp,mc)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not g:IsContains(c) return (c94977269.ffilter1(c) and c94977269.ffilter2(mc)
or c94977269.ffilter2(c) and c94977269.ffilter1(mc))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end end
function c94977269.fuscon(e,g,gc,chkf) function c94977269.fuscon(e,g,gc,chkf)
if g==nil then return true end if g==nil then return true end
local mg=g:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=g:Filter(c94977269.ffilter,nil,c)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c94977269.exfilter,tp,0,LOCATION_MZONE,nil,mg) exg=Duel.GetMatchingGroup(c94977269.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
if gc then if gc then
if not gc:IsCanBeFusionMaterial(e:GetHandler()) then return false end if not mg:IsContains(gc) then return false end
return (c94977269.ffilter1(gc) and (mg:IsExists(c94977269.ffilter2,1,gc) or exg:IsExists(c94977269.ffilter2,1,gc))) return c94977269.spfilter1(gc,tp,mg,exg)
or (c94977269.ffilter2(gc) and (mg:IsExists(c94977269.ffilter1,1,gc) or exg:IsExists(c94977269.ffilter1,1,gc)))
end
local g1=Group.CreateGroup()
local g2=Group.CreateGroup()
local g3=Group.CreateGroup()
local g4=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
if c94977269.ffilter1(tc) then
g1:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g3:AddCard(tc) end
end
if c94977269.ffilter2(tc) then
g2:AddCard(tc)
if aux.FConditionCheckF(tc,chkf) then g4:AddCard(tc) end
end
tc=mg:GetNext()
end
local exg1=exg:Filter(c94977269.ffilter1,nil)
local exg2=exg:Filter(c94977269.ffilter2,nil)
if chkf~=PLAYER_NONE then
return (g3:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g3:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g4:IsExists(aux.FConditionFilterF2,1,nil,g1)
or g4:IsExists(aux.FConditionFilterF2,1,nil,exg1))
else
return (g1:IsExists(aux.FConditionFilterF2,1,nil,g2)
or g1:IsExists(aux.FConditionFilterF2,1,nil,exg2)
or g2:IsExists(aux.FConditionFilterF2,1,nil,exg1))
end end
return mg:IsExists(c94977269.spfilter1,1,nil,tp,mg,exg)
end end
function c94977269.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) function c94977269.fusop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler()) local c=e:GetHandler()
local mg=eg:Filter(c94977269.ffilter,nil,c)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
local exg=Group.CreateGroup() local exg=nil
if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then if fc and fc:IsHasEffect(81788994) and fc:IsCanRemoveCounter(tp,0x16,3,REASON_EFFECT) then
local sg=Duel.GetMatchingGroup(c94977269.exfilter,tp,0,LOCATION_MZONE,nil,g) exg=Duel.GetMatchingGroup(c94977269.exfilter,tp,0,LOCATION_MZONE,mg,c)
exg:Merge(sg)
end end
local g=nil
if gc then if gc then
local sg1=Group.CreateGroup() g=Group.FromCards(gc)
local sg2=Group.CreateGroup() mg:RemoveCard(gc)
if c94977269.ffilter1(gc) then else
sg1:Merge(g:Filter(c94977269.ffilter2,gc)) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
sg2:Merge(exg:Filter(c94977269.ffilter2,gc)) g=mg:FilterSelect(tp,c94977269.spfilter1,1,1,nil,tp,mg,exg)
end mg:Sub(g)
if c94977269.ffilter2(gc) then
sg1:Merge(g:Filter(c94977269.ffilter1,gc))
sg2:Merge(exg:Filter(c94977269.ffilter1,gc))
end
local g1=nil
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg2:Select(tp,1,1,nil)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g1=sg1:Select(tp,1,1,nil)
end
Duel.SetFusionMaterial(g1)
return
end
local sg=g:Filter(aux.FConditionFilterF2c,nil,c94977269.ffilter1,c94977269.ffilter2)
local g1=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
if chkf~=PLAYER_NONE then
g1=sg:FilterSelect(tp,aux.FConditionCheckF,1,1,nil,chkf)
else g1=sg:Select(tp,1,1,nil) end
local tc1=g1:GetFirst()
local sg1=Group.CreateGroup()
local sg2=Group.CreateGroup()
if c94977269.ffilter1(tc1) then
sg1:Merge(sg:Filter(c94977269.ffilter2,tc1))
sg2:Merge(exg:Filter(c94977269.ffilter2,tc1))
end
if c94977269.ffilter2(tc1) then
sg1:Merge(sg:Filter(c94977269.ffilter1,tc1))
sg2:Merge(exg:Filter(c94977269.ffilter1,tc1))
end end
local g2=nil if exg and (mg:GetCount()==0 or (exg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0)))) then
if sg1:GetCount()==0 or (sg2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(81788994,0))) then
fc:RemoveCounter(tp,0x16,3,REASON_EFFECT) fc:RemoveCounter(tp,0x16,3,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg2:Select(tp,1,1,nil) local sg=exg:FilterSelect(tp,c94977269.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g2=sg1:Select(tp,1,1,nil) local sg=mg:FilterSelect(tp,c94977269.spfilter2,1,1,nil,tp,g:GetFirst())
g:Merge(sg)
end end
g1:Merge(g2) Duel.SetFusionMaterial(g)
Duel.SetFusionMaterial(g1)
end end
function c94977269.splimit(e,se,sp,st) function c94977269.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
......
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