Commit afb02a9e authored by VanillaSalt's avatar VanillaSalt

Merge pull request #198 from DailyShana/patch-7

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