Commit e9a0148f authored by VanillaSalt's avatar VanillaSalt

fix

parent 2d9657cd
......@@ -39,24 +39,31 @@ function c12678870.initial_effect(c)
e4:SetOperation(c12678870.spop)
c:RegisterEffect(e4)
end
function c12678870.spfilter1(c,tp)
return c:IsFusionSetCard(0x10b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
and Duel.IsExistingMatchingCard(c12678870.spfilter2,tp,LOCATION_MZONE,0,1,c)
function c12678870.matfilter(c)
return (c:IsFusionSetCard(0x10b5) or c:IsFusionSetCard(0x20b5))
and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c12678870.spfilter2(c)
return c:IsFusionSetCard(0x20b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
function c12678870.spfilter1(c,tp,g)
return g:IsExists(c12678870.spfilter2,1,c,tp,c)
end
function c12678870.spfilter2(c,tp,mc)
return (c:IsFusionSetCard(0x10b5) and mc:IsFusionSetCard(0x20b5)
or c:IsFusionSetCard(0x20b5) and mc:IsFusionSetCard(0x10b5))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c12678870.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c12678870.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c12678870.matfilter,tp,LOCATION_MZONE,0,nil)
return g:IsExists(c12678870.spfilter1,1,nil,tp,g)
end
function c12678870.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c12678870.matfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c12678870.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
local g1=g:FilterSelect(tp,c12678870.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c12678870.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
local g2=g:FilterSelect(tp,c12678870.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
......
......@@ -51,54 +51,46 @@ end
function c1561110.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c1561110.rmfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c1561110.rmfilter1(c,mg,ft)
local mg2=mg:Clone()
mg2:RemoveCard(c)
local ct=ft
if c:IsLocation(LOCATION_MZONE) then ct=ct+1 end
return c:IsFusionCode(30012506) and mg2:IsExists(c1561110.rmfilter2,1,nil,mg2,ct)
end
function c1561110.rmfilter2(c,mg,ft)
local mg2=mg:Clone()
mg2:RemoveCard(c)
local ct=ft
if c:IsLocation(LOCATION_MZONE) then ct=ct+1 end
return c:IsFusionCode(77411244) and mg2:IsExists(c1561110.rmfilter3,1,nil,ct)
end
function c1561110.rmfilter3(c,ft)
local ct=ft
if c:IsLocation(LOCATION_MZONE) then ct=ct+1 end
return c:IsFusionCode(3405259) and ct>0
function c1561110.cfilter(c)
return c:IsFusionCode(30012506,77411244,3405259) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c1561110.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c1561110.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c1561110.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c1561110.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c1561110.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c1561110.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
local mg=Duel.GetMatchingGroup(c1561110.rmfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
return mg:IsExists(c1561110.rmfilter1,1,nil,mg,ft)
local mg=Duel.GetMatchingGroup(c1561110.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c1561110.fselect,1,nil,tp,mg,sg,30012506,77411244,3405259)
end
function c1561110.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Duel.GetMatchingGroup(c1561110.rmfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=mg:FilterSelect(tp,c1561110.rmfilter1,1,1,nil,mg,ft)
local tc1=g1:GetFirst()
mg:RemoveCard(tc1)
if tc1:IsLocation(LOCATION_MZONE) then ft=ft+1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=mg:FilterSelect(tp,c1561110.rmfilter2,1,1,nil,mg,ft)
local tc2=g2:GetFirst()
if tc2:IsLocation(LOCATION_MZONE) then ft=ft+1 end
mg:RemoveCard(tc2)
local mg=Duel.GetMatchingGroup(c1561110.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=mg:FilterSelect(tp,c1561110.rmfilter3,1,1,nil,ft)
g1:Merge(g2)
g1:Merge(g3)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g=mg:FilterSelect(tp,c1561110.fselect,1,1,sg,tp,mg,sg,30012506,77411244,3405259)
sg:Merge(g)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c1561110.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
......
......@@ -52,60 +52,50 @@ c17032740.material_setcode=0x8
function c17032740.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c17032740.spfilter(c,code1,code2,code3)
return c:IsAbleToDeckOrExtraAsCost() and (c:IsFusionCode(code1) or c:IsFusionCode(code2) or c:IsFusionCode(code3))
function c17032740.cfilter(c)
return c:IsFusionCode(89943723,43237273,17732278) and c:IsAbleToDeckOrExtraAsCost()
end
function c17032740.spfilter1(c,mg,ft)
local mg2=mg:Clone()
mg2:RemoveCard(c)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return ft>=-1 and c:IsFusionCode(89943723) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
and mg2:IsExists(c17032740.spfilter2,1,nil,mg2,ft)
function c17032740.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c17032740.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c17032740.spfilter2(c,mg,ft)
local mg2=mg:Clone()
mg2:RemoveCard(c)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return ft>=0 and c:IsFusionCode(43237273) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
and mg2:IsExists(c17032740.spfilter3,1,nil,ft)
end
function c17032740.spfilter3(c,ft)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return ft>=1 and c:IsFusionCode(17732278) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
function c17032740.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c17032740.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c17032740.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c17032740.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
local mg=Duel.GetMatchingGroup(c17032740.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723,43237273,17732278)
return mg:IsExists(c17032740.spfilter1,1,nil,mg,ft)
local mg=Duel.GetMatchingGroup(c17032740.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c17032740.fselect,1,nil,tp,mg,sg,89943723,43237273,17732278)
end
function c17032740.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Duel.GetMatchingGroup(c17032740.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723,43237273,17732278)
local g=Group.CreateGroup()
local tc=nil
for i=1,3 do
local mg=Duel.GetMatchingGroup(c17032740.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if i==1 then
tc=mg:FilterSelect(tp,c17032740.spfilter1,1,1,nil,mg,ft):GetFirst()
end
if i==2 then
tc=mg:FilterSelect(tp,c17032740.spfilter2,1,1,nil,mg,ft):GetFirst()
end
if i==3 then
tc=mg:FilterSelect(tp,c17032740.spfilter3,1,1,nil,ft):GetFirst()
end
g:AddCard(tc)
mg:RemoveCard(tc)
if tc:IsLocation(LOCATION_MZONE) then ft=ft+1 end
local g=mg:FilterSelect(tp,c17032740.fselect,1,1,sg,tp,mg,sg,89943723,43237273,17732278)
sg:Merge(g)
end
local cg=g:Filter(Card.IsFacedown,nil)
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function c17032740.retcon1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(42015635)
......
......@@ -52,17 +52,28 @@ end
function c2129638.spfilter(c,fc)
return c:IsFusionCode(89631139) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost()
end
function c2129638.spfilter1(c,tp,g)
return g:IsExists(c2129638.spfilter2,1,c,tp,c)
end
function c2129638.spfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c2129638.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c2129638.spfilter,tp,LOCATION_MZONE,0,2,nil,c)
local g=Duel.GetMatchingGroup(c2129638.spfilter,tp,LOCATION_MZONE,0,nil,c)
return g:IsExists(c2129638.spfilter1,1,nil,tp,g)
end
function c2129638.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c2129638.spfilter,tp,LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:FilterSelect(tp,c2129638.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c2129638.spfilter,tp,LOCATION_MZONE,0,2,2,nil,c)
c:SetMaterial(g)
Duel.SendtoGrave(g,REASON_COST)
local g2=g:FilterSelect(tp,c2129638.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_COST)
end
function c2129638.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -48,22 +48,29 @@ end
function c22638495.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c22638495.spfilter1(c,tp,fc)
return c:IsFusionSetCard(0xc7) and c:IsType(TYPE_PENDULUM) and c:IsCanBeFusionMaterial(fc)
and Duel.CheckReleaseGroup(tp,c22638495.spfilter2,1,c,fc)
end
function c22638495.spfilter2(c,fc)
function c22638495.rfilter(c,fc)
return c:IsType(TYPE_PENDULUM) and c:IsCanBeFusionMaterial(fc)
end
function c22638495.spfilter1(c,tp,g)
return g:IsExists(c22638495.spfilter2,1,c,tp,c)
end
function c22638495.spfilter2(c,tp,mc)
return (c:IsFusionSetCard(0xc7) or mc:IsFusionSetCard(0xc7))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c22638495.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.CheckReleaseGroup(tp,c22638495.spfilter1,1,nil,tp,c)
local rg=Duel.GetReleaseGroup(tp):Filter(c22638495.rfilter,nil,c)
return rg:IsExists(c22638495.spfilter1,1,nil,tp,rg)
end
function c22638495.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectReleaseGroup(tp,c22638495.spfilter1,1,1,nil,tp,c)
local g2=Duel.SelectReleaseGroup(tp,c22638495.spfilter2,1,1,g1:GetFirst(),c)
local rg=Duel.GetReleaseGroup(tp):Filter(c22638495.rfilter,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=rg:FilterSelect(tp,c22638495.spfilter1,1,1,nil,tp,rg)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=rg:FilterSelect(tp,c22638495.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Release(g1,REASON_COST+REASON_FUSION+REASON_MATERIAL)
......
......@@ -37,31 +37,47 @@ end
function c27346636.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c27346636.spfilter1(c,tp)
return c:IsFusionCode(78868776) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
and Duel.IsExistingMatchingCard(c27346636.spfilter2,tp,LOCATION_MZONE,0,2,c)
function c27346636.cfilter(c)
return (c:IsFusionCode(78868776) or c:IsFusionSetCard(0x19) and c:IsType(TYPE_MONSTER))
and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
end
function c27346636.spfilter2(c)
return c:IsFusionSetCard(0x19) and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
function c27346636.fcheck(c,sg)
return c:IsFusionCode(78868776) and sg:IsExists(c27346636.fcheck2,2,c)
end
function c27346636.fcheck2(c)
return c:IsFusionSetCard(0x19) and c:IsType(TYPE_MONSTER)
end
function c27346636.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c27346636.fselect,1,sg,tp,mg,sg)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
res=sg:IsExists(c27346636.fcheck,1,nil,sg)
end
sg:RemoveCard(c)
return res
end
function c27346636.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c27346636.spfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp)
local mg=Duel.GetMatchingGroup(c27346636.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c27346636.fselect,1,nil,tp,mg,sg)
end
function c27346636.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(27346636,2))
local g1=Duel.SelectMatchingCard(tp,c27346636.spfilter1,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(27346636,3))
local g2=Duel.SelectMatchingCard(tp,c27346636.spfilter2,tp,LOCATION_MZONE,0,2,2,g1:GetFirst())
g1:Merge(g2)
local tc=g1:GetFirst()
while tc do
if not tc:IsFaceup() then Duel.ConfirmCards(1-tp,tc) end
tc=g1:GetNext()
local mg=Duel.GetMatchingGroup(c27346636.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=mg:FilterSelect(tp,c27346636.fselect,1,1,sg,tp,mg,sg)
sg:Merge(g)
end
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g1,nil,2,REASON_COST)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function c27346636.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
......
......@@ -54,20 +54,37 @@ end
function c29357956.spfilter(c)
return c:IsFusionSetCard(0x19) and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
end
function c29357956.sprcon(e,c)
function c22638495.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c22638495.fselect,1,sg,tp,mg,sg)
else
res=Duel.GetLocationCountFromEx(tp,tp,sg)>0
end
sg:RemoveCard(c)
return res
end
function c22638495.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c29357956.spfilter,tp,LOCATION_MZONE,0,3,nil)
local mg=Duel.GetMatchingGroup(c22638495.spfilter,tp,LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c22638495.fselect,1,nil,tp,mg,sg)
end
function c29357956.sprop(e,tp,eg,ep,ev,re,r,rp,c)
function c22638495.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c22638495.spfilter,tp,LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c29357956.spfilter,tp,LOCATION_MZONE,0,3,3,nil)
local cg=g:Filter(Card.IsFacedown,nil)
local g=mg:FilterSelect(tp,c22638495.fselect,1,1,sg,tp,mg,sg)
sg:Merge(g)
end
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function c29357956.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
......
......@@ -38,27 +38,46 @@ end
function c43378048.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c43378048.spfilter(c,code)
return c:IsFaceup() and c:IsFusionCode(code) and c:IsAbleToRemoveAsCost()
function c43378048.cfilter(c)
return c:IsFaceup() and c:IsFusionCode(6007213,32491822,69890967) and c:IsAbleToRemoveAsCost()
end
function c43378048.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c43378048.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c43378048.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c43378048.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c43378048.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c43378048.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,6007213)
and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,32491822)
and Duel.IsExistingMatchingCard(c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,nil,69890967)
local mg=Duel.GetMatchingGroup(c43378048.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c43378048.fselect,1,nil,tp,mg,sg,6007213,32491822,69890967)
end
function c43378048.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c43378048.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,1,nil,6007213)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,1,nil,32491822)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=Duel.SelectMatchingCard(tp,c43378048.spfilter,tp,LOCATION_ONFIELD,0,1,1,nil,69890967)
g1:Merge(g2)
g1:Merge(g3)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g=mg:FilterSelect(tp,c43378048.fselect,1,1,sg,tp,mg,sg,6007213,32491822,69890967)
sg:Merge(g)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c43378048.atkcon(e)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
......
......@@ -43,24 +43,31 @@ function c48063985.initial_effect(c)
e4:SetOperation(c48063985.spop)
c:RegisterEffect(e4)
end
function c48063985.spfilter1(c,tp)
return c:IsFusionSetCard(0x10b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
and Duel.IsExistingMatchingCard(c48063985.spfilter2,tp,LOCATION_MZONE,0,1,c)
function c48063985.matfilter(c)
return (c:IsFusionSetCard(0x10b5) or c:IsFusionSetCard(0x20b5))
and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c48063985.spfilter2(c)
return c:IsFusionSetCard(0x20b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
function c48063985.spfilter1(c,tp,g)
return g:IsExists(c48063985.spfilter2,1,c,tp,c)
end
function c48063985.spfilter2(c,tp,mc)
return (c:IsFusionSetCard(0x10b5) and mc:IsFusionSetCard(0x20b5)
or c:IsFusionSetCard(0x20b5) and mc:IsFusionSetCard(0x10b5))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c48063985.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c48063985.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c48063985.matfilter,tp,LOCATION_MZONE,0,nil)
return g:IsExists(c48063985.spfilter1,1,nil,tp,g)
end
function c48063985.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c48063985.matfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c48063985.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
local g1=g:FilterSelect(tp,c48063985.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c48063985.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
local g2=g:FilterSelect(tp,c48063985.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
......
......@@ -45,29 +45,35 @@ end
function c48156348.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c48156348.spfilter1(c,tp)
return c:IsFusionCode(41470137) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
and Duel.IsExistingMatchingCard(c48156348.spfilter2,tp,LOCATION_MZONE,0,1,c)
function c48156348.cfilter(c)
return (c:IsFusionCode(41470137) or c:IsFusionSetCard(0x19) and c:IsType(TYPE_MONSTER))
and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
end
function c48156348.spfilter2(c)
return c:IsFusionSetCard(0x19) and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
function c48156348.spfilter1(c,tp,g)
return g:IsExists(c48156348.spfilter2,1,c,tp,c)
end
function c48156348.spfilter2(c,tp,mc)
return (c:IsFusionCode(41470137) and mc:IsFusionSetCard(0x19) and mc:IsType(TYPE_MONSTER)
or c:IsFusionSetCard(0x19) and c:IsType(TYPE_MONSTER) and mc:IsFusionCode(41470137))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c48156348.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c48156348.spfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c48156348.cfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c48156348.spfilter1,1,nil,tp,g)
end
function c48156348.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48156348,2))
local g1=Duel.SelectMatchingCard(tp,c48156348.spfilter1,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(48156348,3))
local g2=Duel.SelectMatchingCard(tp,c48156348.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
local g=Duel.GetMatchingGroup(c48156348.cfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=g:FilterSelect(tp,c48156348.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=g:FilterSelect(tp,c48156348.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local tc=g1:GetFirst()
while tc do
if not tc:IsFaceup() then Duel.ConfirmCards(1-tp,tc) end
tc=g1:GetNext()
local cg=g1:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g1,nil,2,REASON_COST)
end
......
......@@ -60,60 +60,50 @@ c49352945.material_setcode=0x8
function c49352945.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c49352945.spfilter(c,code1,code2,code3)
return c:IsAbleToDeckOrExtraAsCost() and (c:IsFusionCode(code1) or c:IsFusionCode(code2) or c:IsFusionCode(code3))
end
function c49352945.spfilter1(c,mg,ft)
local mg2=mg:Clone()
mg2:RemoveCard(c)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return ft>=-1 and c:IsFusionCode(89943723) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
and mg2:IsExists(c49352945.spfilter2,1,nil,mg2,ft)
end
function c49352945.spfilter2(c,mg,ft)
local mg2=mg:Clone()
mg2:RemoveCard(c)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return ft>=0 and c:IsFusionCode(17955766) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
and mg2:IsExists(c49352945.spfilter3,1,nil,ft)
end
function c49352945.spfilter3(c,ft)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return ft>=1 and c:IsFusionCode(54959865) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
function c49352945.cfilter(c)
return c:IsFusionCode(89943723,17955766,54959865) and c:IsAbleToDeckOrExtraAsCost()
end
function c49352945.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c49352945.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c49352945.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c49352945.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c49352945.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c49352945.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
local mg=Duel.GetMatchingGroup(c49352945.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723,17955766,54959865)
return mg:IsExists(c49352945.spfilter1,1,nil,mg,ft)
local mg=Duel.GetMatchingGroup(c49352945.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c49352945.fselect,1,nil,tp,mg,sg,89943723,17955766,54959865)
end
function c49352945.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=Duel.GetMatchingGroup(c49352945.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723,17955766,54959865)
local g=Group.CreateGroup()
local tc=nil
for i=1,3 do
local mg=Duel.GetMatchingGroup(c49352945.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if i==1 then
tc=mg:FilterSelect(tp,c49352945.spfilter1,1,1,nil,mg,ft):GetFirst()
end
if i==2 then
tc=mg:FilterSelect(tp,c49352945.spfilter2,1,1,nil,mg,ft):GetFirst()
end
if i==3 then
tc=mg:FilterSelect(tp,c49352945.spfilter3,1,1,nil,ft):GetFirst()
end
g:AddCard(tc)
mg:RemoveCard(tc)
if tc:IsLocation(LOCATION_MZONE) then ft=ft+1 end
local g=mg:FilterSelect(tp,c49352945.fselect,1,1,sg,tp,mg,sg,89943723,17955766,54959865)
sg:Merge(g)
end
local cg=g:Filter(Card.IsFacedown,nil)
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function c49352945.retcon1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(42015635)
......
......@@ -45,27 +45,46 @@ function c53315891.initial_effect(c)
e5:SetOperation(c53315891.spop)
c:RegisterEffect(e5)
end
function c53315891.sprfilter(c,code)
return c:IsFusionCode(code) and c:IsAbleToGraveAsCost()
function c53315891.cfilter(c)
return c:IsFusionCode(80019195,85800949,84565800) and c:IsAbleToGraveAsCost()
end
function c53315891.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c53315891.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c53315891.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c53315891.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c53315891.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c53315891.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-3
and Duel.IsExistingMatchingCard(c53315891.sprfilter,tp,LOCATION_ONFIELD,0,1,nil,80019195)
and Duel.IsExistingMatchingCard(c53315891.sprfilter,tp,LOCATION_ONFIELD,0,1,nil,85800949)
and Duel.IsExistingMatchingCard(c53315891.sprfilter,tp,LOCATION_ONFIELD,0,1,nil,84565800)
local mg=Duel.GetMatchingGroup(c53315891.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c53315891.fselect,1,nil,tp,mg,sg,80019195,85800949,84565800)
end
function c53315891.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c53315891.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c53315891.sprfilter,tp,LOCATION_ONFIELD,0,1,1,nil,80019195)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c53315891.sprfilter,tp,LOCATION_ONFIELD,0,1,1,nil,85800949)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g3=Duel.SelectMatchingCard(tp,c53315891.sprfilter,tp,LOCATION_ONFIELD,0,1,1,nil,84565800)
g1:Merge(g2)
g1:Merge(g3)
Duel.SendtoGrave(g1,REASON_COST)
local g=mg:FilterSelect(tp,c53315891.fselect,1,1,sg,tp,mg,sg,80019195,85800949,84565800)
sg:Merge(g)
end
Duel.SendtoGrave(sg,REASON_COST)
end
function c53315891.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
......
......@@ -26,42 +26,48 @@ function c56655675.initial_effect(c)
e3:SetOperation(c56655675.operation)
c:RegisterEffect(e3)
end
function c56655675.spfilter1(c,mg)
local mg2=mg:Clone()
mg2:RemoveCard(c)
return c:IsFusionSetCard(0x40b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
and mg2:IsExists(c56655675.spfilter2,1,nil,mg2)
function c56655675.cfilter(c)
return (c:IsFusionSetCard(0x40b5) or c:IsFusionSetCard(0x10b5) or c:IsFusionSetCard(0x20b5))
and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c56655675.spfilter2(c,mg)
local mg2=mg:Clone()
mg2:RemoveCard(c)
return c:IsFusionSetCard(0x10b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
and mg2:IsExists(c56655675.spfilter3,1,nil)
function c56655675.fcheck(c,sg,g,code,...)
if not c:IsFusionSetCard(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c56655675.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c56655675.spfilter3(c)
return c:IsFusionSetCard(0x20b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
function c56655675.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c56655675.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c56655675.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c56655675.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(Card.IsFusionSetCard,tp,LOCATION_MZONE,0,nil,0xb5)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and mg:IsExists(c56655675.spfilter1,1,nil,mg)
local mg=Duel.GetMatchingGroup(c56655675.cfilter,tp,LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c56655675.fselect,1,nil,tp,mg,sg,0x40b5,0x10b5,0x20b5)
end
function c56655675.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(Card.IsFusionSetCard,tp,LOCATION_MZONE,0,nil,0xb5)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=mg:FilterSelect(tp,c56655675.spfilter1,1,1,nil,mg)
mg:RemoveCard(g1:GetFirst())
local mg=Duel.GetMatchingGroup(c56655675.cfilter,tp,LOCATION_MZONE,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=mg:FilterSelect(tp,c56655675.spfilter2,1,1,nil,mg)
mg:RemoveCard(g2:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g3=mg:FilterSelect(tp,c56655675.spfilter3,1,1,nil)
g1:Merge(g2)
g1:Merge(g3)
c:SetMaterial(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
local g=mg:FilterSelect(tp,c56655675.fselect,1,1,sg,tp,mg,sg,0x40b5,0x10b5,0x20b5)
sg:Merge(g)
end
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c56655675.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
......
......@@ -42,22 +42,31 @@ end
function c72378329.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION
end
function c72378329.spfilter1(c,tp,fc)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsCanBeFusionMaterial(fc)
and Duel.CheckReleaseGroup(tp,c72378329.spfilter2,1,c,fc)
function c72378329.rfilter(c,fc)
return (c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_BEAST))
and c:IsCanBeFusionMaterial(fc)
end
function c72378329.spfilter2(c,fc)
return c:IsRace(RACE_BEAST) and c:IsCanBeFusionMaterial(fc)
function c72378329.spfilter1(c,tp,g)
return g:IsExists(c72378329.spfilter2,1,c,tp,c)
end
function c72378329.spfilter2(c,tp,mc)
return (c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and mc:IsRace(RACE_BEAST)
or c:IsRace(RACE_BEAST) and mc:IsRace(RACE_DRAGON) and mc:IsAttribute(ATTRIBUTE_DARK))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c72378329.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.CheckReleaseGroup(tp,c72378329.spfilter1,1,nil,tp,c)
local rg=Duel.GetReleaseGroup(tp):Filter(c72378329.rfilter,nil,c)
return rg:IsExists(c72378329.spfilter1,1,nil,tp,rg)
end
function c72378329.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectReleaseGroup(tp,c72378329.spfilter1,1,1,nil,tp,c)
local g2=Duel.SelectReleaseGroup(tp,c72378329.spfilter2,1,1,g1:GetFirst(),c)
local rg=Duel.GetReleaseGroup(tp):Filter(c72378329.rfilter,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=rg:FilterSelect(tp,c72378329.spfilter1,1,1,nil,tp,rg)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=rg:FilterSelect(tp,c72378329.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Release(g1,REASON_COST+REASON_FUSION+REASON_MATERIAL)
......
......@@ -26,19 +26,25 @@ end
function c73285669.spfilter(c)
return c:IsFusionSetCard(0x19) and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
end
function c73285669.spfilter1(c,tp,g)
return g:IsExists(c73285669.spfilter2,1,c,tp,c)
end
function c73285669.spfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c73285669.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c73285669.spfilter,tp,LOCATION_MZONE,0,2,nil)
local g=Duel.GetMatchingGroup(c73285669.spfilter,tp,LOCATION_MZONE,0,nil)
return g:IsExists(c73285669.spfilter1,1,nil,tp,g)
end
function c73285669.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c73285669.spfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=g:FilterSelect(tp,c73285669.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c73285669.spfilter,tp,LOCATION_MZONE,0,2,2,nil)
local tc=g:GetFirst()
while tc do
if not tc:IsFaceup() then Duel.ConfirmCards(1-tp,tc) end
tc=g:GetNext()
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
local g2=g:FilterSelect(tp,c73285669.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
Duel.SendtoDeck(g1,nil,2,REASON_COST)
end
......@@ -58,57 +58,50 @@ c78512663.material_setcode=0x8
function c78512663.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c78512663.spfilter(c,code)
return c:IsAbleToDeckOrExtraAsCost() and c:IsFusionCode(code)
function c78512663.cfilter(c)
return c:IsFusionCode(89943723,89621922,80344569) and c:IsAbleToDeckOrExtraAsCost()
end
function c78512663.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c78512663.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c78512663.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c78512663.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c78512663.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c78512663.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
local g1=Duel.GetMatchingGroup(c78512663.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c78512663.spfilter,tp,LOCATION_ONFIELD,0,nil,89621922)
local g3=Duel.GetMatchingGroup(c78512663.spfilter,tp,LOCATION_ONFIELD,0,nil,80344569)
if g1:GetCount()==0 or g2:GetCount()==0 or g3:GetCount()==0 then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f3=g3:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
if ft==-2 then return f1+f2+f3==3
elseif ft==-1 then return f1+f2+f3>=2
else return f1+f2+f3>=1 end
local mg=Duel.GetMatchingGroup(c78512663.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c78512663.fselect,1,nil,tp,mg,sg,89943723,89621922,80344569)
end
function c78512663.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c78512663.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c78512663.spfilter,tp,LOCATION_ONFIELD,0,nil,89621922)
local g3=Duel.GetMatchingGroup(c78512663.spfilter,tp,LOCATION_ONFIELD,0,nil,80344569)
g1:Merge(g2)
g1:Merge(g3)
local g=Group.CreateGroup()
local tc=nil
for i=1,3 do
local mg=Duel.GetMatchingGroup(c78512663.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
if tc:IsFusionCode(89943723) then
g1:Remove(Card.IsFusionCode,nil,89943723)
elseif tc:IsFusionCode(89621922) then
g1:Remove(Card.IsFusionCode,nil,89621922)
elseif tc:IsFusionCode(80344569) then
g1:Remove(Card.IsFusionCode,nil,80344569)
end
ft=ft+1
local g=mg:FilterSelect(tp,c78512663.fselect,1,1,sg,tp,mg,sg,89943723,89621922,80344569)
sg:Merge(g)
end
local cg=g:Filter(Card.IsFacedown,nil)
local cg=sg:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
Duel.SendtoDeck(sg,nil,2,REASON_COST)
end
function c78512663.atkval(e,c)
return Duel.GetFieldGroupCount(0,LOCATION_ONFIELD,LOCATION_ONFIELD)*400
......
......@@ -30,49 +30,49 @@ end
function c79229522.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c79229522.spfilter1(c,tp,ft)
if c:IsFusionCode(70095154) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial() and (c:IsControler(tp) or c:IsFaceup()) then
if ft>0 or (c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)) then
return Duel.IsExistingMatchingCard(c79229522.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp)
else
return Duel.IsExistingMatchingCard(c79229522.spfilter2,tp,LOCATION_MZONE,0,1,c,tp)
end
else return false end
function c79229522.cfilter(c,tp)
return (c:IsFusionCode(70095154) or c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER))
and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost() and (c:IsControler(tp) or c:IsFaceup())
end
function c79229522.fcheck(c,sg)
return c:IsFusionCode(70095154) and sg:FilterCount(c79229522.fcheck2,c)+1==sg:GetCount()
end
function c79229522.fcheck2(c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER)
end
function c79229522.spfilter2(c,tp)
return c:IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial() and (c:IsControler(tp) or c:IsFaceup())
function c79229522.fgoal(c,tp,sg)
return sg:GetCount()>1 and Duel.GetLocationCountFromEx(tp,tp,sg)>0 and sg:IsExists(c79229522.fcheck,1,nil,sg)
end
function c79229522.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=c79229522.fgoal(c,tp,sg) or mg:IsExists(c79229522.fselect,1,sg,tp,mg,sg)
sg:RemoveCard(c)
return res
end
function c79229522.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp,ft)
local mg=Duel.GetMatchingGroup(c79229522.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
local sg=Group.CreateGroup()
return mg:IsExists(c79229522.fselect,1,nil,tp,mg,sg)
end
function c79229522.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79229522,0))
local g1=Duel.SelectMatchingCard(tp,c79229522.spfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp,ft)
local tc=g1:GetFirst()
local g=Duel.GetMatchingGroup(c79229522.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,tc,tp)
local g2=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79229522,1))
if ft>0 or (tc:IsControler(tp) and tc:IsLocation(LOCATION_MZONE)) then
g2=g:Select(tp,1,10,nil)
else
g2=g:FilterSelect(tp,Card.IsControler,1,1,nil,tp)
if g:GetCount()>1 and Duel.SelectYesNo(tp,210) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(79229522,1))
local g3=g:Select(tp,1,9,g2:GetFirst())
g2:Merge(g3)
end
local mg=Duel.GetMatchingGroup(c79229522.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
local sg=Group.CreateGroup()
while true do
local cg=mg:Filter(c79229522.fselect,sg,tp,mg,sg)
if cg:GetCount()==0
or (c79229522.fgoal(c,tp,sg) and not Duel.SelectYesNo(tp,210)) then break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=cg:Select(tp,1,1,nil)
sg:Merge(g)
end
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_COST)
Duel.SendtoGrave(sg,REASON_COST)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+0xff0000)
e1:SetValue(g1:GetCount()*1000)
e1:SetValue(sg:GetCount()*1000)
c:RegisterEffect(e1)
end
......@@ -40,24 +40,30 @@ function c80532587.initial_effect(c)
e4:SetOperation(c80532587.desop)
c:RegisterEffect(e4)
end
function c80532587.sprfilter1(c,tp,fc)
return c:IsType(TYPE_SYNCHRO) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial(fc)
and Duel.IsExistingMatchingCard(c80532587.sprfilter2,tp,LOCATION_MZONE,0,1,c,fc)
function c80532587.cfilter(c,fc)
return c:IsFusionType(TYPE_SYNCHRO+TYPE_XYZ) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost()
end
function c80532587.sprfilter2(c,fc)
return c:IsType(TYPE_XYZ) and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial(fc)
function c80532587.spfilter1(c,tp,g)
return g:IsExists(c80532587.spfilter2,1,c,tp,c)
end
function c80532587.spfilter2(c,tp,mc)
return (c:IsFusionType(TYPE_SYNCHRO) and mc:IsFusionType(TYPE_XYZ)
or c:IsFusionType(TYPE_XYZ) and mc:IsFusionType(TYPE_SYNCHRO))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c80532587.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c80532587.sprfilter1,tp,LOCATION_MZONE,0,1,nil,tp,c)
local mg=Duel.GetMatchingGroup(c80532587.cfilter,tp,LOCATION_MZONE,0,nil,c)
return mg:IsExists(c80532587.spfilter1,1,nil,tp,mg)
end
function c80532587.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c80532587.cfilter,tp,LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=Duel.SelectMatchingCard(tp,c80532587.sprfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
local g1=mg:FilterSelect(tp,c80532587.spfilter1,1,1,nil,tp,mg)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=Duel.SelectMatchingCard(tp,c80532587.sprfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst(),c)
local g2=mg:FilterSelect(tp,c80532587.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_COST)
......
......@@ -49,57 +49,36 @@ c81566151.material_setcode=0x8
function c81566151.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c81566151.spfilter(c,code)
return c:IsAbleToDeckOrExtraAsCost() and c:IsFusionCode(code)
function c81566151.matfilter(c)
return c:IsFusionCode(89943723,89621922) and c:IsAbleToDeckOrExtraAsCost()
end
function c81566151.spfilter1(c,tp,g)
return g:IsExists(c81566151.spfilter2,1,c,tp,c)
end
function c81566151.spfilter2(c,tp,mc)
return (c:IsFusionCode(89943723) and mc:IsFusionCode(89621922)
or c:IsFusionCode(89621922) and mc:IsFusionCode(89943723))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c81566151.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
local g1=Duel.GetMatchingGroup(c81566151.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c81566151.spfilter,tp,LOCATION_ONFIELD,0,nil,89621922)
if g1:GetCount()==0 or g2:GetCount()==0 then return false end
if g1:GetCount()==1 and g2:GetCount()==1 and g1:GetFirst()==g2:GetFirst() then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
if ft==-1 then return f1>0 and f2>0
else return f1>0 or f2>0 end
local g=Duel.GetMatchingGroup(c81566151.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c81566151.spfilter1,1,nil,tp,g)
end
function c81566151.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c81566151.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c81566151.spfilter,tp,LOCATION_ONFIELD,0,nil,89621922)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
local g=Duel.GetMatchingGroup(c81566151.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
ft=ft+1
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
if i==1 then
g1:Clear()
if tc:IsFusionCode(89943723) then
local sg=Duel.GetMatchingGroup(c81566151.spfilter,tp,LOCATION_ONFIELD,0,tc,89621922)
g1:Merge(sg)
end
if tc:IsFusionCode(89621922) then
local sg=Duel.GetMatchingGroup(c81566151.spfilter,tp,LOCATION_ONFIELD,0,tc,89943723)
g1:Merge(sg)
end
end
end
local cg=g:Filter(Card.IsFacedown,nil)
local g1=g:FilterSelect(tp,c81566151.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=g:FilterSelect(tp,c81566151.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local cg=g1:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
Duel.SendtoDeck(g1,nil,2,REASON_COST)
end
function c81566151.retcon1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(42015635)
......
......@@ -44,53 +44,32 @@ end
function c84243274.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c84243274.spfilter(c,code)
return c:IsFusionCode(code) and c:IsAbleToRemoveAsCost()
function c84243274.matfilter(c)
return c:IsFusionCode(58859575,91998119) and c:IsAbleToRemoveAsCost()
end
function c84243274.spfilter1(c,tp,g)
return g:IsExists(c84243274.spfilter2,1,c,tp,c)
end
function c84243274.spfilter2(c,tp,mc)
return (c:IsFusionCode(58859575) and mc:IsFusionCode(91998119)
or c:IsFusionCode(91998119) and mc:IsFusionCode(58859575))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c84243274.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
local g1=Duel.GetMatchingGroup(c84243274.spfilter,tp,LOCATION_ONFIELD,0,nil,58859575)
local g2=Duel.GetMatchingGroup(c84243274.spfilter,tp,LOCATION_ONFIELD,0,nil,91998119)
if g1:GetCount()==0 or g2:GetCount()==0 then return false end
if g1:GetCount()==1 and g2:GetCount()==1 and g1:GetFirst()==g2:GetFirst() then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
if ft==-1 then return f1>0 and f2>0
else return f1>0 or f2>0 end
local g=Duel.GetMatchingGroup(c84243274.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c84243274.spfilter1,1,nil,tp,g)
end
function c84243274.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c84243274.spfilter,tp,LOCATION_ONFIELD,0,nil,58859575)
local g2=Duel.GetMatchingGroup(c84243274.spfilter,tp,LOCATION_ONFIELD,0,nil,91998119)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
local g=Duel.GetMatchingGroup(c84243274.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
ft=ft+1
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
if i==1 then
g1:Clear()
if tc:IsFusionCode(91998119) then
local sg=Duel.GetMatchingGroup(c84243274.spfilter,tp,LOCATION_ONFIELD,0,tc,58859575)
g1:Merge(sg)
end
if tc:IsFusionCode(58859575) then
local sg=Duel.GetMatchingGroup(c84243274.spfilter,tp,LOCATION_ONFIELD,0,tc,91998119)
g1:Merge(sg)
end
end
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c84243274.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=g:FilterSelect(tp,c84243274.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c84243274.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
......
......@@ -53,57 +53,36 @@ c85507811.material_setcode=0x8
function c85507811.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c85507811.spfilter(c,code)
return c:IsAbleToDeckOrExtraAsCost() and c:IsFusionCode(code)
function c85507811.matfilter(c)
return c:IsFusionCode(89943723,17732278) and c:IsAbleToDeckOrExtraAsCost()
end
function c85507811.spfilter1(c,tp,g)
return g:IsExists(c85507811.spfilter2,1,c,tp,c)
end
function c85507811.spfilter2(c,tp,mc)
return (c:IsFusionCode(89943723) and mc:IsFusionCode(17732278)
or c:IsFusionCode(17732278) and mc:IsFusionCode(89943723))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c85507811.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
local g1=Duel.GetMatchingGroup(c85507811.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c85507811.spfilter,tp,LOCATION_ONFIELD,0,nil,17732278)
if g1:GetCount()==0 or g2:GetCount()==0 then return false end
if g1:GetCount()==1 and g2:GetCount()==1 and g1:GetFirst()==g2:GetFirst() then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
if ft==-1 then return f1>0 and f2>0
else return f1>0 or f2>0 end
local g=Duel.GetMatchingGroup(c85507811.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c85507811.spfilter1,1,nil,tp,g)
end
function c85507811.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c85507811.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c85507811.spfilter,tp,LOCATION_ONFIELD,0,nil,17732278)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
local g=Duel.GetMatchingGroup(c85507811.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
ft=ft+1
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
if i==1 then
g1:Clear()
if tc:IsFusionCode(89943723) then
local sg=Duel.GetMatchingGroup(c85507811.spfilter,tp,LOCATION_ONFIELD,0,tc,17732278)
g1:Merge(sg)
end
if tc:IsFusionCode(17732278) then
local sg=Duel.GetMatchingGroup(c85507811.spfilter,tp,LOCATION_ONFIELD,0,tc,89943723)
g1:Merge(sg)
end
end
end
local cg=g:Filter(Card.IsFacedown,nil)
local g1=g:FilterSelect(tp,c85507811.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=g:FilterSelect(tp,c85507811.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local cg=g1:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g,nil,2,REASON_COST)
Duel.SendtoDeck(g1,nil,2,REASON_COST)
end
function c85507811.retcon1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(42015635)
......
......@@ -37,24 +37,31 @@ function c86274272.initial_effect(c)
e4:SetOperation(c86274272.spop)
c:RegisterEffect(e4)
end
function c86274272.spfilter1(c,tp)
return c:IsFusionSetCard(0x10b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
and Duel.IsExistingMatchingCard(c86274272.spfilter2,tp,LOCATION_MZONE,0,1,c)
function c86274272.matfilter(c)
return (c:IsFusionSetCard(0x10b5) or c:IsFusionSetCard(0x20b5))
and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c86274272.spfilter2(c)
return c:IsFusionSetCard(0x20b5) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
function c86274272.spfilter1(c,tp,g)
return g:IsExists(c86274272.spfilter2,1,c,tp,c)
end
function c86274272.spfilter2(c,tp,mc)
return (c:IsFusionSetCard(0x10b5) and mc:IsFusionSetCard(0x20b5)
or c:IsFusionSetCard(0x20b5) and mc:IsFusionSetCard(0x10b5))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c86274272.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c86274272.spfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c86274272.matfilter,tp,LOCATION_MZONE,0,nil)
return g:IsExists(c86274272.spfilter1,1,nil,tp,g)
end
function c86274272.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c86274272.matfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c86274272.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
local g1=g:FilterSelect(tp,c86274272.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c86274272.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
local g2=g:FilterSelect(tp,c86274272.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
......
......@@ -46,29 +46,35 @@ end
function c90957527.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c90957527.spfilter1(c,tp)
return c:IsFusionCode(79580323) and c:IsAbleToDeckOrExtraAsCost() and c:IsCanBeFusionMaterial()
and Duel.IsExistingMatchingCard(c90957527.spfilter2,tp,LOCATION_MZONE,0,1,c)
function c90957527.cfilter(c)
return (c:IsFusionCode(79580323) or c:IsFusionSetCard(0x19) and c:IsType(TYPE_MONSTER))
and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
end
function c90957527.spfilter2(c)
return c:IsFusionSetCard(0x19) and c:IsCanBeFusionMaterial() and c:IsAbleToDeckOrExtraAsCost()
function c90957527.spfilter1(c,tp,g)
return g:IsExists(c90957527.spfilter2,1,c,tp,c)
end
function c90957527.spfilter2(c,tp,mc)
return (c:IsFusionCode(79580323) and mc:IsFusionSetCard(0x19) and mc:IsType(TYPE_MONSTER)
or c:IsFusionSetCard(0x19) and c:IsType(TYPE_MONSTER) and mc:IsFusionCode(79580323))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c90957527.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and Duel.IsExistingMatchingCard(c90957527.spfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp)
local g=Duel.GetMatchingGroup(c90957527.cfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c90957527.spfilter1,1,nil,tp,g)
end
function c90957527.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(90957527,2))
local g1=Duel.SelectMatchingCard(tp,c90957527.spfilter1,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(90957527,3))
local g2=Duel.SelectMatchingCard(tp,c90957527.spfilter2,tp,LOCATION_MZONE,0,1,1,g1:GetFirst())
local g=Duel.GetMatchingGroup(c90957527.cfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=g:FilterSelect(tp,c90957527.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=g:FilterSelect(tp,c90957527.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local tc=g1:GetFirst()
while tc do
if not tc:IsFaceup() then Duel.ConfirmCards(1-tp,tc) end
tc=g1:GetNext()
local cg=g1:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(g1,nil,2,REASON_COST)
end
......
......@@ -34,53 +34,46 @@ end
function c91998119.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA+LOCATION_GRAVE)
end
function c91998119.spfilter(c,code)
return c:IsFusionCode(code) and c:IsAbleToRemoveAsCost()
function c91998119.cfilter(c)
return c:IsFusionCode(62651957,65622692,64500000) and c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial()
end
function c91998119.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c91998119.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c91998119.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c91998119.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c91998119.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c91998119.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-2 then return false end
local g1=Duel.GetMatchingGroup(c91998119.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c91998119.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g3=Duel.GetMatchingGroup(c91998119.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
if g1:GetCount()==0 or g2:GetCount()==0 or g3:GetCount()==0 then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
local f3=g3:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)>0 and 1 or 0
if ft==-2 then return f1+f2+f3==3
elseif ft==-1 then return f1+f2+f3>=2
else return f1+f2+f3>=1 end
local mg=Duel.GetMatchingGroup(c91998119.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
return mg:IsExists(c91998119.fselect,1,nil,tp,mg,sg,62651957,65622692,64500000)
end
function c91998119.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c91998119.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c91998119.spfilter,tp,LOCATION_ONFIELD,0,nil,65622692)
local g3=Duel.GetMatchingGroup(c91998119.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
g1:Merge(g2)
g1:Merge(g3)
local g=Group.CreateGroup()
local tc=nil
for i=1,3 do
local mg=Duel.GetMatchingGroup(c91998119.cfilter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
if tc:IsFusionCode(62651957) then
g1:Remove(Card.IsFusionCode,nil,62651957)
elseif tc:IsFusionCode(65622692) then
g1:Remove(Card.IsFusionCode,nil,65622692)
elseif tc:IsFusionCode(64500000) then
g1:Remove(Card.IsFusionCode,nil,64500000)
end
ft=ft+1
local g=mg:FilterSelect(tp,c91998119.fselect,1,1,sg,tp,mg,sg,62651957,65622692,64500000)
sg:Merge(g)
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c91998119.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
......
......@@ -34,53 +34,32 @@ end
function c99724761.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA+LOCATION_GRAVE)
end
function c99724761.spfilter(c,code)
return c:IsFusionCode(code) and c:IsAbleToRemoveAsCost()
function c99724761.matfilter(c)
return c:IsFusionCode(62651957,64500000) and c:IsAbleToRemoveAsCost()
end
function c99724761.spfilter1(c,tp,g)
return g:IsExists(c99724761.spfilter2,1,c,tp,c)
end
function c99724761.spfilter2(c,tp,mc)
return (c:IsFusionCode(62651957) and mc:IsFusionCode(64500000)
or c:IsFusionCode(64500000) and mc:IsFusionCode(62651957))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c99724761.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
local g1=Duel.GetMatchingGroup(c99724761.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c99724761.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
if g1:GetCount()==0 or g2:GetCount()==0 then return false end
if g1:GetCount()==1 and g2:GetCount()==1 and g1:GetFirst()==g2:GetFirst() then return false end
if ft>0 then return true end
local f1=g1:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
local f2=g2:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)
if ft==-1 then return f1>0 and f2>0
else return f1>0 or f2>0 end
local g=Duel.GetMatchingGroup(c99724761.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c99724761.spfilter1,1,nil,tp,g)
end
function c99724761.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c99724761.spfilter,tp,LOCATION_ONFIELD,0,nil,62651957)
local g2=Duel.GetMatchingGroup(c99724761.spfilter,tp,LOCATION_ONFIELD,0,nil,64500000)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
local g=Duel.GetMatchingGroup(c99724761.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
if ft<=0 then
tc=g1:FilterSelect(tp,Card.IsLocation,1,1,nil,LOCATION_MZONE):GetFirst()
ft=ft+1
else
tc=g1:Select(tp,1,1,nil):GetFirst()
end
g:AddCard(tc)
if i==1 then
g1:Clear()
if tc:IsFusionCode(64500000) then
local sg=Duel.GetMatchingGroup(c99724761.spfilter,tp,LOCATION_ONFIELD,0,tc,62651957)
g1:Merge(sg)
end
if tc:IsFusionCode(62651957) then
local sg=Duel.GetMatchingGroup(c99724761.spfilter,tp,LOCATION_ONFIELD,0,tc,64500000)
g1:Merge(sg)
end
end
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
local g1=g:FilterSelect(tp,c99724761.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=g:FilterSelect(tp,c99724761.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c99724761.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
......
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