name: Magician's
card_text: Negate the effect of your opponent's first Trap Card or effect that resolves each turn while you control a Spellcaster monster, and if you do, destroy that card.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--negate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.negcon)
  	e2:SetOperation(s.negop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and rp == 1 - tp and re:IsActiveType(TYPE_TRAP)
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_CARD, 0, id)
  	local rc = re:GetHandler()
  	if Duel.NegateEffect(ev, true) and rc:IsRelateToEffect(re) then
  		Duel.Destroy(rc, REASON_EFFECT)
  	end
  end
  
  
source_text: Magician's
  Negate the effect of your opponent's first Trap Card or effect that resolves each turn while you control a Spellcaster monster, and if you do, destroy that card.
target_text: -- Magician's
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	c:RegisterEffect(e1)
  	--negate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCountLimit(1)
  	e2:SetCondition(s.negcon)
  	e2:SetOperation(s.negop)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_SPELLCASTER)
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and rp == 1 - tp and re:IsActiveType(TYPE_TRAP)
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_CARD, 0, id)
  	local rc = re:GetHandler()
  	if Duel.NegateEffect(ev, true) and rc:IsRelateToEffect(re) then
  		Duel.Destroy(rc, REASON_EFFECT)
  	end
  end
  
  