Commit 434e4388 authored by mercury233's avatar mercury233 Committed by GitHub

update Duel.NegateEffect (#1882)

parent 15e2844b
......@@ -24,7 +24,8 @@ end
function c11067666.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return e:GetHandler():GetFlagEffect(11067666)==0 and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
and g and g:IsExists(c11067666.cfilter,1,nil,tp) and Duel.IsChainDisablable(ev)
and g and g:IsExists(c11067666.cfilter,1,nil,tp)
and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
end
function c11067666.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
......
......@@ -25,7 +25,7 @@ end
function c13758665.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,13758665)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......@@ -36,7 +36,8 @@ function c19302550.splimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsSetCard(0xaf) and bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c19302550.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainDisablable(ev) and re:IsActiveType(TYPE_TRAP) and aux.damcon1(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():GetFlagEffect(19302550)==0
return Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
and re:IsActiveType(TYPE_TRAP) and aux.damcon1(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():GetFlagEffect(19302550)==0
end
function c19302550.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectEffectYesNo(tp,e:GetHandler()) then return end
......
......@@ -50,7 +50,7 @@ function c1953925.disop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g and g:IsContains(e:GetHandler()) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -55,7 +55,7 @@ function c19596712.negcon(e,tp,eg,ep,ev,re,r,rp)
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainDisablable(ev)
end
function c19596712.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) then
if Duel.NegateEffect(ev,true) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
......@@ -59,7 +59,7 @@ end
function c26964762.disop(e,tp,eg,ep,ev,re,r,rp)
if rp==tp and re:IsActiveType(TYPE_SPELL) then
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -23,10 +23,7 @@ function c29616929.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c29616929.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if not tc:IsDisabled() then
if Duel.NegateEffect(ev) and tc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
end
......@@ -28,7 +28,8 @@ end
function c32134638.negcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return e:GetHandler():GetFlagEffect(32134638)==0 and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
and g and g:IsExists(c32134638.tfilter,1,e:GetHandler(),tp) and Duel.IsChainDisablable(ev)
and g and g:IsExists(c32134638.tfilter,1,e:GetHandler(),tp)
and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
end
function c32134638.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
......
......@@ -43,7 +43,7 @@ function c35798491.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc==1 or dc==3 or dc==6 then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -62,7 +62,7 @@ function c35975813.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=2 and dc~=5 then return end
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -26,7 +26,8 @@ end
function c368382.negcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return e:GetHandler():GetFlagEffect(368382)==0 and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
and g and g:IsExists(c368382.tfilter,1,e:GetHandler(),tp) and Duel.IsChainDisablable(ev)
and g and g:IsExists(c368382.tfilter,1,e:GetHandler(),tp)
and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
end
function c368382.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
......
......@@ -36,7 +36,7 @@ function c38742075.disop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or not g:IsExists(c38742075.cfilter,1,nil,tp) then return end
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......@@ -29,7 +29,8 @@ end
function c38988538.negcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return e:GetHandler():GetFlagEffect(38988538)==0 and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
and g and g:IsExists(c38988538.tfilter,1,e:GetHandler(),tp) and Duel.IsChainDisablable(ev)
and g and g:IsExists(c38988538.tfilter,1,e:GetHandler(),tp)
and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
end
function c38988538.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
......
......@@ -33,7 +33,7 @@ function c42868711.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsContains(e:GetHandler()) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -14,7 +14,7 @@ end
function c44155002.disop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)~=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) then return end
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......@@ -38,7 +38,8 @@ function c46796664.splimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsSetCard(0xaf) and bit.band(sumtype,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function c46796664.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_SPELL) and aux.damcon1(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():GetFlagEffect(46796664)==0
return Duel.IsChainNegatable(ev) and not Duel.IsChainDisabled(ev)
and re:IsActiveType(TYPE_SPELL) and aux.damcon1(e,tp,eg,ep,ev,re,r,rp) and e:GetHandler():GetFlagEffect(46796664)==0
end
function c46796664.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectEffectYesNo(tp,e:GetHandler()) then return end
......
......@@ -97,5 +97,5 @@ function c47355498.disop(e,tp,eg,ep,ev,re,r,rp)
if not res and c47355498.discheck(ev,CATEGORY_TOEXTRA,re,im0,im1) then res=true end
if not res and c47355498.discheck(ev,CATEGORY_LEAVE_GRAVE,re,im0,im1) then res=true end
if not res and c47355498.discheck(ev,CATEGORY_REMOVE,re,im0,im1) then res=true end
if res then Duel.NegateEffect(ev) end
if res then Duel.NegateEffect(ev,true) end
end
......@@ -45,7 +45,7 @@ function c49681811.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsContains(e:GetHandler()) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -59,7 +59,7 @@ function c49868263.disop2(e,tp,eg,ep,ev,re,r,rp)
if 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) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -38,12 +38,14 @@ function c54828837.cfilter(c)
end
function c54828837.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c54828837.cfilter,tp,LOCATION_MZONE,0,1,nil)
and rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev)
and rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
and e:GetHandler():GetFlagEffect(54828837)<=0
end
function c54828837.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(54828837,0)) then
if Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,54828837)
if Duel.NegateEffect(ev) and Duel.IsExistingMatchingCard(c54828837.cfilter,tp,LOCATION_MZONE,0,1,nil) then
Duel.BreakEffect()
......@@ -52,7 +54,7 @@ function c54828837.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.HintSelection(g)
Duel.ChangePosition(g:GetFirst(),POS_FACEUP_DEFENSE)
end
e:GetHandler():RegisterFlagEffect(54828837,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
c:RegisterFlagEffect(54828837,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c54828837.protfilter(c,tp)
......
......@@ -30,14 +30,11 @@ function c58120309.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c58120309.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if not tc:IsDisabled() then
if Duel.NegateEffect(ev) and tc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 then
local sc=Duel.GetFirstMatchingCard(c58120309.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if sc and Duel.SelectYesNo(tp,aux.Stringid(58120309,0)) then
Duel.BreakEffect()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
......@@ -34,8 +34,7 @@ function c58374502.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c58374502.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if not tc:IsDisabled() and Duel.NegateEffect(ev) and tc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......@@ -40,7 +40,7 @@ function c61370518.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc==1 or dc==3 or dc==6 then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -89,7 +89,7 @@ function c62892347.disop(e,tp,eg,ep,ev,re,r,rp)
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)
if not g or not g:IsContains(ec) then return end
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......@@ -54,7 +54,7 @@ function c70676581.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsExists(c70676581.disfilter,1,nil,tp) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -52,7 +52,7 @@ function c72192100.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=3 then return end
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -56,7 +56,7 @@ function c72932673.negcon(e,tp,eg,ep,ev,re,r,rp)
and re:IsActiveType(TYPE_SPELL) and Duel.IsChainDisablable(ev)
end
function c72932673.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) then
if Duel.NegateEffect(ev,true) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
......@@ -48,7 +48,7 @@ function c73219648.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=3 then return end
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -62,7 +62,7 @@ function c83743222.negcon(e,tp,eg,ep,ev,re,r,rp)
end
function c83743222.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateEffect(ev) then
if Duel.NegateEffect(ev,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_EXTRA_ATTACK)
......
......@@ -51,7 +51,7 @@ function c8581705.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=2 and dc~=5 then return end
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -25,7 +25,7 @@ end
function c87769556.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,87769556)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......@@ -37,7 +37,7 @@ function c90464188.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsExists(c90464188.disfilter,1,nil,tp) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -51,7 +51,7 @@ function c94568601.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()==0 then return end
if g:IsContains(e:GetHandler()) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -70,7 +70,7 @@ function c95515060.disop(e,tp,eg,ep,ev,re,r,rp)
if not ec:GetEquipTarget() or not re:IsActiveType(TYPE_SPELL) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or not g:IsContains(ec:GetEquipTarget()) then return end
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......@@ -46,7 +46,7 @@ function c9603356.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local dc=Duel.TossDice(tp,1)
if dc~=3 then return end
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev,true) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
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