Commit 7b91fc25 authored by VanillaSalt's avatar VanillaSalt

fix

parent b84b75a7
......@@ -24,25 +24,24 @@ function c23536866.xyzfilter(c,mg)
if c.xyz_count~=2 then return false end
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsXyzSummonable(mg)
end
function c23536866.mfilter1(c,exg)
return exg:IsExists(c23536866.mfilter2,1,nil,c)
function c23536866.mfilter1(c,mg,exg)
return mg:IsExists(c23536866.mfilter2,1,c,c,exg)
end
function c23536866.mfilter2(c,mc)
return c.xyz_filter(mc)
function c23536866.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
end
function c23536866.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c23536866.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and mg:GetCount()>1
and Duel.IsExistingMatchingCard(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end
local exg=Duel.GetMatchingGroup(c23536866.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and mg:IsExists(c23536866.mfilter1,1,nil,mg,exg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:FilterSelect(tp,c23536866.mfilter1,1,1,nil,exg)
local sg1=mg:FilterSelect(tp,c23536866.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
local exg2=exg:Filter(c23536866.mfilter2,nil,tc1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=mg:FilterSelect(tp,c23536866.mfilter1,1,1,tc1,exg2)
local sg2=mg:FilterSelect(tp,c23536866.mfilter2,1,1,tc1,tc1,exg)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,2,0,0)
......
......@@ -17,46 +17,38 @@ end
function c29087919.xyzfilter(c,mg,ct)
return c:IsXyzSummonable(mg) and c.xyz_count<=ct
end
function c29087919.mfilter1(c,exg)
return exg:IsExists(c29087919.mfilter2,1,nil,c)
function c29087919.mfilter1(c,mg,exg,ct)
return mg:IsExists(c29087919.mfilter2,1,nil,Group.FromCards(c),mg,exg,ct)
end
function c29087919.mfilter2(c,mc)
return c.xyz_filter(mc)
end
function c29087919.xyzct(c)
return c.xyz_count
function c29087919.mfilter2(c,g,mg,exg,ct)
local tc=g:GetFirst()
while tc do
if c:IsCode(tc:GetCode()) then return false end
tc=g:GetNext()
end
g:AddCard(c)
local result=exg:IsExists(Card.IsXyzSummonable,1,nil,g)
or (g:GetCount()<ct and mg:IsExists(c29087919.mfilter2,1,nil,g,mg,exg,ct))
g:RemoveCard(c)
return result
end
function c29087919.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c29087919.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
local mct=mg:GetClassCount(Card.GetCode)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct>mct then ct=mct end
local exg=Duel.GetMatchingGroup(c29087919.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg,ct)
local maxg,maxc=exg:GetMaxGroup(c29087919.xyzct)
if maxc and ct>maxc then ct=maxc end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and ct>1 and Duel.IsExistingMatchingCard(c29087919.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg,ct) end
and ct>1 and mg:IsExists(c29087919.mfilter1,1,nil,mg,exg,ct) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:FilterSelect(tp,c29087919.mfilter1,1,1,nil,exg)
local tc1=sg1:GetFirst()
local exg2=exg:Filter(c29087919.mfilter2,nil,tc1)
mg:Remove(Card.IsCode,nil,tc1:GetCode())
local sg1=mg:FilterSelect(tp,c29087919.mfilter1,1,1,nil,mg,exg,ct)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=mg:FilterSelect(tp,c29087919.mfilter1,1,1,nil,exg2)
local sg2=mg:FilterSelect(tp,c29087919.mfilter2,1,1,nil,sg1,mg,exg,ct)
sg1:Merge(sg2)
mg:Remove(Card.IsCode,nil,sg2:GetFirst():GetCode())
ct=ct-2
local minc=2
local exg3=Duel.GetMatchingGroup(c29087919.spfilter,tp,LOCATION_EXTRA,0,nil,sg1,minc)
while mg:GetCount()>0 and ct>0 and (exg3:GetCount()==0 or Duel.SelectYesNo(tp,aux.Stringid(29087919,0))) do
while sg1:GetCount()<ct and mg:IsExists(c29087919.mfilter2,1,nil,sg1,mg,exg,ct)
and (not exg:IsExists(Card.IsXyzSummonable,1,nil,sg1) or Duel.SelectYesNo(tp,aux.Stringid(29087919,0))) do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg3=mg:FilterSelect(tp,c29087919.mfilter1,1,1,nil,exg2)
local sg3=mg:FilterSelect(tp,c29087919.mfilter2,1,1,nil,sg1,mg,exg,ct)
sg1:Merge(sg3)
mg:Remove(Card.IsCode,nil,sg3:GetFirst():GetCode())
ct=ct-1
minc=minc+1
exg3=Duel.GetMatchingGroup(c29087919.spfilter,tp,LOCATION_EXTRA,0,nil,sg1,minc)
end
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,sg1:GetCount(),0,0)
......
......@@ -28,26 +28,23 @@ function c56611470.xyzfilter(c,mg)
if c.xyz_count~=2 then return false end
return c:IsXyzSummonable(mg)
end
function c56611470.mfilter1(c,exg)
return exg:IsExists(c56611470.mfilter2,1,nil,c)
function c56611470.mfilter1(c,mg,exg)
return mg:IsExists(c56611470.mfilter2,1,c,c,exg)
end
function c56611470.mfilter2(c,mc)
return c.xyz_filter(mc)
end
function c56611470.mfilter3(c,mc,exg)
function c56611470.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
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)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2 and mg:GetCount()>1
and Duel.IsExistingMatchingCard(c56611470.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end
local exg=Duel.GetMatchingGroup(c56611470.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
and mg:IsExists(c56611470.mfilter1,1,nil,mg,exg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg1=mg:FilterSelect(tp,c56611470.mfilter1,1,1,nil,exg)
local sg1=mg:FilterSelect(tp,c56611470.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg2=mg:FilterSelect(tp,c56611470.mfilter3,1,1,tc1,tc1,exg)
local sg2=mg:FilterSelect(tp,c56611470.mfilter2,1,1,tc1,tc1,exg)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
......@@ -92,7 +89,7 @@ function c56611470.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c56611470.drop(e,tp,eg,ep,ev,re,r,rp,chk)
function c56611470.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
......@@ -17,25 +17,24 @@ function c61314842.xyzfilter(c,mg)
if c.xyz_count~=2 then return false end
return c:IsXyzSummonable(mg)
end
function c61314842.mfilter1(c,exg)
return exg:IsExists(c61314842.mfilter2,1,nil,c)
function c61314842.mfilter1(c,mg,exg)
return mg:IsExists(c61314842.mfilter2,1,c,c,exg)
end
function c61314842.mfilter2(c,mc)
return c.xyz_filter(mc)
function c61314842.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
end
function c61314842.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c61314842.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and mg:GetCount()>1
and Duel.IsExistingMatchingCard(c61314842.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end
local exg=Duel.GetMatchingGroup(c61314842.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
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,exg)
local sg1=mg:FilterSelect(tp,c61314842.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
local exg2=exg:Filter(c61314842.mfilter2,nil,tc1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=mg:FilterSelect(tp,c61314842.mfilter1,1,1,tc1,exg2)
local sg2=mg:FilterSelect(tp,c61314842.mfilter2,1,1,tc1,tc1,exg)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,2,0,0)
......
......@@ -24,50 +24,43 @@ function c62829077.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterEffect(e1,tp)
end
function c62829077.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se~=e:GetLabelObject() and Duel.GetFlagEffect(sump,62829077)==0
return se~=e:GetLabelObject()
end
function c62829077.filter(c,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c62829077.xyzfilter(c,mg)
if c.xyz_count~=3 then return false end
return c:IsSetCard(0x7f) and c:IsXyzSummonable(mg)
end
function c62829077.mfilter1(c,exg)
return exg:IsExists(c62829077.mfilter2,1,nil,c)
function c62829077.mfilter1(c,mg,exg)
return mg:IsExists(c62829077.mfilter2,1,c,c,mg,exg)
end
function c62829077.mfilter2(c,mc)
return c.xyz_filter(mc)
function c62829077.mfilter2(c,mc,mg,exg)
return mg:IsExists(c62829077.mfilter3,1,c,c,mc,exg)
end
function c62829077.mfilter3(c,mc,mg,exg)
return mg:IsExists(c62829077.mfilter4,1,c,c,mc,exg)
end
function c62829077.mfilter4(c,mc1,mc2,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc1,mc2))
function c62829077.mfilter3(c,mc1,mc2,exg)
return c~=mc2 and exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc1,mc2))
end
function c62829077.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c62829077.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 and mg:GetCount()>2
and Duel.IsExistingMatchingCard(c62829077.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,mg) end
Duel.RegisterFlagEffect(tp,62829077,0,0,1)
local exg=Duel.GetMatchingGroup(c62829077.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if exg:GetCount()==0 then return end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>2
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,exg)
local sg1=mg:FilterSelect(tp,c62829077.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
mg:RemoveCard(tc1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=mg:FilterSelect(tp,c62829077.mfilter3,1,1,nil,tc1,mg,exg)
local sg2=mg:FilterSelect(tp,c62829077.mfilter2,1,1,tc1,tc1,mg,exg)
local tc2=sg2:GetFirst()
mg:RemoveCard(tc2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg3=mg:FilterSelect(tp,c62829077.mfilter4,1,1,nil,tc1,tc2,exg)
local sg3=mg:FilterSelect(tp,c62829077.mfilter3,1,1,tc2,tc2,tc1,exg)
sg1:Merge(sg2)
sg1:Merge(sg3)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,3,0,0)
Duel.ResetFlagEffect(tp,62829077)
end
function c62829077.filter2(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -91,12 +84,10 @@ function c62829077.activate(e,tp,eg,ep,ev,re,r,rp)
end
Duel.SpecialSummonComplete()
Duel.BreakEffect()
Duel.RegisterFlagEffect(tp,62829077,0,0,1)
local xyzg=Duel.GetMatchingGroup(c62829077.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,g)
end
Duel.ResetFlagEffect(tp,62829077)
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