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

update ThisCardInGraveAlreadyCheck & fix Assault Synchron (#2068)

parent d8e96a31
...@@ -57,16 +57,14 @@ end ...@@ -57,16 +57,14 @@ end
function c77202120.splimit(e,c) function c77202120.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA) return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end end
function c77202120.cfilter(c,e,tp,se,cre) function c77202120.cfilter(c,tp,se)
return c:IsControler(tp) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO) return c:IsControler(tp) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp)
and (se==nil or c:GetReasonEffect()~=se) and (se==nil or c:GetReasonEffect()~=se)
and (c:GetReasonEffect()~=cre or cre and cre:IsActivated())
end end
function c77202120.condition(e,tp,eg,ep,ev,re,r,rp) function c77202120.condition(e,tp,eg,ep,ev,re,r,rp)
local se=e:GetLabelObject():GetLabelObject() local se=e:GetLabelObject():GetLabelObject()
local cre=e:GetHandler():GetReasonEffect() return eg:IsExists(c77202120.cfilter,1,nil,tp,se)
return eg:IsExists(c77202120.cfilter,1,nil,e,tp,se,cre)
end end
function c77202120.spfilter(c,e,tp) function c77202120.spfilter(c,e,tp)
return c:IsControler(tp) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO) return c:IsControler(tp) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_SYNCHRO)
......
...@@ -2975,12 +2975,13 @@ function Auxiliary.AddThisCardInGraveAlreadyCheck(c) ...@@ -2975,12 +2975,13 @@ function Auxiliary.AddThisCardInGraveAlreadyCheck(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_GRAVE) e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetCondition(Auxiliary.ThisCardInGraveAlreadyCheckReg)
e1:SetOperation(Auxiliary.ThisCardInGraveAlreadyCheckOperation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
return e1 return e1
end end
function Auxiliary.ThisCardInGraveAlreadyCheckOperation(e,tp,eg,ep,ev,re,r,rp) function Auxiliary.ThisCardInGraveAlreadyCheckReg(e,tp,eg,ep,ev,re,r,rp)
--condition of continous effect will be checked before other effects
if e:GetLabelObject()~=nil then return false end
if (r&REASON_EFFECT)>0 then if (r&REASON_EFFECT)>0 then
e:SetLabelObject(re) e:SetLabelObject(re)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -2996,7 +2997,22 @@ function Auxiliary.ThisCardInGraveAlreadyCheckOperation(e,tp,eg,ep,ev,re,r,rp) ...@@ -2996,7 +2997,22 @@ function Auxiliary.ThisCardInGraveAlreadyCheckOperation(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_CHAIN) e2:SetReset(RESET_CHAIN)
e2:SetLabelObject(e1) e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
elseif (r&REASON_MATERIAL)>0 or re and not re:IsActivated() and (r&REASON_COST)>0 then
e:SetLabelObject(re)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(Auxiliary.ThisCardInGraveAlreadyReset1)
e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON)
e2:SetOperation(Auxiliary.ThisCardInGraveAlreadyReset2)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end end
return false
end end
function Auxiliary.ThisCardInGraveAlreadyReset1(e) function Auxiliary.ThisCardInGraveAlreadyReset1(e)
--this will run after EVENT_SPSUMMON_SUCCESS --this will run after EVENT_SPSUMMON_SUCCESS
......
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