name: Wattcancel
card_text: When your opponent would Normal or Special Summon a monster(s): Discard 1 "Watt" monster; negate the Summon, and if you do, destroy that monster(s).
external_ids: local SETCARD_ID_0 = 0xe --Watt
  
lua: local SETCARD_ID_0 = 0xe --Watt
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate(summon)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DISABLE_SUMMON + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SUMMON)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON)
  	c:RegisterEffect(e2)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return aux.NegateSummonCondition() and eg:IsExists(Card.IsControler, 1, nil, 1 - tp)
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if Duel.IsPlayerAffectedByEffect(tp, EFFECT_DISCARD_COST_CHANGE) then
  		return true
  	end
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, s.cfilter, 1, 1, REASON_COST + REASON_DISCARD, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = eg:Filter(Card.IsControler, nil, 1 - tp)
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE_SUMMON, g, g:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = eg:Filter(Card.IsControler, nil, 1 - tp)
  	Duel.NegateSummon(g)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  
source_text: Wattcancel
  When your opponent would Normal or Special Summon a monster(s): Discard 1 "Watt" monster; negate the Summon, and if you do, destroy that monster(s).
target_text: -- Wattcancel
  local SETCARD_ID_0 = 0xe --Watt
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate(summon)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DISABLE_SUMMON + CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SUMMON)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_SPSUMMON)
  	c:RegisterEffect(e2)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return aux.NegateSummonCondition() and eg:IsExists(Card.IsControler, 1, nil, 1 - tp)
  end
  function s.cfilter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if Duel.IsPlayerAffectedByEffect(tp, EFFECT_DISCARD_COST_CHANGE) then
  		return true
  	end
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.DiscardHand(tp, s.cfilter, 1, 1, REASON_COST + REASON_DISCARD, nil)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = eg:Filter(Card.IsControler, nil, 1 - tp)
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE_SUMMON, g, g:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = eg:Filter(Card.IsControler, nil, 1 - tp)
  	Duel.NegateSummon(g)
  	Duel.Destroy(g, REASON_EFFECT)
  end
  
  