name: Golden-Eyes
card_text: Once per turn (Quick Effect): You can activate this effect; look at your opponent's hand, also this card's name becomes "Thousand-Eyes Idol" until the End Phase. If this card is banished, or sent to the GY by card effect: You can target 1 Effect Monster your opponent controls; equip that Effect Monster to 1 "Eyes Restrict" or "Relinquished" monster you control that cannot be Normal Summoned. While equipped by this effect, that monster gains ATK equal to the ATK of the equipped monster. You can only use this effect of "Golden-Eyes Idol" once per turn.
external_ids: local SETCARD_ID_0 = 0x110 --Relinquished
  
lua: local SETCARD_ID_0 = 0x110 --Relinquished
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Change the Name
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetTarget(s.rntg)
  	e1:SetOperation(s.rnop)
  	c:RegisterEffect(e1)
  	--Equip
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_EQUIP)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_REMOVE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.eqtg)
  	e2:SetOperation(s.eqop)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_TO_GRAVE)
  	e3:SetCondition(s.eqcon)
  	c:RegisterEffect(e3)
  end
  function s.rntg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetMatchingGroupCount(aux.NOT(Card.IsPublic), tp, 0, LOCATION_HAND, nil) > 0
  	end
  end
  function s.rnop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(aux.NOT(Card.IsPublic), tp, 0, LOCATION_HAND, nil)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(tp, g)
  		Duel.ShuffleHand(1 - tp)
  		if c:IsFaceup() and c:IsRelateToEffect(e) then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e1:SetCode(EFFECT_CHANGE_CODE)
  			e1:SetValue(27125110)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			c:RegisterEffect(e1)
  		end
  	end
  end
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsReason(REASON_EFFECT)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsAbleToChangeControler()
  end
  function s.eqfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and not c:IsSummonableCard()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil) and Duel.IsExistingMatchingCard(s.eqfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 then
  		return
  	end
  	local tc1 = Duel.GetFirstTarget()
  	if tc1:IsRelateToEffect(e) and tc1:IsAbleToChangeControler() then
  		local atk = tc1:GetTextAttack()
  		if atk < 0 then
  			atk = 0
  		end
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  		local sg = Duel.SelectMatchingCard(tp, s.eqfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  		if sg:GetCount() > 0 then
  			local tc2 = sg:GetFirst()
  			if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2 then
  				Duel.Equip(tp, tc1, tc2, false)
  				--Gains ATK
  				local e1 = Effect.CreateEffect(tc1)
  				e1:SetType(EFFECT_TYPE_EQUIP)
  				e1:SetCode(EFFECT_UPDATE_ATTACK)
  				e1:SetValue(atk)
  				e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  				tc1:RegisterEffect(e1)
  				--Equip Limit
  				local e2 = Effect.CreateEffect(c)
  				e2:SetType(EFFECT_TYPE_SINGLE)
  				e2:SetCode(EFFECT_EQUIP_LIMIT)
  				e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  				e2:SetValue(s.eqlimit)
  				e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  				e2:SetLabelObject(tc2)
  				tc1:RegisterEffect(e2)
  			end
  		end
  	end
  end
  function s.eqlimit(e, c)
  	return c == e:GetLabelObject()
  end
  
  
source_text: Golden-Eyes
  Once per turn (Quick Effect): You can activate this effect; look at your opponent's hand, also this card's name becomes "Thousand-Eyes Idol" until the End Phase. If this card is banished, or sent to the GY by card effect: You can target 1 Effect Monster your opponent controls; equip that Effect Monster to 1 "Eyes Restrict" or "Relinquished" monster you control that cannot be Normal Summoned. While equipped by this effect, that monster gains ATK equal to the ATK of the equipped monster. You can only use this effect of "Golden-Eyes Idol" once per turn.
target_text: -- Golden-Eyes
  local SETCARD_ID_0 = 0x110 --Relinquished
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Change the Name
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_QUICK_O)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1)
  	e1:SetTarget(s.rntg)
  	e1:SetOperation(s.rnop)
  	c:RegisterEffect(e1)
  	--Equip
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_EQUIP)
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
  	e2:SetCode(EVENT_REMOVE)
  	e2:SetCountLimit(1, id)
  	e2:SetTarget(s.eqtg)
  	e2:SetOperation(s.eqop)
  	c:RegisterEffect(e2)
  	local e3 = e2:Clone()
  	e3:SetCode(EVENT_TO_GRAVE)
  	e3:SetCondition(s.eqcon)
  	c:RegisterEffect(e3)
  end
  function s.rntg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetMatchingGroupCount(aux.NOT(Card.IsPublic), tp, 0, LOCATION_HAND, nil) > 0
  	end
  end
  function s.rnop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local g = Duel.GetMatchingGroup(aux.NOT(Card.IsPublic), tp, 0, LOCATION_HAND, nil)
  	if g:GetCount() > 0 then
  		Duel.ConfirmCards(tp, g)
  		Duel.ShuffleHand(1 - tp)
  		if c:IsFaceup() and c:IsRelateToEffect(e) then
  			local e1 = Effect.CreateEffect(c)
  			e1:SetType(EFFECT_TYPE_SINGLE)
  			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  			e1:SetCode(EFFECT_CHANGE_CODE)
  			e1:SetValue(27125110)
  			e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
  			c:RegisterEffect(e1)
  		end
  	end
  end
  function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsReason(REASON_EFFECT)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsAbleToChangeControler()
  end
  function s.eqfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and not c:IsSummonableCard()
  end
  function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, 0, LOCATION_MZONE, 1, nil) and Duel.IsExistingMatchingCard(s.eqfilter, tp, LOCATION_MZONE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
  end
  function s.eqop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if Duel.GetLocationCount(tp, LOCATION_SZONE) <= 0 then
  		return
  	end
  	local tc1 = Duel.GetFirstTarget()
  	if tc1:IsRelateToEffect(e) and tc1:IsAbleToChangeControler() then
  		local atk = tc1:GetTextAttack()
  		if atk < 0 then
  			atk = 0
  		end
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
  		local sg = Duel.SelectMatchingCard(tp, s.eqfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  		if sg:GetCount() > 0 then
  			local tc2 = sg:GetFirst()
  			if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc2 then
  				Duel.Equip(tp, tc1, tc2, false)
  				--Gains ATK
  				local e1 = Effect.CreateEffect(tc1)
  				e1:SetType(EFFECT_TYPE_EQUIP)
  				e1:SetCode(EFFECT_UPDATE_ATTACK)
  				e1:SetValue(atk)
  				e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  				tc1:RegisterEffect(e1)
  				--Equip Limit
  				local e2 = Effect.CreateEffect(c)
  				e2:SetType(EFFECT_TYPE_SINGLE)
  				e2:SetCode(EFFECT_EQUIP_LIMIT)
  				e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  				e2:SetValue(s.eqlimit)
  				e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  				e2:SetLabelObject(tc2)
  				tc1:RegisterEffect(e2)
  			end
  		end
  	end
  end
  function s.eqlimit(e, c)
  	return c == e:GetLabelObject()
  end
  
  