Commit ac17edef authored by mercury233's avatar mercury233 Committed by GitHub

rename Auxiliary.XyzAlter related (#1937)

parent ed6bed24
...@@ -680,11 +680,11 @@ function Auxiliary.TuneMagicianCheckAdditionalX(ecode) ...@@ -680,11 +680,11 @@ function Auxiliary.TuneMagicianCheckAdditionalX(ecode)
return not g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,ecode) return not g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,ecode)
end end
end end
function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,op) function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,alterop)
return alterf(c) and c:IsCanBeXyzMaterial(xyzc) and Duel.GetLocationCountFromEx(tp,tp,c,xyzc)>0 and Auxiliary.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and (not op or op(e,tp,0,c)) return alterf(c) and c:IsCanBeXyzMaterial(xyzc) and Duel.GetLocationCountFromEx(tp,tp,c,xyzc)>0 and Auxiliary.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and (not alterop or alterop(e,tp,0,c))
end end
--Xyz monster, lv k*n --Xyz monster, lv k*n
function Auxiliary.AddXyzProcedure(c,f,lv,ct,alterf,desc,maxct,op) function Auxiliary.AddXyzProcedure(c,f,lv,ct,alterf,alterdesc,maxct,alterop)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1165) e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -693,9 +693,9 @@ function Auxiliary.AddXyzProcedure(c,f,lv,ct,alterf,desc,maxct,op) ...@@ -693,9 +693,9 @@ function Auxiliary.AddXyzProcedure(c,f,lv,ct,alterf,desc,maxct,op)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
if not maxct then maxct=ct end if not maxct then maxct=ct end
if alterf then if alterf then
e1:SetCondition(Auxiliary.XyzCondition2(f,lv,ct,maxct,alterf,desc,op)) e1:SetCondition(Auxiliary.XyzConditionAlter(f,lv,ct,maxct,alterf,alterdesc,alterop))
e1:SetTarget(Auxiliary.XyzTarget2(f,lv,ct,maxct,alterf,desc,op)) e1:SetTarget(Auxiliary.XyzTargetAlter(f,lv,ct,maxct,alterf,alterdesc,alterop))
e1:SetOperation(Auxiliary.XyzOperation2(f,lv,ct,maxct,alterf,desc,op)) e1:SetOperation(Auxiliary.XyzOperationAlter(f,lv,ct,maxct,alterf,alterdesc,alterop))
else else
e1:SetCondition(Auxiliary.XyzCondition(f,lv,ct,maxct)) e1:SetCondition(Auxiliary.XyzCondition(f,lv,ct,maxct))
e1:SetTarget(Auxiliary.XyzTarget(f,lv,ct,maxct)) e1:SetTarget(Auxiliary.XyzTarget(f,lv,ct,maxct))
...@@ -770,7 +770,7 @@ function Auxiliary.XyzOperation(f,lv,minc,maxc) ...@@ -770,7 +770,7 @@ function Auxiliary.XyzOperation(f,lv,minc,maxc)
end end
end end
--Xyz summon(alterf) --Xyz summon(alterf)
function Auxiliary.XyzCondition2(f,lv,minc,maxc,alterf,desc,op) function Auxiliary.XyzConditionAlter(f,lv,minc,maxc,alterf,alterdesc,alterop)
return function(e,c,og,min,max) return function(e,c,og,min,max)
if c==nil then return true end if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
...@@ -781,7 +781,7 @@ function Auxiliary.XyzCondition2(f,lv,minc,maxc,alterf,desc,op) ...@@ -781,7 +781,7 @@ function Auxiliary.XyzCondition2(f,lv,minc,maxc,alterf,desc,op)
else else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end end
if (not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,op) then if (not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,alterop) then
return true return true
end end
local minc=minc local minc=minc
...@@ -794,7 +794,7 @@ function Auxiliary.XyzCondition2(f,lv,minc,maxc,alterf,desc,op) ...@@ -794,7 +794,7 @@ function Auxiliary.XyzCondition2(f,lv,minc,maxc,alterf,desc,op)
return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og) return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
end end
end end
function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op) function Auxiliary.XyzTargetAlter(f,lv,minc,maxc,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max) return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then if og and not min then
return true return true
...@@ -812,13 +812,13 @@ function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op) ...@@ -812,13 +812,13 @@ function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op)
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end end
local b1=Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og) local b1=Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
local b2=(not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,op) local b2=(not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,alterop)
local g=nil local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,desc)) then if b2 and (not b1 or Duel.SelectYesNo(tp,alterdesc)) then
e:SetLabel(1) e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,op) g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,alterop)
if op then op(e,tp,1,g:GetFirst()) end if alterop then alterop(e,tp,1,g:GetFirst()) end
else else
e:SetLabel(0) e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,og) g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,og)
...@@ -830,7 +830,7 @@ function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op) ...@@ -830,7 +830,7 @@ function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op)
else return false end else return false end
end end
end end
function Auxiliary.XyzOperation2(f,lv,minc,maxc,alterf,desc,op) function Auxiliary.XyzOperationAlter(f,lv,minc,maxc,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then if og and not min then
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
...@@ -866,7 +866,7 @@ function Auxiliary.XyzOperation2(f,lv,minc,maxc,alterf,desc,op) ...@@ -866,7 +866,7 @@ function Auxiliary.XyzOperation2(f,lv,minc,maxc,alterf,desc,op)
end end
end end
end end
function Auxiliary.AddXyzProcedureLevelFree(c,f,gf,minc,maxc,alterf,desc,op) function Auxiliary.AddXyzProcedureLevelFree(c,f,gf,minc,maxc,alterf,alterdesc,alterop)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1165) e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -874,9 +874,9 @@ function Auxiliary.AddXyzProcedureLevelFree(c,f,gf,minc,maxc,alterf,desc,op) ...@@ -874,9 +874,9 @@ function Auxiliary.AddXyzProcedureLevelFree(c,f,gf,minc,maxc,alterf,desc,op)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA) e1:SetRange(LOCATION_EXTRA)
if alterf then if alterf then
e1:SetCondition(Auxiliary.XyzLevelFreeCondition2(f,gf,minc,maxc,alterf,desc,op)) e1:SetCondition(Auxiliary.XyzLevelFreeConditionAlter(f,gf,minc,maxc,alterf,alterdesc,alterop))
e1:SetTarget(Auxiliary.XyzLevelFreeTarget2(f,gf,minc,maxc,alterf,desc,op)) e1:SetTarget(Auxiliary.XyzLevelFreeTargetAlter(f,gf,minc,maxc,alterf,alterdesc,alterop))
e1:SetOperation(Auxiliary.XyzLevelFreeOperation2(f,gf,minc,maxc,alterf,desc,op)) e1:SetOperation(Auxiliary.XyzLevelFreeOperationAlter(f,gf,minc,maxc,alterf,alterdesc,alterop))
else else
e1:SetCondition(Auxiliary.XyzLevelFreeCondition(f,gf,minc,maxc)) e1:SetCondition(Auxiliary.XyzLevelFreeCondition(f,gf,minc,maxc))
e1:SetTarget(Auxiliary.XyzLevelFreeTarget(f,gf,minc,maxc)) e1:SetTarget(Auxiliary.XyzLevelFreeTarget(f,gf,minc,maxc))
...@@ -987,7 +987,7 @@ function Auxiliary.XyzLevelFreeOperation(f,gf,minct,maxct) ...@@ -987,7 +987,7 @@ function Auxiliary.XyzLevelFreeOperation(f,gf,minct,maxct)
end end
end end
--Xyz summon(level free&alterf) --Xyz summon(level free&alterf)
function Auxiliary.XyzLevelFreeCondition2(f,gf,minct,maxct,alterf,desc,op) function Auxiliary.XyzLevelFreeConditionAlter(f,gf,minct,maxct,alterf,alterdesc,alterop)
return function(e,c,og,min,max) return function(e,c,og,min,max)
if c==nil then return true end if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
...@@ -998,7 +998,7 @@ function Auxiliary.XyzLevelFreeCondition2(f,gf,minct,maxct,alterf,desc,op) ...@@ -998,7 +998,7 @@ function Auxiliary.XyzLevelFreeCondition2(f,gf,minct,maxct,alterf,desc,op)
else else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end end
local altg=mg:Filter(Auxiliary.XyzAlterFilter,nil,alterf,c,e,tp,op):Filter(Auxiliary.MustMaterialCheck,nil,tp,EFFECT_MUST_BE_XMATERIAL) local altg=mg:Filter(Auxiliary.XyzAlterFilter,nil,alterf,c,e,tp,alterop):Filter(Auxiliary.MustMaterialCheck,nil,tp,EFFECT_MUST_BE_XMATERIAL)
if (not min or min<=1) and altg:GetCount()>0 then if (not min or min<=1) and altg:GetCount()>0 then
return true return true
end end
...@@ -1019,7 +1019,7 @@ function Auxiliary.XyzLevelFreeCondition2(f,gf,minct,maxct,alterf,desc,op) ...@@ -1019,7 +1019,7 @@ function Auxiliary.XyzLevelFreeCondition2(f,gf,minct,maxct,alterf,desc,op)
return res return res
end end
end end
function Auxiliary.XyzLevelFreeTarget2(f,gf,minct,maxct,alterf,desc,op) 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) return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
if og and not min then if og and not min then
return true return true
...@@ -1040,13 +1040,13 @@ function Auxiliary.XyzLevelFreeTarget2(f,gf,minct,maxct,alterf,desc,op) ...@@ -1040,13 +1040,13 @@ function Auxiliary.XyzLevelFreeTarget2(f,gf,minct,maxct,alterf,desc,op)
local mg2=mg:Filter(Auxiliary.XyzLevelFreeFilter,nil,c,f) local mg2=mg:Filter(Auxiliary.XyzLevelFreeFilter,nil,c,f)
Duel.SetSelectedCard(sg) Duel.SetSelectedCard(sg)
local b1=mg2:CheckSubGroup(Auxiliary.XyzLevelFreeGoal,minc,maxc,tp,c,gf) local b1=mg2:CheckSubGroup(Auxiliary.XyzLevelFreeGoal,minc,maxc,tp,c,gf)
local b2=(not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,op) local b2=(not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,alterop)
local g=nil local g=nil
if b2 and (not b1 or Duel.SelectYesNo(tp,desc)) then if b2 and (not b1 or Duel.SelectYesNo(tp,alterdesc)) then
e:SetLabel(1) e:SetLabel(1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,op) g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,alterop)
if op then op(e,tp,1,g:GetFirst()) end if alterop then alterop(e,tp,1,g:GetFirst()) end
else else
e:SetLabel(0) e:SetLabel(0)
Duel.SetSelectedCard(sg) Duel.SetSelectedCard(sg)
...@@ -1063,7 +1063,7 @@ function Auxiliary.XyzLevelFreeTarget2(f,gf,minct,maxct,alterf,desc,op) ...@@ -1063,7 +1063,7 @@ function Auxiliary.XyzLevelFreeTarget2(f,gf,minct,maxct,alterf,desc,op)
else return false end else return false end
end end
end end
function Auxiliary.XyzLevelFreeOperation2(f,gf,minct,maxct,alterf,desc,op) function Auxiliary.XyzLevelFreeOperationAlter(f,gf,minct,maxct,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max) return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then if og and not min then
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
......
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