name: Geonator
card_text: 2 Effect Monsters
  This linked card and monsters it points to cannot be destroyed by your opponent's card effects. If this card points to 2 monsters: You can switch control of those monsters. You can only use this effect of "Geonator Transverser" once per turn.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkType, TYPE_EFFECT), 2, 2)
  	--indestructable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e1:SetTarget(s.indtg)
  	e1:SetValue(aux.indoval)
  	c:RegisterEffect(e1)
  	--swap control
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_CONTROL)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.cttg)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  end
  function s.indtg(e, tc)
  	local c = e:GetHandler()
  	return c:IsLinkState() and tc == c or c:GetLinkedGroup():IsContains(tc)
  end
  function s.ctfilter(c, tp)
  	return c:IsControler(tp) and c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp, c, tp, LOCATION_REASON_CONTROL) > 0
  end
  function s.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = e:GetHandler():GetLinkedGroup()
  	if chk == 0 then
  		return #g == 2 and g:IsExists(s.ctfilter, 1, nil, tp) and g:IsExists(s.ctfilter, 1, nil, 1 - tp)
  	end
  	Duel.SetTargetCard(g)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 2, 0, 0)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	local a = g:GetFirst()
  	local b = g:GetNext()
  	if a and b then
  		Duel.SwapControl(a, b)
  	end
  end
  
  
source_text: Geonator
  2 Effect Monsters
  This linked card and monsters it points to cannot be destroyed by your opponent's card effects. If this card points to 2 monsters: You can switch control of those monsters. You can only use this effect of "Geonator Transverser" once per turn.
target_text: -- Geonator
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--link summon
  	c:EnableReviveLimit()
  	aux.AddLinkProcedure(c, aux.FilterBoolFunction(Card.IsLinkType, TYPE_EFFECT), 2, 2)
  	--indestructable
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
  	e1:SetTarget(s.indtg)
  	e1:SetValue(aux.indoval)
  	c:RegisterEffect(e1)
  	--swap control
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_CONTROL)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.cttg)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  end
  function s.indtg(e, tc)
  	local c = e:GetHandler()
  	return c:IsLinkState() and tc == c or c:GetLinkedGroup():IsContains(tc)
  end
  function s.ctfilter(c, tp)
  	return c:IsControler(tp) and c:IsAbleToChangeControler() and Duel.GetMZoneCount(tp, c, tp, LOCATION_REASON_CONTROL) > 0
  end
  function s.cttg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = e:GetHandler():GetLinkedGroup()
  	if chk == 0 then
  		return #g == 2 and g:IsExists(s.ctfilter, 1, nil, tp) and g:IsExists(s.ctfilter, 1, nil, 1 - tp)
  	end
  	Duel.SetTargetCard(g)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 2, 0, 0)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
  	local a = g:GetFirst()
  	local b = g:GetNext()
  	if a and b then
  		Duel.SwapControl(a, b)
  	end
  end
  
  