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

fix "Negate effect that targets this card on the field" (#2577)

parent 7d3d2a41
......@@ -48,6 +48,7 @@ function c1953925.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if not rc:IsType(TYPE_TRAP) then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not e:GetHandler():IsRelateToEffect(re) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g and g:IsContains(e:GetHandler()) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
......
......@@ -36,6 +36,7 @@ c1995985.lvup={74388798}
function c1995985.disop(e,tp,eg,ep,ev,re,r,rp)
if not re:GetHandler():IsType(TYPE_SPELL) or rp==tp then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not e:GetHandler():IsRelateToEffect(re) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g and g:IsContains(e:GetHandler()) then
Duel.NegateEffect(ev)
......
......@@ -30,6 +30,7 @@ end
function c42868711.disop(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not re:IsActiveType(TYPE_SPELL+TYPE_TRAP) then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not e:GetHandler():IsRelateToEffect(re) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsContains(e:GetHandler()) then
......
......@@ -42,6 +42,7 @@ end
function c49681811.disop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsActiveType(TYPE_SPELL) then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not e:GetHandler():IsRelateToEffect(re) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsContains(e:GetHandler()) then
......
......@@ -56,7 +56,8 @@ function c49868263.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c49868263.disop2(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL) and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
if e:GetHandler():IsRelateToEffect(re)
and re:IsActiveType(TYPE_SPELL) and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g and g:IsContains(e:GetHandler()) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
......
......@@ -85,6 +85,7 @@ end
function c62892347.disop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler()
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not ec:IsRelateToEffect(re) then return end
local val=ec:GetFlagEffectLabel(36690018)
if (val==1 and rp==1-ec:GetControler()) or (val==0 and rp==ec:GetControler()) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
......
......@@ -40,7 +40,8 @@ function c66235877.distg(e,c)
end
function c66235877.disop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_FLIP) then Duel.NegateEffect(ev) end
if re:IsActiveType(TYPE_TRAP) and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
if e:GetHandler():IsRelateToEffect(re)
and re:IsActiveType(TYPE_TRAP) and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g and g:IsContains(e:GetHandler()) then
Duel.NegateEffect(ev)
......
......@@ -48,6 +48,7 @@ end
function c94568601.disop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsActiveType(TYPE_TRAP) then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
if not e:GetHandler():IsRelateToEffect(re) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsContains(e:GetHandler()) then
......
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