function c000000.negfltr(c)
return c:IsLocation(LOCATION_ONFIELD)
end
function c000000.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if c:IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
if Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) end
if Duel.GetOperationInfo(ev,CATEGORY_RELEASE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_RELEASE) end
if Duel.GetOperationInfo(ev,CATEGORY_REMOVE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_REMOVE) end
if Duel.GetOperationInfo(ev,CATEGORY_TOHAND)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_TOHAND) end
if Duel.GetOperationInfo(ev,CATEGORY_TODECK)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_TODECK) end
if Duel.GetOperationInfo(ev,CATEGORY_TOGRAVE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_TOGRAVE) end
if Duel.GetOperationInfo(ev,CATEGORY_DECKDES)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DECKDES) end
if Duel.GetOperationInfo(ev,CATEGORY_HANDES)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_HANDES) end
if Duel.GetOperationInfo(ev,CATEGORY_SUMMON)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_SUMMON) end
if Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_SPECIAL_SUMMON) end
if Duel.GetOperationInfo(ev,CATEGORY_TOKEN)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_TOKEN) end
if Duel.GetOperationInfo(ev,CATEGORY_FLIP)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_FLIP) end
if Duel.GetOperationInfo(ev,CATEGORY_POSITION)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_POSITION) end
if Duel.GetOperationInfo(ev,CATEGORY_CONTROL)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_CONTROL) end
if Duel.GetOperationInfo(ev,CATEGORY_DISABLE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DISABLE) end
if Duel.GetOperationInfo(ev,CATEGORY_DISABLE_SUMMON)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DISABLE_SUMMON) end
if Duel.GetOperationInfo(ev,CATEGORY_DRAW)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DRAW) end
if Duel.GetOperationInfo(ev,CATEGORY_SEARCH)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_SEARCH) end
if Duel.GetOperationInfo(ev,CATEGORY_EQUIP)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_EQUIP) end
if Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE) end
if Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_RECOVER) end
if Duel.GetOperationInfo(ev,CATEGORY_ATKCHANGE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_ATKCHANGE) end
if Duel.GetOperationInfo(ev,CATEGORY_DEFCHANGE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DEFCHANGE) end
if Duel.GetOperationInfo(ev,CATEGORY_COUNTER)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_COUNTER) end
if Duel.GetOperationInfo(ev,CATEGORY_COIN)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_COIN) end
if Duel.GetOperationInfo(ev,CATEGORY_DICE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DICE) end
if Duel.GetOperationInfo(ev,CATEGORY_LEAVE_GRAVE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_LEAVE_GRAVE) end
if Duel.GetOperationInfo(ev,CATEGORY_LVCHANGE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_LVCHANGE) end
if Duel.GetOperationInfo(ev,CATEGORY_NEGATE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_NEGATE) end
if Duel.GetOperationInfo(ev,CATEGORY_ANNOUNCE)
then ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_ANNOUNCE) end
if Duel.GetOperationInfo(ev,0)
then ex,tg,tc=Duel.GetOperationInfo(ev,0) end
if Duel.GetOperationInfo(ev,nil)
then ex,tg,tc=Duel.GetOperationInfo(ev,nil) end
return (tg and tg:IsExists(c000000.negfltr,1,nil))
or (ex and tg~=nil and tc+tg:FilterCount(c000000.negfltr,nil)-tg:GetCount()>0)
end