name: Cynet
card_text: When a Spell/Trap Card, or monster effect, is activated while you control a "Code Talker" monster: Negate the activation, and if you do, banish that card, and if you do, your opponent cannot activate cards, or effects of cards, with the same original name as that card that was banished, until the end of the next turn. You can only activate 1 "Cynet Conflict" per turn.
external_ids: local SETCARD_ID_0 = 0x101 --code
  
lua: local SETCARD_ID_0 = 0x101 --code
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(aux.nbtg)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = re:GetHandler()
  	if Duel.NegateActivation(ev) and tc:IsRelateToEffect(re) and Duel.Remove(eg, POS_FACEUP, REASON_EFFECT) ~= 0 and tc:IsLocation(LOCATION_REMOVED) and not tc:IsReason(REASON_REDIRECT) then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e1:SetTargetRange(0, 1)
  		e1:SetValue(s.aclimit)
  		e1:SetLabelObject(tc)
  		e1:SetReset(RESET_PHASE + PHASE_END, 2)
  		Duel.RegisterEffect(e1, tp)
  	end
  end
  function s.aclimit(e, re, tp)
  	local c = re:GetHandler()
  	local tc = e:GetLabelObject()
  	return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
  end
  
  
source_text: Cynet
  When a Spell/Trap Card, or monster effect, is activated while you control a "Code Talker" monster: Negate the activation, and if you do, banish that card, and if you do, your opponent cannot activate cards, or effects of cards, with the same original name as that card that was banished, until the end of the next turn. You can only activate 1 "Cynet Conflict" per turn.
target_text: -- Cynet
  local SETCARD_ID_0 = 0x101 --code
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(aux.nbtg)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = re:GetHandler()
  	if Duel.NegateActivation(ev) and tc:IsRelateToEffect(re) and Duel.Remove(eg, POS_FACEUP, REASON_EFFECT) ~= 0 and tc:IsLocation(LOCATION_REMOVED) and not tc:IsReason(REASON_REDIRECT) then
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_FIELD)
  		e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  		e1:SetCode(EFFECT_CANNOT_ACTIVATE)
  		e1:SetTargetRange(0, 1)
  		e1:SetValue(s.aclimit)
  		e1:SetLabelObject(tc)
  		e1:SetReset(RESET_PHASE + PHASE_END, 2)
  		Duel.RegisterEffect(e1, tp)
  	end
  end
  function s.aclimit(e, re, tp)
  	local c = re:GetHandler()
  	local tc = e:GetLabelObject()
  	return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
  end
  
  