Commit 58c645e0 authored by DailyShana's avatar DailyShana

fix

parent eb65614c
......@@ -40,7 +40,7 @@ function c24658418.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c24658418.mfilter(c)
return c:IsFaceup() and c:IsSetCard(0x7b) and not c:IsType(TYPE_TOKEN+TYPE_XYZ)
return c:IsFaceup() and c:IsSetCard(0x7b) and not c:IsType(TYPE_TOKEN)
end
function c24658418.xyzfilter(c,mg)
return c:IsSetCard(0x7b) and c:IsXyzSummonable(mg)
......
......@@ -78,7 +78,13 @@ function c52653092.xyzcon(e,c,og,min,max)
local ct=-ft
if 3<=ct then return false end
if min and (min>3 or max<3) then return false end
if ct<1 and not og and Duel.IsExistingMatchingCard(aux.XyzAlterFilter,tp,LOCATION_MZONE,0,1,nil,c52653092.ovfilter,c)
local altmg=nil
if og then
altmg=og
else
altmg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if ct<1 and (not min or min<=1) and altmg:IsExists(aux.XyzAlterFilter,1,nil,c52653092.ovfilter,c)
and Duel.IsExistingMatchingCard(c52653092.cfilter,tp,LOCATION_HAND,0,1,nil) then
return true
end
......@@ -106,18 +112,21 @@ function c52653092.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
local mg=nil
local altmg=nil
if og then
mg=og:Filter(c52653092.mfilter,nil,c)
altmg=og
else
mg=Duel.GetMatchingGroup(c52653092.mfilter,tp,LOCATION_MZONE,0,nil,c)
altmg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
local b1=mg:IsExists(c52653092.xyzfilter1,1,nil,mg)
local b2=ct<1 and not og and Duel.IsExistingMatchingCard(aux.XyzAlterFilter,tp,LOCATION_MZONE,0,1,nil,c52653092.ovfilter,c)
local b2=ct<1 and (not min or min<=1) and altmg:IsExists(aux.XyzAlterFilter,1,nil,c52653092.ovfilter,c)
and Duel.IsExistingMatchingCard(c52653092.cfilter,tp,LOCATION_HAND,0,1,nil)
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(52653092,0))) then
Duel.DiscardHand(tp,c52653092.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.XyzAlterFilter,tp,LOCATION_MZONE,0,1,1,nil,c52653092.ovfilter,c)
local g=altmg:FilterSelect(tp,aux.XyzAlterFilter,1,1,nil,c52653092.ovfilter,c)
local g2=g:GetFirst():GetOverlayGroup()
if g2:GetCount()~=0 then
Duel.Overlay(c,g2)
......
......@@ -47,7 +47,13 @@ function c57707471.xyzcon(e,c,og,min,max)
local ct=-ft
if 2<=ct then return false end
if min and (min>2 or max<2) then return false end
if ct<1 and not og and Duel.IsExistingMatchingCard(c57707471.ovfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) then
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if ct<1 and (not min or min<=1) and mg:IsExists(c57707471.ovfilter,1,nil,tp,c) then
return true
end
return Duel.CheckXyzMaterial(c,nil,6,2,2,og)
......@@ -58,42 +64,45 @@ function c57707471.xyztg(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
local b1=Duel.CheckXyzMaterial(c,nil,6,2,2,og)
local b2=ct<1 and not og and Duel.IsExistingMatchingCard(c57707471.ovfilter,tp,LOCATION_MZONE,0,1,nil)
local b2=ct<1 and (not min or min<=1) and mg:IsExists(c57707471.ovfilter,1,nil)
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,aux.Stringid(57707471,0))) then
e:SetLabel(1)
return true
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,c57707471.ovfilter,1,1,nil,tp,c)
g:GetFirst():RemoveOverlayCard(tp,1,1,REASON_COST)
else
e:SetLabel(0)
local g=Duel.SelectXyzMaterial(tp,c,nil,6,2,2,og)
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
g=Duel.SelectXyzMaterial(tp,c,nil,6,2,2,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
function c57707471.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.SelectMatchingCard(tp,c57707471.ovfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
mg:GetFirst():RemoveOverlayCard(tp,1,1,REASON_COST)
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
else
local mg=e:GetLabelObject()
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
function c57707471.atkval(e,c)
......
......@@ -287,7 +287,13 @@ function Auxiliary.XyzCondition2(f,lv,minc,maxc,alterf,desc,op)
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft
if ct<1 and not og and Duel.IsExistingMatchingCard(Auxiliary.XyzAlterFilter,tp,LOCATION_MZONE,0,1,nil,alterf,c)
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if ct<1 and (not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c)
and (not op or op(e,tp,0)) then
return true
end
......@@ -314,21 +320,30 @@ function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op)
if min>minc then minc=min end
if max<maxc then maxc=max end
end
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
local b1=ct<minc and Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
local b2=ct<1 and not og and Duel.IsExistingMatchingCard(Auxiliary.XyzAlterFilter,tp,LOCATION_MZONE,0,1,nil,alterf,c)
local b2=ct<1 and (not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c)
and (not op or op(e,tp,0))
local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,desc)) then
e:SetLabel(1)
return true
if op then op(e,tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c)
else
e:SetLabel(0)
local g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,og)
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,og)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function Auxiliary.XyzOperation2(f,lv,minc,maxc,alterf,desc,op)
......@@ -345,18 +360,13 @@ function Auxiliary.XyzOperation2(f,lv,minc,maxc,alterf,desc,op)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
if op then op(e,tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.SelectMatchingCard(tp,Auxiliary.XyzAlterFilter,tp,LOCATION_MZONE,0,1,1,nil,alterf,c)
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
else
local mg=e:GetLabelObject()
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
......@@ -365,10 +375,10 @@ function Auxiliary.XyzOperation2(f,lv,minc,maxc,alterf,desc,op)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
......@@ -1057,7 +1067,7 @@ function Auxiliary.FConditionFunFunRep(f1,f2,minc,maxc,insf)
end
end
function Auxiliary.FOperationFunFunRep(f1,f2,minc,maxc,insf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
local g=eg:Filter(Card.IsCanBeFusionMaterial,nil,e:GetHandler())
local minct=minc
local maxct=maxc
......
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