Commit 55efae7c authored by Chrono-Genex's avatar Chrono-Genex Committed by GitHub

update EFFECT_EXTRA_SYNCHRO_MATERIAL (#2042)

parent 0625cf0f
......@@ -34,13 +34,13 @@ function c14507213.activate(e,tp,eg,ep,ev,re,r,rp)
if tc and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetCode(EFFECT_EXTRA_SYNCHRO_MATERIAL)
e1:SetOwnerPlayer(tp)
e1:SetCondition(c14507213.matcon)
e1:SetValue(c14507213.matval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c14507213.matcon(e)
return e:GetHandler():IsControler(1-e:GetOwnerPlayer())
function c14507213.matval(e,c)
return c:IsControler(e:GetOwnerPlayer())
end
--魔界造車-GT19
--魔界造車GT19
local s,id,o=GetID()
function s.initial_effect(c)
--flip
......@@ -62,7 +62,8 @@ function s.filter(tc,c,tp)
if not tc:IsFaceup() or not tc:IsCanBeSynchroMaterial() then return false end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetCode(EFFECT_EXTRA_SYNCHRO_MATERIAL)
e1:SetValue(1)
tc:RegisterEffect(e1,true)
local mg=Group.FromCards(c,tc)
local res=Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
......@@ -87,7 +88,8 @@ function s.synop(e,tp,eg,ep,ev,re,r,rp)
and tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetCode(EFFECT_EXTRA_SYNCHRO_MATERIAL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local mg=Group.FromCards(c,tc)
......
......@@ -36,7 +36,8 @@ function c62899696.filter(tc,c,tp)
c:RegisterFlagEffect(62899696,0,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetCode(EFFECT_EXTRA_SYNCHRO_MATERIAL)
e1:SetValue(1)
tc:RegisterEffect(e1,true)
local mg=Group.FromCards(c,tc)
local res=Duel.IsExistingMatchingCard(c62899696.synfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
......@@ -62,7 +63,8 @@ function c62899696.spop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterFlagEffect(62899696,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetCode(EFFECT_EXTRA_SYNCHRO_MATERIAL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local mg=Group.FromCards(c,tc)
......
......@@ -492,7 +492,7 @@ EFFECT_TOSS_COIN_REPLACE =220 --重新抛硬币
EFFECT_TOSS_DICE_REPLACE =221 --重新掷骰子
EFFECT_FUSION_MATERIAL =230 --指定融合素材的條件
EFFECT_CHAIN_MATERIAL =231 --玩家受到連鎖物質的效果影響
EFFECT_SYNCHRO_MATERIAL =232 --可以当作同调素材
EFFECT_EXTRA_SYNCHRO_MATERIAL =232 --可以当作同调素材
EFFECT_XYZ_MATERIAL =233 --可以当作超量素材
EFFECT_FUSION_SUBSTITUTE =234 --代替融合素材
EFFECT_CANNOT_BE_FUSION_MATERIAL =235--不能做融合素材
......
......@@ -458,7 +458,7 @@ function Auxiliary.AddSynchroMixProcedure(c,f1,f2,f3,f4,minc,maxc,gc)
c:RegisterEffect(e1)
end
function Auxiliary.SynMaterialFilter(c,syncard)
return c:IsFaceup() and c:IsCanBeSynchroMaterial(syncard)
return c:IsFaceupEx() and c:IsCanBeSynchroMaterial(syncard)
end
function Auxiliary.SynLimitFilter(c,f,e,syncard)
return f and not f(e,c,syncard)
......@@ -467,7 +467,7 @@ function Auxiliary.GetSynchroLevelFlowerCardian(c)
return 2
end
function Auxiliary.GetSynMaterials(tp,syncard)
local mg=Duel.GetMatchingGroup(Auxiliary.SynMaterialFilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,syncard)
local mg=Duel.GetSynchroMaterial(tp):Filter(Auxiliary.SynMaterialFilter,nil,syncard)
if mg:IsExists(Card.GetHandSynchro,1,nil) then
local mg2=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_HAND,0,nil,syncard)
if mg2:GetCount()>0 then mg:Merge(mg2) end
......@@ -628,6 +628,21 @@ function Auxiliary.SynMixCheckRecursive(c,tp,sg,mg,ct,minc,maxc,syncard,sg1,smat
ct=ct-1
return res
end
-- the material is in hand and don't has extra synchro material effect itself
-- that mean some other tuner added it as material
function Auxiliary.SynMixHandFilter(c,tp,syncard)
if not c:IsLocation(LOCATION_HAND) then return false end
local le={c:IsHasEffect(EFFECT_EXTRA_SYNCHRO_MATERIAL,tp)}
for _,te in pairs(le) do
local tf=te:GetValue()
if Auxiliary.GetValueType(tf)=="function" then
if tf(te,syncard) then return false end
else
if tf~=0 then return false end
end
end
return true
end
function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
if ct<minc then return false end
local g=sg:Clone()
......@@ -640,7 +655,7 @@ function Auxiliary.SynMixCheckGoal(tp,sg,minc,ct,syncard,sg1,smat,gc,mgchk)
and (not g:IsExists(Card.IsHasEffect,1,nil,89818984)
or not g:CheckWithSumEqual(Auxiliary.GetSynchroLevelFlowerCardian,syncard:GetLevel(),g:GetCount(),g:GetCount(),syncard))
then return false end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
local hg=g:Filter(Auxiliary.SynMixHandFilter,nil,tp,syncard)
local hct=hg:GetCount()
if hct>0 and not mgchk then
local found=false
......
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