name: Frontier
card_text: Negate any Spell effects that target a Warrior-Type monster you control, and if you do, destroy that card.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--disable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DISABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
  	e1:SetTarget(s.distg)
  	c:RegisterEffect(e1)
  	--disable effect
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  	--self destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_SELF_DESTROY)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
  	e3:SetTarget(s.distg)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c, tp)
  	return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
  end
  function s.distg(e, c)
  	return c:GetCardTargetCount() > 0 and c:IsType(TYPE_SPELL) and c:GetCardTarget():IsExists(s.cfilter, 1, nil, e:GetHandlerPlayer())
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if not re:IsActiveType(TYPE_SPELL) then
  		return
  	end
  	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(s.cfilter, 1, nil, tp) then
  		return
  	end
  	if Duel.NegateEffect(ev, true) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(re:GetHandler(), REASON_EFFECT)
  	end
  end
  
  
source_text: Frontier
  Negate any Spell effects that target a Warrior-Type monster you control, and if you do, destroy that card.
target_text: -- Frontier
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--disable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_DISABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
  	e1:SetTarget(s.distg)
  	c:RegisterEffect(e1)
  	--disable effect
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e2:SetCode(EVENT_CHAIN_SOLVING)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetOperation(s.disop)
  	c:RegisterEffect(e2)
  	--self destroy
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_SELF_DESTROY)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTargetRange(LOCATION_SZONE, LOCATION_SZONE)
  	e3:SetTarget(s.distg)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c, tp)
  	return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
  end
  function s.distg(e, c)
  	return c:GetCardTargetCount() > 0 and c:IsType(TYPE_SPELL) and c:GetCardTarget():IsExists(s.cfilter, 1, nil, e:GetHandlerPlayer())
  end
  function s.disop(e, tp, eg, ep, ev, re, r, rp)
  	if not re:IsActiveType(TYPE_SPELL) then
  		return
  	end
  	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(s.cfilter, 1, nil, tp) then
  		return
  	end
  	if Duel.NegateEffect(ev, true) and re:GetHandler():IsRelateToEffect(re) then
  		Duel.Destroy(re:GetHandler(), REASON_EFFECT)
  	end
  end
  
  