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)
return not g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,ecode)
end
end
function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,op)
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))
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 alterop or alterop(e,tp,0,c))
end
--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)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -693,9 +693,9 @@ function Auxiliary.AddXyzProcedure(c,f,lv,ct,alterf,desc,maxct,op)
e1:SetRange(LOCATION_EXTRA)
if not maxct then maxct=ct end
if alterf then
e1:SetCondition(Auxiliary.XyzCondition2(f,lv,ct,maxct,alterf,desc,op))
e1:SetTarget(Auxiliary.XyzTarget2(f,lv,ct,maxct,alterf,desc,op))
e1:SetOperation(Auxiliary.XyzOperation2(f,lv,ct,maxct,alterf,desc,op))
e1:SetCondition(Auxiliary.XyzConditionAlter(f,lv,ct,maxct,alterf,alterdesc,alterop))
e1:SetTarget(Auxiliary.XyzTargetAlter(f,lv,ct,maxct,alterf,alterdesc,alterop))
e1:SetOperation(Auxiliary.XyzOperationAlter(f,lv,ct,maxct,alterf,alterdesc,alterop))
else
e1:SetCondition(Auxiliary.XyzCondition(f,lv,ct,maxct))
e1:SetTarget(Auxiliary.XyzTarget(f,lv,ct,maxct))
......@@ -770,7 +770,7 @@ function Auxiliary.XyzOperation(f,lv,minc,maxc)
end
end
--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)
if c==nil then return true 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)
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,op) then
if (not min or min<=1) and mg:IsExists(Auxiliary.XyzAlterFilter,1,nil,alterf,c,e,tp,alterop) then
return true
end
local minc=minc
......@@ -794,7 +794,7 @@ function Auxiliary.XyzCondition2(f,lv,minc,maxc,alterf,desc,op)
return Duel.CheckXyzMaterial(c,f,lv,minc,maxc,og)
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)
if og and not min then
return true
......@@ -812,13 +812,13 @@ function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op)
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
end
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
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,op)
if op then op(e,tp,1,g:GetFirst()) end
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,alterop)
if alterop then alterop(e,tp,1,g:GetFirst()) end
else
e:SetLabel(0)
g=Duel.SelectXyzMaterial(tp,c,f,lv,minc,maxc,og)
......@@ -830,7 +830,7 @@ function Auxiliary.XyzTarget2(f,lv,minc,maxc,alterf,desc,op)
else return false 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)
if og and not min then
local sg=Group.CreateGroup()
......@@ -866,7 +866,7 @@ function Auxiliary.XyzOperation2(f,lv,minc,maxc,alterf,desc,op)
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)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -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:SetRange(LOCATION_EXTRA)
if alterf then
e1:SetCondition(Auxiliary.XyzLevelFreeCondition2(f,gf,minc,maxc,alterf,desc,op))
e1:SetTarget(Auxiliary.XyzLevelFreeTarget2(f,gf,minc,maxc,alterf,desc,op))
e1:SetOperation(Auxiliary.XyzLevelFreeOperation2(f,gf,minc,maxc,alterf,desc,op))
e1:SetCondition(Auxiliary.XyzLevelFreeConditionAlter(f,gf,minc,maxc,alterf,alterdesc,alterop))
e1:SetTarget(Auxiliary.XyzLevelFreeTargetAlter(f,gf,minc,maxc,alterf,alterdesc,alterop))
e1:SetOperation(Auxiliary.XyzLevelFreeOperationAlter(f,gf,minc,maxc,alterf,alterdesc,alterop))
else
e1:SetCondition(Auxiliary.XyzLevelFreeCondition(f,gf,minc,maxc))
e1:SetTarget(Auxiliary.XyzLevelFreeTarget(f,gf,minc,maxc))
......@@ -987,7 +987,7 @@ function Auxiliary.XyzLevelFreeOperation(f,gf,minct,maxct)
end
end
--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)
if c==nil then return true 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)
else
mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
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
return true
end
......@@ -1019,7 +1019,7 @@ function Auxiliary.XyzLevelFreeCondition2(f,gf,minct,maxct,alterf,desc,op)
return res
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)
if og and not min then
return true
......@@ -1040,13 +1040,13 @@ function Auxiliary.XyzLevelFreeTarget2(f,gf,minct,maxct,alterf,desc,op)
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 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
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)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,op)
if op then op(e,tp,1,g:GetFirst()) end
g=mg:FilterSelect(tp,Auxiliary.XyzAlterFilter,1,1,nil,alterf,c,e,tp,alterop)
if alterop then alterop(e,tp,1,g:GetFirst()) end
else
e:SetLabel(0)
Duel.SetSelectedCard(sg)
......@@ -1063,7 +1063,7 @@ function Auxiliary.XyzLevelFreeTarget2(f,gf,minct,maxct,alterf,desc,op)
else return false 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)
if og and not min then
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