Commit 51d2a9e3 authored by VanillaSalt's avatar VanillaSalt

fix

parent a6c08ba0
......@@ -34,11 +34,11 @@ function c15717011.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
local mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local mg=Duel.GetMatchingGroup(Card.IsCanBeFusionMaterial,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(c15717011.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,c)
end
e:SetLabel(0)
local mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local mg=Duel.GetMatchingGroup(Card.IsCanBeFusionMaterial,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c15717011.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg,c)
local mat=Duel.SelectFusionMaterial(tp,g:GetFirst(),mg,c,PLAYER_NONE+0x100)
......
......@@ -59,10 +59,6 @@ function c2111707.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=g:FilterSelect(tp,c2111707.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.Remove(g1,POS_FACEUP,REASON_COST)
end
function c2111707.descost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -53,7 +53,7 @@ function c23536866.filter2(c,e,tp)
end
function c23536866.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.GetLocationCountFromEx(tp)<=0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c23536866.filter2,nil,e,tp)
if g:GetCount()<2 then return end
local tc1=g:GetFirst()
......@@ -75,6 +75,7 @@ function c23536866.operation(e,tp,eg,ep,ev,re,r,rp)
local e4=e3:Clone()
tc2:RegisterEffect(e4)
Duel.SpecialSummonComplete()
if Duel.GetLocationCountFromEx(tp,tp,g)<=0 then return end
Duel.BreakEffect()
local xyzg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
......
......@@ -35,10 +35,11 @@ function c23581825.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_EXTRA)
end
function c23581825.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or Duel.GetLocationCountFromEx(tp)<=0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
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.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c23581825.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+2)
local sc=g:GetFirst()
......
......@@ -59,10 +59,6 @@ function c25119460.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=g:FilterSelect(tp,c25119460.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.Remove(g1,POS_FACEUP,REASON_COST)
end
function c25119460.descost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -32,7 +32,7 @@ end
function c42002073.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,c)
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local res=Duel.IsExistingMatchingCard(c42002073.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -50,7 +50,7 @@ end
function c42002073.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c42002073.filter1,c,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c42002073.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c42002073.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
......
......@@ -55,10 +55,11 @@ function c43383478.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,tp,LOCATION_EXTRA)
end
function c43383478.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or Duel.GetLocationCountFromEx(tp)<=0 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
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.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c43383478.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+1)
local sc=g:GetFirst()
......
......@@ -30,8 +30,8 @@ end
function c45206713.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,c,LOCATION_HAND)
local res=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND)
local res=Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c45206713.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -49,7 +49,7 @@ end
function c45206713.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c45206713.filter1,c,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c45206713.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c45206713.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
......@@ -60,7 +60,7 @@ function c45206713.operation(e,tp,eg,ep,ev,re,r,rp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c45206713.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c)
end
if (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg1:GetCount()>0) or (sg2~=nil and sg2:GetCount()>0) then
if (Duel.GetLocationCountFromEx(tp)>0 and sg1:GetCount()>0) or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -13,9 +13,10 @@ function c50619462.initial_effect(c)
end
function c50619462.cfilter(c,e,tp)
local race=c:GetOriginalRace()
return c:IsFaceup() and (race==RACE_WINDBEAST or race==RACE_BEAST
return c:IsFaceup() and (race==RACE_WINDBEAST or race==RACE_BEAST
or race==RACE_BEASTWARRIOR) and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c50619462.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,race)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c50619462.spfilter(c,e,tp,race)
return c:GetOriginalRace()==race and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -39,7 +40,7 @@ function c50619462.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c50619462.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.GetLocationCountFromEx(tp)>0 then
local race=e:GetLabelObject():GetOriginalRace()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c50619462.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,race)
......
......@@ -34,57 +34,36 @@ c5128859.material_setcode=0x8
function c5128859.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c5128859.spfilter(c,code)
return c:IsAbleToDeckOrExtraAsCost() and c:IsFusionCode(code)
function c5128859.matfilter(c)
return c:IsFusionCode(89943723,78734254) and c:IsAbleToDeckOrExtraAsCost()
end
function c5128859.spfilter1(c,tp,g)
return g:IsExists(c5128859.spfilter2,1,c,tp,c)
end
function c5128859.spfilter2(c,tp,mc)
return (c:IsFusionCode(89943723) and mc:IsFusionCode(78734254)
or c:IsFusionCode(78734254) and mc:IsFusionCode(89943723))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c5128859.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(c5128859.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c5128859.spfilter,tp,LOCATION_ONFIELD,0,nil,78734254)
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(c5128859.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c5128859.spfilter1,1,nil,tp,g)
end
function c5128859.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c5128859.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c5128859.spfilter,tp,LOCATION_ONFIELD,0,nil,78734254)
local g=Duel.GetMatchingGroup(c5128859.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=g:FilterSelect(tp,c5128859.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=g:FilterSelect(tp,c5128859.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
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(c5128859.spfilter,tp,LOCATION_ONFIELD,0,tc,78734254)
g1:Merge(sg)
end
if tc:IsFusionCode(78734254) then
local sg=Duel.GetMatchingGroup(c5128859.spfilter,tp,LOCATION_ONFIELD,0,tc,89943723)
g1:Merge(sg)
end
end
end
local cg=g:Filter(Card.IsFacedown,nil)
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 c5128859.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
......
......@@ -49,7 +49,7 @@ function c52101615.filter2(c,e,tp,code)
return c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c52101615.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 tc=Duel.GetFirstMatchingCard(c52101615.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,code)
if tc then
......
......@@ -34,12 +34,12 @@ function c52963531.spfilter(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c52963531.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(c52963531.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c52963531.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c52963531.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -10,10 +10,15 @@ function c5338223.initial_effect(c)
e1:SetOperation(c5338223.activate)
c:RegisterEffect(e1)
end
function c5338223.cfilter(c,ft,tp)
return c:IsSetCard(0x304e)
and (ft>0 or (c:IsControler(tp) and c:GetSequence()<5)) and (c:IsControler(tp) or c:IsFaceup())
end
function c5338223.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0x304e) end
local rg=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0x304e)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and Duel.CheckReleaseGroup(tp,c5338223.cfilter,1,nil,ft,tp) end
local rg=Duel.SelectReleaseGroup(tp,c5338223.cfilter,1,1,nil,ft,tp)
Duel.Release(rg,REASON_COST)
end
function c5338223.spfilter(c,e,tp)
......@@ -21,13 +26,16 @@ function c5338223.spfilter(c,e,tp)
end
function c5338223.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=(e:GetLabel()==1) and 0 or -1
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c5338223.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>chkf
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c5338223.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
else
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c5338223.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c5338223.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
......
......@@ -31,31 +31,61 @@ end
function c54283059.filter1(c,e)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c54283059.filter2(c,e,tp,m)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x3008) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
and c:CheckFusionMaterial(m)
function c54283059.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x3008) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c54283059.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function c54283059.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg=Duel.GetMatchingGroup(c54283059.filter0,tp,LOCATION_REMOVED,0,nil)
return Duel.IsExistingMatchingCard(c54283059.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
local res=Duel.IsExistingMatchingCard(c54283059.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c54283059.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c54283059.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg=Duel.GetMatchingGroup(c54283059.filter1,tp,LOCATION_REMOVED,0,nil,e)
local sg=Duel.GetMatchingGroup(c54283059.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg)
if sg:GetCount()>0 then
local sg1=Duel.GetMatchingGroup(c54283059.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c54283059.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local mat=Duel.SelectFusionMaterial(tp,tc,mg)
tc:SetMaterial(mat)
Duel.SendtoDeck(mat,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc, SUMMON_TYPE_FUSION, tp, tp, false, false, POS_FACEUP)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
Duel.SendtoDeck(mat,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
......@@ -52,57 +52,36 @@ c55171412.material_setcode=0x8
function c55171412.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c55171412.spfilter(c,code)
return c:IsAbleToDeckOrExtraAsCost() and c:IsFusionCode(code)
function c55171412.matfilter(c)
return c:IsFusionCode(89943723,17955766) and c:IsAbleToDeckOrExtraAsCost()
end
function c55171412.spfilter1(c,tp,g)
return g:IsExists(c55171412.spfilter2,1,c,tp,c)
end
function c55171412.spfilter2(c,tp,mc)
return (c:IsFusionCode(89943723) and mc:IsFusionCode(17955766)
or c:IsFusionCode(17955766) and mc:IsFusionCode(89943723))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c55171412.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(c55171412.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c55171412.spfilter,tp,LOCATION_ONFIELD,0,nil,17955766)
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(c55171412.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c55171412.spfilter1,1,nil,tp,g)
end
function c55171412.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c55171412.spfilter,tp,LOCATION_ONFIELD,0,nil,89943723)
local g2=Duel.GetMatchingGroup(c55171412.spfilter,tp,LOCATION_ONFIELD,0,nil,17955766)
local g=Duel.GetMatchingGroup(c55171412.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=g:FilterSelect(tp,c55171412.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=g:FilterSelect(tp,c55171412.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
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(c55171412.spfilter,tp,LOCATION_ONFIELD,0,tc,17955766)
g1:Merge(sg)
end
if tc:IsFusionCode(17955766) then
local sg=Duel.GetMatchingGroup(c55171412.spfilter,tp,LOCATION_ONFIELD,0,tc,89943723)
g1:Merge(sg)
end
end
end
local cg=g:Filter(Card.IsFacedown,nil)
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 c55171412.retcon1(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsHasEffect(42015635)
......
......@@ -27,23 +27,23 @@ end
function c56611470.xyzfilter(c,mg)
return c:IsXyzSummonable(mg,2,2)
end
function c56611470.mfilter1(c,mg,exg)
return mg:IsExists(c56611470.mfilter2,1,c,c,exg)
function c56611470.mfilter1(c,mg,exg,tp)
return mg:IsExists(c56611470.mfilter2,1,c,c,exg,tp)
end
function c56611470.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
function c56611470.mfilter2(c,mc,exg,tp)
local g=Group.FromCards(c,mc)
return exg:IsExists(Card.IsXyzSummonable,1,nil,g) and Duel.GetLocationCountFromEx(tp,tp,g)>0
end
function c56611470.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c56611470.filter,tp,LOCATION_MZONE,0,nil,e)
local exg=Duel.GetMatchingGroup(c56611470.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and exg:GetCount()>0 end
if chk==0 then return mg:IsExists(c56611470.mfilter1,1,nil,mg,exg,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg1=mg:FilterSelect(tp,c56611470.mfilter1,1,1,nil,mg,exg)
local sg1=mg:FilterSelect(tp,c56611470.mfilter1,1,1,nil,mg,exg,tp)
local tc1=sg1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg2=mg:FilterSelect(tp,c56611470.mfilter2,1,1,tc1,tc1,exg)
local sg2=mg:FilterSelect(tp,c56611470.mfilter2,1,1,tc1,tc1,exg,tp)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......@@ -59,9 +59,9 @@ function c56611470.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetTarget(c56611470.attg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<-1 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c56611470.tfilter,nil,e)
if g:GetCount()<2 then return end
if Duel.GetLocationCountFromEx(tp,tp,g)<=0 then return end
local xyzg=Duel.GetMatchingGroup(c56611470.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -54,19 +54,26 @@ function c57734012.filter2(c,e,tp,mc,no)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c57734012.target(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_GRAVE end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetFlagEffect(tp,57734012)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c57734012.filter1,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
and Duel.GetFlagEffect(tp,57734012)==0 and loc~=0 and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c57734012.filter1,tp,loc,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc)
end
function c57734012.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,57734012)~=0 then return end
Duel.RegisterFlagEffect(tp,57734012,0,0,0)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_GRAVE end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c57734012.filter1),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp)
local g1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c57734012.filter1),tp,loc,0,1,1,nil,e,tp)
local tc1=g1:GetFirst()
if tc1 and Duel.SpecialSummon(tc1,0,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.GetLocationCountFromEx(tp,tp,tc1)<=0 then return end
local m=_G["c"..tc1:GetCode()]
if not m then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -124,12 +124,12 @@ function c57761191.spfilter(c,e,tp)
return c:IsAttribute(0xf) and c:IsType(0x802040) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c57761191.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(c57761191.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c57761191.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)
local g=Duel.SelectMatchingCard(tp,c57761191.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -92,12 +92,12 @@ function c58069384.spfilter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58069384.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(c58069384.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c58069384.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)
local g=Duel.SelectMatchingCard(tp,c58069384.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -34,53 +34,32 @@ end
function c58859575.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c58859575.spfilter(c,code)
return c:IsFusionCode(code) and c:IsAbleToRemoveAsCost()
function c58859575.matfilter(c)
return c:IsFusionCode(51638941,96300057) and c:IsAbleToRemoveAsCost()
end
function c58859575.spfilter1(c,tp,g)
return g:IsExists(c58859575.spfilter2,1,c,tp,c)
end
function c58859575.spfilter2(c,tp,mc)
return (c:IsFusionCode(51638941) and mc:IsFusionCode(96300057)
or c:IsFusionCode(96300057) and mc:IsFusionCode(51638941))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c58859575.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(c58859575.spfilter,tp,LOCATION_ONFIELD,0,nil,51638941)
local g2=Duel.GetMatchingGroup(c58859575.spfilter,tp,LOCATION_ONFIELD,0,nil,96300057)
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(c58859575.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c58859575.spfilter1,1,nil,tp,g)
end
function c58859575.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c58859575.spfilter,tp,LOCATION_ONFIELD,0,nil,51638941)
local g2=Duel.GetMatchingGroup(c58859575.spfilter,tp,LOCATION_ONFIELD,0,nil,96300057)
local g=Duel.GetMatchingGroup(c58859575.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c58859575.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=g:FilterSelect(tp,c58859575.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
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(96300057) then
local sg=Duel.GetMatchingGroup(c58859575.spfilter,tp,LOCATION_ONFIELD,0,tc,51638941)
g1:Merge(sg)
end
if tc:IsFusionCode(51638941) then
local sg=Duel.GetMatchingGroup(c58859575.spfilter,tp,LOCATION_ONFIELD,0,tc,96300057)
g1:Merge(sg)
end
end
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c58859575.poscost(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
......
......@@ -32,12 +32,12 @@ function c58901502.spfilter(c,e,tp)
return c:IsCode(58901502) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58901502.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(c58901502.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c58901502.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)
local g=Duel.SelectMatchingCard(tp,c58901502.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -27,6 +27,7 @@ function c58988903.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsSetCard(0xba) and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c58988903.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk+2)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c58988903.filter2(c,e,tp,mc,rk)
return c:GetRank()==rk and c:IsSetCard(0xba) and mc:IsCanBeXyzMaterial(c)
......@@ -34,15 +35,14 @@ function c58988903.filter2(c,e,tp,mc,rk)
end
function c58988903.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c58988903.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c58988903.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c58988903.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c58988903.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c58988903.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c58988903.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank()+2)
......
......@@ -60,12 +60,12 @@ function c59822133.spfilter(c,e,tp)
and not c:IsCode(59822133) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c59822133.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c59822133.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c59822133.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)
local g=Duel.SelectMatchingCard(tp,c59822133.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
......
......@@ -70,7 +70,6 @@ function c60226558.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if ec:IsControler(1-tp) then return false end
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg1=Duel.GetFusionMaterial(tp)
mg1:RemoveCard(ec)
local res=Duel.IsExistingMatchingCard(c60226558.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,ec,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -91,7 +90,7 @@ function c60226558.spop(e,tp,eg,ep,ev,re,r,rp)
local ec=c:GetEquipTarget()
if ec:IsControler(1-tp) or ec:IsImmuneToEffect(e) then return end
local chkf=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and PLAYER_NONE or tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c60226558.filter1,ec,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c60226558.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c60226558.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,ec,nil,chkf)
local mg2=nil
local sg2=nil
......
......@@ -29,7 +29,8 @@ function c61314842.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and exg:GetCount()>0 end
and Duel.GetLocationCountFromEx(tp)>0
and mg:IsExists(c61314842.mfilter1,1,nil,mg,exg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:FilterSelect(tp,c61314842.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
......@@ -48,6 +49,7 @@ function c61314842.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c61314842.filter2,nil,e,tp)
if g:GetCount()<2 then return end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if Duel.GetLocationCountFromEx(tp,tp,g)<=0 then return end
Duel.BreakEffect()
local xyzg=Duel.GetMatchingGroup(c61314842.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
......
......@@ -40,7 +40,7 @@ end
function c6205579.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,c)
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local res=Duel.IsExistingMatchingCard(c6205579.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -58,7 +58,7 @@ end
function c6205579.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c6205579.spfilter1,c,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c6205579.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c6205579.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
......
......@@ -48,7 +48,8 @@ function c62829077.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>2
and exg:GetCount()>0 end
and Duel.GetLocationCountFromEx(tp)>0
and mg:IsExists(c62829077.mfilter1,1,nil,mg,exg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:FilterSelect(tp,c62829077.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
......@@ -84,6 +85,7 @@ function c62829077.activate(e,tp,eg,ep,ev,re,r,rp)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
if Duel.GetLocationCountFromEx(tp,tp,g)<=0 then return end
Duel.BreakEffect()
local xyzg=Duel.GetMatchingGroup(c62829077.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
......
......@@ -46,7 +46,7 @@ end
function c62895219.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,c)
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local res=Duel.IsExistingMatchingCard(c62895219.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -64,7 +64,7 @@ end
function c62895219.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c62895219.filter1,c,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c62895219.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c62895219.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
......
......@@ -26,19 +26,18 @@ function c63992027.spfilter(c,e,tp,ec)
end
function c63992027.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c63992027.filter(chkc,nil,nil) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(c63992027.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c63992027.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c63992027.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local og=tc:GetOverlayGroup()
if og:GetCount()==0 then return end
if Duel.SendtoGrave(og,REASON_EFFECT)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.SendtoGrave(og,REASON_EFFECT)~=0 and Duel.GetLocationCountFromEx(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c63992027.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
if g:GetCount()>0 then
......
......@@ -14,6 +14,7 @@ function c64161630.cfilter(c,e,tp)
local rk=c:GetRank()
return rk>1 and c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c64161630.filter,tp,LOCATION_EXTRA,0,1,nil,rk-1,c:GetRace(),e,tp)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c64161630.filter(c,rk,rc,e,tp)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x48)
......@@ -35,7 +36,7 @@ function c64161630.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
return true
end
end
function c64161630.activate(e,tp,eg,ep,ev,re,r,rp)
......@@ -51,7 +52,7 @@ function c64161630.activate(e,tp,eg,ep,ev,re,r,rp)
end
function c64161630.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,64161630)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.GetLocationCountFromEx(tp)<=0 then return end
local rk=e:GetLabel()
local rc=e:GetLabelObject():GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -53,13 +53,13 @@ function c64414267.spfilter(c,e,tp,mc)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c64414267.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c64414267.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c64414267.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>=0 then
if Duel.GetLocationCountFromEx(tp,tp,c)>0 then
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c64414267.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
......
......@@ -48,52 +48,32 @@ end
function c65172015.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c65172015.spfilter(c,code)
return c:GetOriginalCode()==code and c:IsAbleToRemoveAsCost()
function c65172015.matfilter(c)
return (c:GetOriginalCode()==1561110 or c:GetOriginalCode()==91998119) and c:IsAbleToRemoveAsCost()
end
function c65172015.cfilter1(c,tp,g)
return g:IsExists(c65172015.cfilter2,1,c,tp,c)
end
function c65172015.cfilter2(c,tp,mc)
return (c:GetOriginalCode()==1561110 and mc:GetOriginalCode()==91998119
or c:GetOriginalCode()==91998119 and mc:GetOriginalCode()==1561110)
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c65172015.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(c65172015.spfilter,tp,LOCATION_ONFIELD,0,nil,1561110)
local g2=Duel.GetMatchingGroup(c65172015.spfilter,tp,LOCATION_ONFIELD,0,nil,91998119)
if g1:GetCount()==0 or g2:GetCount()==0 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(c65172015.matfilter,tp,LOCATION_ONFIELD,0,nil)
return g:IsExists(c65172015.cfilter1,1,nil,tp,g)
end
function c65172015.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g1=Duel.GetMatchingGroup(c65172015.spfilter,tp,LOCATION_ONFIELD,0,nil,1561110)
local g2=Duel.GetMatchingGroup(c65172015.spfilter,tp,LOCATION_ONFIELD,0,nil,91998119)
local g=Duel.GetMatchingGroup(c65172015.matfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=g:FilterSelect(tp,c65172015.cfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=g:FilterSelect(tp,c65172015.cfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
local g=Group.CreateGroup()
local tc=nil
for i=1,2 do
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:GetOriginalCode()==1561110 then
local sg=Duel.GetMatchingGroup(c65172015.spfilter,tp,LOCATION_ONFIELD,0,tc,91998119)
g1:Merge(sg)
end
if tc:GetOriginalCode()==91998119 then
local sg=Duel.GetMatchingGroup(c65172015.spfilter,tp,LOCATION_ONFIELD,0,tc,1561110)
g1:Merge(sg)
end
end
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c65172015.discon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler()~=e:GetHandler() and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
......
......@@ -20,14 +20,19 @@ function c65193366.spfilter(c,e,tp)
return c:IsSetCard(0xb5) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c65193366.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c65193366.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if chk==0 then return loc~=0 and Duel.IsExistingMatchingCard(c65193366.spfilter,tp,loc,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc)
end
function c65193366.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_DECK end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c65193366.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c65193366.spfilter,tp,loc,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
......
......@@ -19,12 +19,12 @@ function c69015963.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,5000)
end
function c69015963.target(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(c69015963.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c69015963.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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c69015963.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -20,6 +20,7 @@ end
function c70026064.filter1(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x88)
and Duel.IsExistingMatchingCard(c70026064.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetCode())
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c70026064.filter2(c,e,tp,mc,code)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x88) and not c:IsCode(code) and mc:IsCanBeXyzMaterial(c)
......@@ -27,15 +28,14 @@ function c70026064.filter2(c,e,tp,mc,code)
end
function c70026064.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c70026064.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c70026064.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c70026064.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c70026064.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c70026064.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c70026064.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetCode())
......
......@@ -14,6 +14,7 @@ function c71345905.filter1(c,e,tp)
local rk=c:GetRank()
return rk>1 and c:IsFaceup() and c:IsSetCard(0x107f)
and Duel.IsExistingMatchingCard(c71345905.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,rk)
and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c71345905.filter2(c,e,tp,mc,rk)
return c:IsRankBelow(rk-1) and c:IsSetCard(0x107f) and mc:IsCanBeXyzMaterial(c)
......@@ -21,15 +22,14 @@ function c71345905.filter2(c,e,tp,mc,rk)
end
function c71345905.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c71345905.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c71345905.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c71345905.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c71345905.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c71345905.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c71345905.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank())
......
......@@ -23,8 +23,8 @@ end
function c72291412.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetMatchingGroup(c72291412.filter0,tp,LOCATION_GRAVE,0,c)
local res=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local mg1=Duel.GetMatchingGroup(c72291412.filter0,tp,LOCATION_GRAVE,0,nil)
local res=Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c72291412.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -42,7 +42,7 @@ end
function c72291412.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetMatchingGroup(c72291412.filter1,tp,LOCATION_GRAVE,0,c,e)
local mg1=Duel.GetMatchingGroup(c72291412.filter1,tp,LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(c72291412.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
......@@ -53,7 +53,7 @@ function c72291412.operation(e,tp,eg,ep,ev,re,r,rp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c72291412.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c)
end
if (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg1:GetCount()>0) or (sg2~=nil and sg2:GetCount()>0) then
if (Duel.GetLocationCountFromEx(tp)>0 and sg1:GetCount()>0) or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -47,7 +47,7 @@ end
function c7241272.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,c)
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local res=Duel.IsExistingMatchingCard(c7241272.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -65,7 +65,7 @@ end
function c7241272.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c7241272.spfilter1,c,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c7241272.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c7241272.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
......
......@@ -29,7 +29,7 @@ function c72714392.exfilter(c,lv,e,tp)
end
function c72714392.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c72714392.filter(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(c72714392.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c72714392.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
......@@ -41,7 +41,7 @@ function c72714392.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or not c:IsRelateToEffect(e) then return end
local rg=Group.FromCards(c,tc)
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 and Duel.GetLocationCountFromEx(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c72714392.exfilter,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetLevel()+1,e,tp)
local sc=sg:GetFirst()
......
......@@ -80,7 +80,7 @@ end
function c73511233.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter0,c)
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter0,nil)
local res=Duel.IsExistingMatchingCard(c73511233.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
local ce=Duel.GetChainMaterial(tp)
......@@ -98,7 +98,7 @@ end
function c73511233.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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,c,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c73511233.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c73511233.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg2=nil
local sg2=nil
......
......@@ -17,7 +17,7 @@ function c74100225.spfilter(c,e,tp)
return c:IsSetCard(0x504e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74100225.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(c74100225.filter,tp,LOCATION_GRAVE,0,1,nil,0x304e)
and Duel.IsExistingTarget(c74100225.filter,tp,LOCATION_GRAVE,0,1,nil,0x604e)
and Duel.IsExistingMatchingCard(c74100225.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
......@@ -30,7 +30,7 @@ function c74100225.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c74100225.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 g=Duel.GetMatchingGroup(c74100225.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if g:GetCount()==0 then return end
local mg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
......
......@@ -86,12 +86,12 @@ function c74892653.filter(c,e,tp)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c74892653.sctg(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(c74892653.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c74892653.scop(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)
local g=Duel.SelectMatchingCard(tp,c74892653.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
......
......@@ -14,22 +14,32 @@ end
function c75457624.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xb5) and c:IsAbleToRemoveAsCost()
end
function c75457624.cfilter1(c,cg,tp)
return cg:IsExists(c75457624.cfilter2,1,c,c,tp)
end
function c75457624.cfilter2(c,mc,tp)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c75457624.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75457624.cfilter,tp,LOCATION_MZONE,0,2,nil) end
local cg=Duel.GetMatchingGroup(c75457624.cfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return cg:IsExists(c75457624.cfilter1,1,nil,cg,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=cg:FilterSelect(tp,c75457624.cfilter1,1,1,nil,cg,tp)
local tc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c75457624.cfilter,tp,LOCATION_MZONE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
local g2=cg:FilterSelect(tp,c75457624.cfilter2,1,1,tc,tc,tp)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c75457624.filter(c,e,tp)
return c:IsSetCard(0xb5) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c75457624.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c75457624.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(c75457624.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c75457624.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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c75457624.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -38,7 +38,7 @@ function c75923050.spfilter(c,e,tp)
return c:IsCode(1412158) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75923050.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,e:GetHandler())>0
and e:GetHandler():IsAbleToExtra()
and Duel.IsExistingMatchingCard(c75923050.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
......@@ -46,7 +46,7 @@ function c75923050.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c75923050.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
if Duel.GetLocationCountFromEx(tp,tp,c)<=0 then return end
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 then
local tc=Duel.GetFirstMatchingCard(c75923050.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if tc then
......
......@@ -33,35 +33,30 @@ end
function c76647978.filter1(c,e,tp,mc)
local mg=Group.FromCards(c,mc)
return Duel.IsExistingMatchingCard(c76647978.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
and Duel.GetLocationCountFromEx(tp,tp,mg)>0
end
function c76647978.filter2(c,e,tp,mg)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(mg,nil)
end
function c76647978.target(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and mg:IsExists(c76647978.filter0,1,nil,e,tp,mg) end
if chk==0 then return mg:IsExists(c76647978.filter0,1,nil,e,tp,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function c76647978.filter3(c,e,tp,mg)
return not c:IsImmuneToEffect(e) and mg:IsExists(c76647978.filter4,1,c,e,tp,c)
end
function c76647978.filter4(c,e,tp,mc)
local mg=Group.FromCards(c,mc)
return not c:IsImmuneToEffect(e) and Duel.IsExistingMatchingCard(c76647978.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
function c76647978.filter3(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
function c76647978.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<-1 then return end
local mg=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local mg=Duel.GetFusionMaterial(tp):Filter(c76647978.filter3,nil,e)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g1=mg:FilterSelect(tp,c76647978.filter3,1,1,nil,e,tp,mg)
local g1=mg:FilterSelect(tp,c76647978.filter0,1,1,nil,e,tp,mg)
if g1:GetCount()==0 then return end
local tc1=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local g2=mg:FilterSelect(tp,c76647978.filter4,1,1,tc1,e,tp,tc1)
local g2=mg:FilterSelect(tp,c76647978.filter1,1,1,tc1,e,tp,tc1)
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c76647978.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,g1)
......
......@@ -121,66 +121,51 @@ end
function c76794549.cfilter(c)
return (c:IsSetCard(0x10f2) or c:IsSetCard(0x2073) or c:IsSetCard(0x2017) or c:IsSetCard(0x1046))
and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup())
end
function c76794549.fcheck(c,sg,g,code,...)
if not c:IsSetCard(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c76794549.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c76794549.fselect(c,tp,mg,sg,mc,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<5 then
res=mg:IsExists(c76794549.fselect,1,sg,tp,mg,sg,mc,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.FromCards(mc)
res=sg:IsExists(c76794549.fcheck,1,g,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c76794549.cfilter1(c,g,ft)
local mg=g:Clone()
mg:RemoveCard(c)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return c:IsSetCard(0x10f2) and mg:IsExists(c76794549.cfilter2,1,nil,mg,ft)
end
function c76794549.cfilter2(c,g,ft)
local mg=g:Clone()
mg:RemoveCard(c)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return c:IsSetCard(0x2073) and mg:IsExists(c76794549.cfilter3,1,nil,mg,ft)
end
function c76794549.cfilter3(c,g,ft)
local mg=g:Clone()
mg:RemoveCard(c)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return c:IsSetCard(0x2017) and mg:IsExists(c76794549.cfilter4,1,nil,ft)
end
function c76794549.cfilter4(c,ft)
if c:IsLocation(LOCATION_MZONE) then ft=ft+1 end
return c:IsSetCard(0x1046) and ft>0
function c76794549.hnfilter(c,e,tp)
return c:IsCode(13331639) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
end
function c76794549.hncost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(c76794549.cfilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local sg=Group.FromCards(c)
if chk==0 then return c:IsAbleToRemoveAsCost()
and mg:IsExists(c76794549.cfilter1,1,nil,mg,ft+1) end
local g=Group.FromCards(c)
ft=ft+1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc1=mg:FilterSelect(tp,c76794549.cfilter1,1,1,nil,mg,ft):GetFirst()
g:AddCard(rc1)
mg:RemoveCard(rc1)
if rc1:IsLocation(LOCATION_MZONE) then ft=ft+1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc2=mg:FilterSelect(tp,c76794549.cfilter2,1,1,nil,mg,ft):GetFirst()
g:AddCard(rc2)
mg:RemoveCard(rc2)
if rc2:IsLocation(LOCATION_MZONE) then ft=ft+1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc3=mg:FilterSelect(tp,c76794549.cfilter3,1,1,nil,mg,ft):GetFirst()
g:AddCard(rc3)
mg:RemoveCard(rc3)
if rc3:IsLocation(LOCATION_MZONE) then ft=ft+1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rc4=mg:FilterSelect(tp,c76794549.cfilter4,1,1,nil,ft):GetFirst()
g:AddCard(rc4)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c76794549.hnfilter(c,e,tp)
return c:IsCode(13331639) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
and mg:IsExists(c76794549.fselect,1,sg,tp,mg,sg,c,0x10f2,0x2073,0x2017,0x1046) end
while sg:GetCount()<5 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=mg:FilterSelect(tp,c76794549.fselect,1,1,sg,tp,mg,sg,c,0x10f2,0x2073,0x2017,0x1046)
sg:Merge(g)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c76794549.hntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c76794549.hnfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c76794549.hnop(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)
local g=Duel.SelectMatchingCard(tp,c76794549.hnfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -14,14 +14,19 @@ function c77826734.filter(c,e,tp)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c77826734.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c77826734.filter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_GRAVE end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if chk==0 then return loc~=0 and Duel.IsExistingMatchingCard(c77826734.filter,tp,loc,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc)
end
function c77826734.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_GRAVE end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c77826734.filter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c77826734.filter),tp,loc,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -65,13 +65,13 @@ function c79985120.spfilter(c,e,tp)
return c:IsCode(81927732) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c79985120.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(c79985120.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c79985120.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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)
local g=Duel.SelectMatchingCard(tp,c79985120.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) then
......
......@@ -45,8 +45,7 @@ function c89181134.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg1=Duel.GetFusionMaterial(tp)
mg1:RemoveCard(c)
local mg2=Duel.GetMatchingGroup(c89181134.filter0,tp,0,LOCATION_MZONE,c)
local mg2=Duel.GetMatchingGroup(c89181134.filter0,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c89181134.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c)
if not res then
......@@ -65,8 +64,8 @@ end
function c89181134.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or (c:IsControler(1-tp) and c:GetCounter(0x1041)<=0) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c89181134.filter1,c,e)
local mg2=Duel.GetMatchingGroup(c89181134.filter3,tp,0,LOCATION_MZONE,c,e)
local mg1=Duel.GetFusionMaterial(tp):Filter(c89181134.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c89181134.filter3,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c89181134.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c)
local mg3=nil
......
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