Commit 891444b1 authored by nanahira's avatar nanahira Committed by GitHub

update tune magician check using Card.IsHasEffect (#1017)

parent 5f197f2d
......@@ -44,7 +44,7 @@ function c31111109.fselect(c,tp,mg,sg)
return res
end
function c31111109.fgoal(tp,sg)
if sg:IsExists(aux.FCheckTuneMagicianX,1,nil,sg) then return false end
if sg:IsExists(aux.TuneMagicianCheckX,1,nil,sg,EFFECT_TUNE_MAGICIAN_F) then return false end
if not (sg:GetCount()==5 and Duel.GetLocationCountFromEx(tp,tp,sg)>0) then return false end
local g1=sg:Filter(Card.IsFusionSetCard,nil,0x9)
local c1=g1:GetCount()
......
......@@ -34,6 +34,7 @@ function c73941492.initial_effect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_TUNE_MAGICIAN_F)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetValue(c73941492.fuslimit)
c:RegisterEffect(e5)
--xyz limit
local e6=Effect.CreateEffect(c)
......@@ -57,6 +58,12 @@ end
function c73941492.synlimit(e,c)
return c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM)
end
function c73941492.fuslimit(e,c)
return not (c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM))
end
function c73941492.xyzlimit(e,c)
return not (c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM))
end
function c73941492.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM)
end
......@@ -104,9 +111,3 @@ function c73941492.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
end
end
function c73941492.fuslimit(c)
return not (c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM))
end
function c73941492.xyzlimit(e,c)
return not (c:IsSetCard(0x98) and c:IsType(TYPE_PENDULUM))
end
......@@ -501,6 +501,18 @@ function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat)
end
return true
end
--Checking Tune Magician
function Auxiliary.TuneMagicianFilter(c,e)
local f=e:GetValue()
return f(e,c)
end
function Auxiliary.TuneMagicianCheckX(c,sg,ecode)
local eset={c:IsHasEffect(ecode)}
for _,te in pairs(eset) do
if sg:IsExists(Auxiliary.TuneMagicianFilter,1,c,te) then return true end
end
return false
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 (not op or op(e,tp,0,c))
end
......@@ -723,6 +735,7 @@ function Auxiliary.XyzLevelFreeCheck(c,tp,xyzc,mg,sg,gf,minc,maxc)
return res
end
function Auxiliary.XyzLevelFreeGoal(g,tp,xyzc,gf)
if g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,EFFECT_TUNE_MAGICIAN_X) then return false end
return (not gf or gf(g)) and Duel.GetLocationCountFromEx(tp,tp,g,xyzc)>0
end
function Auxiliary.XyzLevelFreeCondition(f,gf,minct,maxct)
......@@ -1055,13 +1068,10 @@ function Auxiliary.FCheckMix(c,mg,sg,fc,sub,fun1,fun2,...)
return fun1(c,fc,sub,mg,sg)
end
end
function Auxiliary.FCheckTuneMagicianX(c,sg)
return c:IsHasEffect(EFFECT_TUNE_MAGICIAN_F) and sg:IsExists(c.fuslimit,1,c)
end
--if sg1 is subset of sg2 then not Auxiliary.FCheckAdditional(tp,sg1,fc) -> not Auxiliary.FCheckAdditional(tp,sg2,fc)
Auxiliary.FCheckAdditional=nil
function Auxiliary.FCheckMixGoal(tp,sg,fc,sub,chkf,...)
if sg:IsExists(Auxiliary.FCheckTuneMagicianX,1,nil,sg) then return false end
if sg:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,sg,EFFECT_TUNE_MAGICIAN_F) then return false end
if not Auxiliary.MustMaterialCheck(sg,tp,EFFECT_MUST_BE_FMATERIAL) then return false end
local g=Group.CreateGroup()
return sg:IsExists(Auxiliary.FCheckMix,1,nil,sg,g,fc,sub,...) and (chkf==PLAYER_NONE or Duel.GetLocationCountFromEx(tp,tp,sg,fc)>0)
......@@ -1171,7 +1181,7 @@ function Auxiliary.FCheckMixRepFilter(c,sg,g,fc,sub,chkf,fun1,minc,maxc,fun2,...
return false
end
function Auxiliary.FCheckMixRepGoal(tp,sg,fc,sub,chkf,fun1,minc,maxc,...)
if sg:IsExists(Auxiliary.FCheckTuneMagicianX,1,nil,sg) then return false end
if sg:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,sg,EFFECT_TUNE_MAGICIAN_F) then return false end
if not Auxiliary.MustMaterialCheck(sg,tp,EFFECT_MUST_BE_FMATERIAL) then return false end
if sg:GetCount()<minc+#{...} or sg:GetCount()>maxc+#{...} then return false end
local g=Group.CreateGroup()
......@@ -1358,7 +1368,7 @@ function Auxiliary.FShaddollSpFilter1(c,tp,mg,exg,attr)
end
function Auxiliary.FShaddollSpFilter2(c,tp,mc,attr)
local sg=Group.FromCards(c,mc)
if sg:IsExists(Auxiliary.FCheckTuneMagicianX,1,nil,sg) then return false end
if sg:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,sg,EFFECT_TUNE_MAGICIAN_F) then return false end
if not Auxiliary.MustMaterialCheck(sg,tp,EFFECT_MUST_BE_FMATERIAL) then return false end
return ((Auxiliary.FShaddollFilter1(c) and Auxiliary.FShaddollFilter2(mc,attr))
or (Auxiliary.FShaddollFilter2(c,attr) and Auxiliary.FShaddollFilter1(mc)))
......
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