Relinquished
1 Level 1 monster, except a Token
You can target 1 face-up monster this card points to; equip that face-up monster to this card (max. 1). You can only use this effect of "Relinquished Anima" once per turn. This card gains ATK equal to that equipped monster's.
local s, id, o = GetID()
function s.initial_effect(c)
	--link summon
	c:EnableReviveLimit()
	aux.AddLinkProcedure(c, s.matfilter, 1)
	--equip
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_EQUIP)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.eqcon)
	e1:SetTarget(s.eqtg)
	e1:SetOperation(s.eqop)
	c:RegisterEffect(e1)
	--atk
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCode(EFFECT_UPDATE_ATTACK)
	e2:SetCondition(s.adcon)
	e2:SetValue(s.atkval)
	c:RegisterEffect(e2)
end
function s.matfilter(c)
	return c:IsLevel(1) and not c:IsLinkType(TYPE_TOKEN)
end
function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
	return s.can_equip_monster(e:GetHandler())
end
function s.eqfilter(c)
	return c:GetFlagEffect(id) ~= 0
end
function s.can_equip_monster(c)
	local g = c:GetEquipGroup():Filter(s.eqfilter, nil)
	return g:GetCount() == 0
end
function s.eqfilter2(c, tp, lg)
	return c:IsFaceup() and (c:IsAbleToChangeControler() or c:IsControler(tp)) and lg:IsContains(c)
end
function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	local lg = e:GetHandler():GetLinkedGroup()
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and chkc:IsAbleToChangeControler()
	end
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.eqfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, tp, lg)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
	local g = Duel.SelectTarget(tp, s.eqfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, tp, lg)
	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
end
function s.eqlimit(e, c)
	return e:GetOwner() == c
end
function s.equip_monster(c, tp, tc)
	if not Duel.Equip(tp, tc, c, false) then
		return
	end
	--Add Equip limit
	tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
	e1:SetCode(EFFECT_EQUIP_LIMIT)
	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
	e1:SetValue(s.eqlimit)
	tc:RegisterEffect(e1)
end
function s.eqop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local tc = Duel.GetFirstTarget()
	if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
		s.equip_monster(c, tp, tc)
	end
end
function s.adcon(e)
	local c = e:GetHandler()
	local g = c:GetEquipGroup():Filter(s.eqfilter, nil)
	return g:GetCount() > 0
end
function s.atkval(e, c)
	local c = e:GetHandler()
	local g = c:GetEquipGroup():Filter(s.eqfilter, nil)
	local atk = g:GetFirst():GetTextAttack()
	if bit.band(g:GetFirst():GetOriginalType(), TYPE_MONSTER) == 0 or atk < 0 then
		return 0
	else
		return atk
	end
end


Relinquished
1 Level 1 monster, except a Token
You can target 1 face-up monster this card points to; equip that face-up monster to this card (max. 1). You can only use this effect of "Relinquished Anima" once per turn. This card gains ATK equal to that equipped monster's.
-- Relinquished
local s, id, o = GetID()
function s.initial_effect(c)
	--link summon
	c:EnableReviveLimit()
	aux.AddLinkProcedure(c, s.matfilter, 1)
	--equip
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_EQUIP)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCountLimit(1, id)
	e1:SetCondition(s.eqcon)
	e1:SetTarget(s.eqtg)
	e1:SetOperation(s.eqop)
	c:RegisterEffect(e1)
	--atk
	local e2 = Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_SINGLE)
	e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
	e2:SetRange(LOCATION_MZONE)
	e2:SetCode(EFFECT_UPDATE_ATTACK)
	e2:SetCondition(s.adcon)
	e2:SetValue(s.atkval)
	c:RegisterEffect(e2)
end
function s.matfilter(c)
	return c:IsLevel(1) and not c:IsLinkType(TYPE_TOKEN)
end
function s.eqcon(e, tp, eg, ep, ev, re, r, rp)
	return s.can_equip_monster(e:GetHandler())
end
function s.eqfilter(c)
	return c:GetFlagEffect(id) ~= 0
end
function s.can_equip_monster(c)
	local g = c:GetEquipGroup():Filter(s.eqfilter, nil)
	return g:GetCount() == 0
end
function s.eqfilter2(c, tp, lg)
	return c:IsFaceup() and (c:IsAbleToChangeControler() or c:IsControler(tp)) and lg:IsContains(c)
end
function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	local lg = e:GetHandler():GetLinkedGroup()
	if chkc then
		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and chkc:IsAbleToChangeControler()
	end
	if chk == 0 then
		return Duel.GetLocationCount(tp, LOCATION_SZONE) > 0 and Duel.IsExistingTarget(s.eqfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, nil, tp, lg)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
	local g = Duel.SelectTarget(tp, s.eqfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, nil, tp, lg)
	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
end
function s.eqlimit(e, c)
	return e:GetOwner() == c
end
function s.equip_monster(c, tp, tc)
	if not Duel.Equip(tp, tc, c, false) then
		return
	end
	--Add Equip limit
	tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 0)
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
	e1:SetCode(EFFECT_EQUIP_LIMIT)
	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
	e1:SetValue(s.eqlimit)
	tc:RegisterEffect(e1)
end
function s.eqop(e, tp, eg, ep, ev, re, r, rp)
	local c = e:GetHandler()
	local tc = Duel.GetFirstTarget()
	if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) then
		s.equip_monster(c, tp, tc)
	end
end
function s.adcon(e)
	local c = e:GetHandler()
	local g = c:GetEquipGroup():Filter(s.eqfilter, nil)
	return g:GetCount() > 0
end
function s.atkval(e, c)
	local c = e:GetHandler()
	local g = c:GetEquipGroup():Filter(s.eqfilter, nil)
	local atk = g:GetFirst():GetTextAttack()
	if bit.band(g:GetFirst():GetOriginalType(), TYPE_MONSTER) == 0 or atk < 0 then
		return 0
	else
		return atk
	end
end

