Commit f24eb499 authored by DailyShana's avatar DailyShana

fix

for Duel.NegateEffect
parent c96a7604
......@@ -29,9 +29,10 @@ end
function c11067666.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(11067666,0)) then
e:GetHandler():RegisterFlagEffect(11067666,RESET_EVENT+0x1fe0000,0,1)
Duel.NegateEffect(ev)
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
function c11067666.rmcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,8 +25,7 @@ function c13166204.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c13166204.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(re:GetHandler(),REASON_EFFECT)~=0 then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(re:GetHandler(),REASON_EFFECT)~=0 then
Duel.BreakEffect()
local a=re:GetHandler():GetAttack()
local b=re:GetHandler():GetDefense()
......
......@@ -56,8 +56,7 @@ function c15155568.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c15155568.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......@@ -41,7 +41,7 @@ end
function c19302550.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,aux.Stringid(19302550,1)) then return end
e:GetHandler():RegisterFlagEffect(19302550,RESET_EVENT+0x1fe0000,0,1)
Duel.NegateEffect(ev)
if not Duel.NegateEffect(ev) then return end
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
......
......@@ -50,8 +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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -55,6 +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)
Duel.NegateEffect(ev)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
......@@ -89,8 +89,7 @@ function c24696097.distg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c24696097.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......
......@@ -58,7 +58,7 @@ function c26268488.distg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c26268488.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
if not Duel.NegateEffect(ev) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
......
......@@ -59,8 +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()
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -41,8 +41,7 @@ end
function c29616929.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if not tc:IsDisabled() then
Duel.NegateEffect(ev)
if tc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and tc:IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......
......@@ -33,8 +33,9 @@ end
function c32134638.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(32134638,1)) then
e:GetHandler():RegisterFlagEffect(32134638,RESET_EVENT+0x1fe0000,0,1)
Duel.NegateEffect(ev)
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
......@@ -19,6 +19,7 @@ function c33784505.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c33784505.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
......@@ -39,8 +39,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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -58,8 +58,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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -31,9 +31,10 @@ end
function c368382.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(368382,0)) then
e:GetHandler():RegisterFlagEffect(368382,RESET_EVENT+0x1fe0000,0,1)
Duel.NegateEffect(ev)
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
function c368382.cfilter(c)
......
......@@ -36,8 +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
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......@@ -34,9 +34,10 @@ end
function c38988538.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(38988538,0)) then
e:GetHandler():RegisterFlagEffect(38988538,RESET_EVENT+0x1fe0000,0,1)
Duel.NegateEffect(ev)
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
function c38988538.cfilter(c)
......
......@@ -16,11 +16,12 @@ end
function c42364257.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c42364257.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
if Duel.NegateEffect(ev) then
local g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
Duel.Destroy(g,REASON_EFFECT)
end
end
......@@ -14,8 +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()
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......@@ -43,7 +43,7 @@ end
function c46796664.disop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,aux.Stringid(46796664,1)) then return end
e:GetHandler():RegisterFlagEffect(46796664,RESET_EVENT+0x1fe0000,0,1)
Duel.NegateEffect(ev)
if not Duel.NegateEffect(ev) then return end
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
......
......@@ -45,8 +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
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -59,8 +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
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -23,7 +23,8 @@ function c55608151.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c55608151.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
local g=Duel.GetMatchingGroup(c55608151.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
if Duel.NegateEffect(ev) then
local g=Duel.GetMatchingGroup(c55608151.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
......@@ -31,8 +31,7 @@ end
function c58120309.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if not tc:IsDisabled() then
Duel.NegateEffect(ev)
if tc:IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 then
if Duel.NegateEffect(ev) and tc: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.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(58120309,0)) then
Duel.BreakEffect()
......
......@@ -36,8 +36,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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -88,8 +88,7 @@ function c62892347.disop(e,tp,eg,ep,ev,re,r,rp)
if (val==1 and rp~=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
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......@@ -34,9 +34,10 @@ end
function c63251695.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(63251695,1)) then
e:GetHandler():RegisterFlagEffect(63251695,RESET_EVENT+0x1fe0000,0,1)
Duel.NegateEffect(ev)
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
function c63251695.effcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -48,10 +48,9 @@ function c63767246.distg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c63767246.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
local c=e:GetHandler()
local rc=re:GetHandler()
if c:IsRelateToEffect(e) and rc:IsRelateToEffect(re) and c:IsType(TYPE_XYZ) then
if Duel.NegateEffect(ev) and c:IsRelateToEffect(e) and rc:IsRelateToEffect(re) and c:IsType(TYPE_XYZ) then
rc:CancelToGrave()
Duel.Overlay(c,Group.FromCards(rc))
end
......
......@@ -54,8 +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
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -48,8 +48,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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -55,6 +55,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)
Duel.NegateEffect(ev)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
......@@ -44,8 +44,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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -47,8 +47,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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -55,6 +55,7 @@ function c8719957.negcon(e,tp,eg,ep,ev,re,r,rp)
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function c8719957.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
if Duel.NegateEffect(ev) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
......@@ -58,8 +58,7 @@ function c92408984.operation1(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
local tc=Duel.GetFirstTarget()
Duel.NegateEffect(ct-1)
if tc and tc:IsRelateToEffect(e) then
if Duel.NegateEffect(ct-1) and tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -85,8 +84,7 @@ end
function c92408984.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......@@ -75,8 +75,7 @@ function c93016201.activate1(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
local te=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
Duel.NegateEffect(ct-1)
if tc:IsRelateToEffect(te) then
if Duel.NegateEffect(ct-1) and tc:IsRelateToEffect(te) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -113,8 +112,7 @@ function c93016201.target3(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c93016201.activate3(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......@@ -51,8 +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
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......
......@@ -70,8 +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
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
end
......@@ -44,8 +44,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
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
......
......@@ -34,7 +34,7 @@ function c983995.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_ONFIELD+LOCATION_HAND)
end
function c983995.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
if not Duel.NegateEffect(ev) then end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD+LOCATION_HAND,1,1,nil)
if g:GetCount()~=0 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