Commit 1afd1fca authored by mercury233's avatar mercury233

delete

parent 4e6a4ce0
......@@ -552,108 +552,6 @@ function Auxiliary.XyzOperation(f,lv,minct,maxct,alterf,alterdesc,alterop)
end
end
end
--Xyz summon(alterf)
function Auxiliary.XyzConditionAlter(f,lv,minct,maxct,alterf,alterdesc,alterop)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
if (not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,alterop) then
return true
end
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
end
end
function Auxiliary.XyzTargetAlter(f,lv,minct,maxct,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minct
local maxc=maxct
if min then
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 altg=mg:Filter(Auxiliary.XyzAlterFilter,nil,alterf,c,e,tp,alterop)
local b1=Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
local b2=(not min or min<=1) and #altg>0
local g=nil
local cancel=Duel.IsSummonCancelable()
if b2 and (not b1 or Duel.SelectYesNo(tp,alterdesc)) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=altg:SelectUnselect(nil,tp,false,cancel,1,1)
if tc then
g=Group.FromCards(tc)
if alterop then alterop(e,tp,1,tc) end
end
else
e:SetLabel(0)
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.XyzOperationAlter(f,lv,minct,maxct,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
---Xyz monster, any condition
---@param c Card
---@param f function|nil
......@@ -817,123 +715,6 @@ function Auxiliary.XyzLevelFreeOperation(f,gf,minct,maxct,alterf,alterdesc,alter
end
end
end
--Xyz summon(level free&alterf)
function Auxiliary.XyzLevelFreeConditionAlter(f,gf,minct,maxct,alterf,alterdesc,alterop)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=nil
if og then
mg=og
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
local altg=mg:Filter(Auxiliary.XyzAlterFilter,nil,alterf,c,e,tp,alterop)
if (not min or min<=1) and altg:GetCount()>0 then
return true
end
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
mg=mg:Filter(Auxiliary.XyzLevelFreeFilter,nil,c,f)
local sg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_XMATERIAL)
if sg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(sg)
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
local res=mg:CheckSubGroup(Auxiliary.XyzLevelFreeGoal,minc,maxc,tp,c,gf)
Auxiliary.GCheckAdditional=nil
return res
end
end
function Auxiliary.XyzLevelFreeTargetAlter(f,gf,minct,maxct,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then
return true
end
local minc=minct
local maxc=maxct
if min then
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 sg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_XMATERIAL)
local altg=mg:Filter(Auxiliary.XyzAlterFilter,nil,alterf,c,e,tp,alterop)
local mg2=mg:Filter(Auxiliary.XyzLevelFreeFilter,nil,c,f)
Duel.SetSelectedCard(sg)
local b1=mg2:CheckSubGroup(Auxiliary.XyzLevelFreeGoal,minc,maxc,tp,c,gf)
local b2=(not min or min<=1) and #altg>0
local g=nil
local cancel=Duel.IsSummonCancelable()
if b2 and (not b1 or Duel.SelectYesNo(tp,alterdesc)) then
e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=altg:SelectUnselect(nil,tp,false,cancel,1,1)
if tc then
g=Group.FromCards(tc)
if alterop then alterop(e,tp,1,tc) end
end
else
e:SetLabel(0)
Duel.SetSelectedCard(sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
Auxiliary.GCheckAdditional=Auxiliary.TuneMagicianCheckAdditionalX(EFFECT_TUNE_MAGICIAN_X)
g=mg2:SelectSubGroup(tp,Auxiliary.XyzLevelFreeGoal,cancel,minc,maxc,tp,c,gf)
Auxiliary.GCheckAdditional=nil
end
if g and g:GetCount()>0 then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function Auxiliary.XyzLevelFreeOperationAlter(f,gf,minct,maxct,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
--Fusion Summon
......
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