name: Spellbreaker
card_text: Once per turn: You can send 1 "Ice Barrier" monster from your hand to the GY; neither player can activate Spell Cards until the end of your next turn, while this monster is face-up on the field.
external_ids: local CARD_ID_0 = 18319762 --Revealer of the Ice Barrier
  local SETCARD_ID_0 = 0x2f --Ice
  
lua: local CARD_ID_0 = 18319762 --Revealer of the Ice Barrier
  local SETCARD_ID_0 = 0x2f --Ice
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--act limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.cost)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, e, tp)
  	if c:IsLocation(LOCATION_HAND) then
  		return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
  	else
  		return e:GetHandler():IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove() and c:IsHasEffect(CARD_ID_0, tp)
  	end
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	local tc = g:GetFirst()
  	local te = tc:IsHasEffect(CARD_ID_0, tp)
  	if te then
  		te:UseCountLimit(tp)
  		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT + REASON_REPLACE)
  	else
  		Duel.SendtoGrave(tc, REASON_COST)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFacedown() or not c:IsRelateToEffect(e) then
  		return
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(1, 1)
  	e1:SetValue(s.tgval)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 3)
  	c:RegisterEffect(e1)
  end
  function s.tgval(e, re, rp)
  	return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  
  
source_text: Spellbreaker
  Once per turn: You can send 1 "Ice Barrier" monster from your hand to the GY; neither player can activate Spell Cards until the end of your next turn, while this monster is face-up on the field.
target_text: -- Spellbreaker
  local CARD_ID_0 = 18319762 --Revealer of the Ice Barrier
  local SETCARD_ID_0 = 0x2f --Ice
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--act limit
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetCost(s.cost)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c, e, tp)
  	if c:IsLocation(LOCATION_HAND) then
  		return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
  	else
  		return e:GetHandler():IsSetCard(SETCARD_ID_0) and c:IsAbleToRemove() and c:IsHasEffect(CARD_ID_0, tp)
  	end
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND + LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	local tc = g:GetFirst()
  	local te = tc:IsHasEffect(CARD_ID_0, tp)
  	if te then
  		te:UseCountLimit(tp)
  		Duel.Remove(tc, POS_FACEUP, REASON_EFFECT + REASON_REPLACE)
  	else
  		Duel.SendtoGrave(tc, REASON_COST)
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsFacedown() or not c:IsRelateToEffect(e) then
  		return
  	end
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(1, 1)
  	e1:SetValue(s.tgval)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 3)
  	c:RegisterEffect(e1)
  end
  function s.tgval(e, re, rp)
  	return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
  end
  
  