name: Tachyon
card_text: If you control a "Galaxy-Eyes" monster: Activate as Chain Link 2 or higher; negate the activations of your opponent's Spell/Trap Cards and monster effects activated before this card in this Chain, and if you do, shuffle the negated cards on the field into the Deck. If you control a "Galaxy-Eyes Tachyon Dragon" monster, you can activate this card from your hand.
external_ids: local SETCARD_ID_0 = 0x107b --Galaxy-Eyes
  local SETCARD_ID_1 = 0x307b --Galaxy-Eyes
  
lua: local SETCARD_ID_0 = 0x107b --Galaxy-Eyes
  local SETCARD_ID_1 = 0x307b --Galaxy-Eyes
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_TODECK)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--act in hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
  	e2:SetCondition(s.handcon)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) then
  		return false
  	end
  	for i = 1, ev do
  		local te, tgp = Duel.GetChainInfo(i, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  		if tgp ~= tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(i) then
  			return true
  		end
  	end
  	return false
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local ng = Group.CreateGroup()
  	local dg = Group.CreateGroup()
  	for i = 1, ev do
  		local te, tgp = Duel.GetChainInfo(i, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  		if tgp ~= tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(i) then
  			local tc = te:GetHandler()
  			ng:AddCard(tc)
  			if tc:IsOnField() and tc:IsRelateToEffect(te) then
  				dg:AddCard(tc)
  			end
  		end
  	end
  	Duel.SetTargetCard(dg)
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, ng, ng:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, dg, dg:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local dg = Group.CreateGroup()
  	for i = 1, ev do
  		local te, tgp = Duel.GetChainInfo(i, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  		if tgp ~= tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.NegateActivation(i) then
  			local tc = te:GetHandler()
  			if tc:IsRelateToEffect(e) and tc:IsRelateToEffect(te) then
  				dg:AddCard(tc)
  			end
  		end
  	end
  	Duel.SendtoDeck(dg, nil, SEQ_DECKSHUFFLE, REASON_EFFECT, tp, true)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1)
  end
  function s.handcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  
  
source_text: Tachyon
  If you control a "Galaxy-Eyes" monster: Activate as Chain Link 2 or higher; negate the activations of your opponent's Spell/Trap Cards and monster effects activated before this card in this Chain, and if you do, shuffle the negated cards on the field into the Deck. If you control a "Galaxy-Eyes Tachyon Dragon" monster, you can activate this card from your hand.
target_text: -- Tachyon
  local SETCARD_ID_0 = 0x107b --Galaxy-Eyes
  local SETCARD_ID_1 = 0x307b --Galaxy-Eyes
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCategory(CATEGORY_NEGATE + CATEGORY_TODECK)
  	e1:SetCode(EVENT_CHAINING)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	--act in hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetType(EFFECT_TYPE_SINGLE)
  	e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
  	e2:SetCondition(s.handcon)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	if not Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil) then
  		return false
  	end
  	for i = 1, ev do
  		local te, tgp = Duel.GetChainInfo(i, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  		if tgp ~= tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(i) then
  			return true
  		end
  	end
  	return false
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local ng = Group.CreateGroup()
  	local dg = Group.CreateGroup()
  	for i = 1, ev do
  		local te, tgp = Duel.GetChainInfo(i, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  		if tgp ~= tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(i) then
  			local tc = te:GetHandler()
  			ng:AddCard(tc)
  			if tc:IsOnField() and tc:IsRelateToEffect(te) then
  				dg:AddCard(tc)
  			end
  		end
  	end
  	Duel.SetTargetCard(dg)
  	Duel.SetOperationInfo(0, CATEGORY_NEGATE, ng, ng:GetCount(), 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, dg, dg:GetCount(), 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local dg = Group.CreateGroup()
  	for i = 1, ev do
  		local te, tgp = Duel.GetChainInfo(i, CHAININFO_TRIGGERING_EFFECT, CHAININFO_TRIGGERING_PLAYER)
  		if tgp ~= tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.NegateActivation(i) then
  			local tc = te:GetHandler()
  			if tc:IsRelateToEffect(e) and tc:IsRelateToEffect(te) then
  				dg:AddCard(tc)
  			end
  		end
  	end
  	Duel.SendtoDeck(dg, nil, SEQ_DECKSHUFFLE, REASON_EFFECT, tp, true)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_1)
  end
  function s.handcon(e)
  	return Duel.IsExistingMatchingCard(s.filter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 1, nil)
  end
  
  