name: Toon
card_text: When a Spell/Trap Card, or monster effect, is activated, while you control both "Toon World" and a Toon monster(s): Negate the activation, and if you do, destroy that card. You can only activate 1 "Toon Terror" per turn.
external_ids: local CARD_ID_0 = 15259703 --Toon World
  
lua: local CARD_ID_0 = 15259703 --Toon World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.cfilter2(c)
  	return c:IsFaceup() and c:IsType(TYPE_TOON)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
  		and Duel.IsChainNegatable(ev)
  		and Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_ONFIELD, 0, 1, nil)
  		and Duel.IsExistingMatchingCard(s.cfilter2, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  
  
source_text: Toon
  When a Spell/Trap Card, or monster effect, is activated, while you control both "Toon World" and a Toon monster(s): Negate the activation, and if you do, destroy that card. You can only activate 1 "Toon Terror" per turn.
target_text: -- Toon
  local CARD_ID_0 = 15259703 --Toon World
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter1(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_0)
  end
  function s.cfilter2(c)
  	return c:IsFaceup() and c:IsType(TYPE_TOON)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
  		and Duel.IsChainNegatable(ev)
  		and Duel.IsExistingMatchingCard(s.cfilter1, tp, LOCATION_ONFIELD, 0, 1, nil)
  		and Duel.IsExistingMatchingCard(s.cfilter2, tp, LOCATION_MZONE, 0, 1, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, eg, 1, 0, 0)
  	if re:GetHandler():IsRelateToEffect(re) and re:GetHandler():IsDestructable() then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, eg, 1, 0, 0)
  	end
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  
  