Amazement
When this card is Normal Summoned: You can Set 1 "Attraction" Trap directly from your Deck. (Quick Effect): You can target 1 of your "Attraction" Traps equipped to a monster; equip it to 1 "Amazement" monster you control or 1 face-up monster your opponent controls. You can only use this effect of "Amazement Attendant Comica" once per turn.
local SETCARD_ID_0 = 0x15b --Amazement
local SETCARD_ID_1 = 0x15c --Attraction

local SETCARD_ID_0 = 0x15b --Amazement
local SETCARD_ID_1 = 0x15c --Attraction
local s, id, o = GetID()
function s.initial_effect(c)
	--set
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetTarget(s.settg)
	e1:SetOperation(s.setop)
	c:RegisterEffect(e1)
	--equip change
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetType(EFFECT_TYPE_QUICK_O)
	e2:SetCode(EVENT_FREE_CHAIN)
	e2:SetRange(LOCATION_MZONE)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetCountLimit(1, id)
	e2:SetTarget(s.eqtg)
	e2:SetOperation(s.eqop)
	c:RegisterEffect(e2)
end
function s.setfilter(c)
	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.setfilter, tp, LOCATION_DECK, 0, 1, nil)
	end
end
function s.setop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
	local tc = Duel.SelectMatchingCard(tp, s.setfilter, tp, LOCATION_DECK, 0, 1, 1, nil):GetFirst()
	if tc then
		Duel.SSet(tp, tc)
	end
end
function s.eqfilter1(c, tp)
	return c:IsSetCard(SETCARD_ID_1)
		and c:IsType(TYPE_TRAP)
		and c:IsFaceup()
		and c:GetEquipTarget()
		and Duel.IsExistingMatchingCard(s.eqfilter2, 0, LOCATION_MZONE, LOCATION_MZONE, 1, c:GetEquipTarget(), tp)
end
function s.eqfilter2(c, tp)
	return c:IsFaceup() and (c:IsSetCard(SETCARD_ID_1) or not c:IsControler(tp))
end
function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and s.eqfilter1(chkc, tp)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.eqfilter1, tp, LOCATION_SZONE, 0, 1, nil, tp)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
	local g = Duel.SelectTarget(tp, s.eqfilter1, tp, LOCATION_SZONE, 0, 1, 1, nil, tp)
	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
end
function s.eqop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
		local g = Duel.SelectMatchingCard(tp, s.eqfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, tc:GetEquipTarget(), tp)
		local ec = g:GetFirst()
		if ec then
			Duel.HintSelection(g)
			Duel.Equip(tp, tc, ec)
			local e1 = Effect.CreateEffect(e:GetHandler())
			e1:SetType(EFFECT_TYPE_SINGLE)
			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
			e1:SetCode(EFFECT_EQUIP_LIMIT)
			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
			e1:SetValue(s.eqlimit)
			e1:SetLabelObject(ec)
			tc:RegisterEffect(e1)
		end
	end
end
function s.eqlimit(e, c)
	return c == e:GetLabelObject()
end


Amazement
When this card is Normal Summoned: You can Set 1 "Attraction" Trap directly from your Deck. (Quick Effect): You can target 1 of your "Attraction" Traps equipped to a monster; equip it to 1 "Amazement" monster you control or 1 face-up monster your opponent controls. You can only use this effect of "Amazement Attendant Comica" once per turn.
-- Amazement
local SETCARD_ID_0 = 0x15b --Amazement
local SETCARD_ID_1 = 0x15c --Attraction
local s, id, o = GetID()
function s.initial_effect(c)
	--set
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetTarget(s.settg)
	e1:SetOperation(s.setop)
	c:RegisterEffect(e1)
	--equip change
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetType(EFFECT_TYPE_QUICK_O)
	e2:SetCode(EVENT_FREE_CHAIN)
	e2:SetRange(LOCATION_MZONE)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetCountLimit(1, id)
	e2:SetTarget(s.eqtg)
	e2:SetOperation(s.eqop)
	c:RegisterEffect(e2)
end
function s.setfilter(c)
	return c:IsSetCard(SETCARD_ID_1) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end
function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.setfilter, tp, LOCATION_DECK, 0, 1, nil)
	end
end
function s.setop(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SET)
	local tc = Duel.SelectMatchingCard(tp, s.setfilter, tp, LOCATION_DECK, 0, 1, 1, nil):GetFirst()
	if tc then
		Duel.SSet(tp, tc)
	end
end
function s.eqfilter1(c, tp)
	return c:IsSetCard(SETCARD_ID_1)
		and c:IsType(TYPE_TRAP)
		and c:IsFaceup()
		and c:GetEquipTarget()
		and Duel.IsExistingMatchingCard(s.eqfilter2, 0, LOCATION_MZONE, LOCATION_MZONE, 1, c:GetEquipTarget(), tp)
end
function s.eqfilter2(c, tp)
	return c:IsFaceup() and (c:IsSetCard(SETCARD_ID_1) or not c:IsControler(tp))
end
function s.eqtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and s.eqfilter1(chkc, tp)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.eqfilter1, tp, LOCATION_SZONE, 0, 1, nil, tp)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TARGET)
	local g = Duel.SelectTarget(tp, s.eqfilter1, tp, LOCATION_SZONE, 0, 1, 1, nil, tp)
	Duel.SetOperationInfo(0, CATEGORY_EQUIP, g, 1, 0, 0)
end
function s.eqop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_EQUIP)
		local g = Duel.SelectMatchingCard(tp, s.eqfilter2, tp, LOCATION_MZONE, LOCATION_MZONE, 1, 1, tc:GetEquipTarget(), tp)
		local ec = g:GetFirst()
		if ec then
			Duel.HintSelection(g)
			Duel.Equip(tp, tc, ec)
			local e1 = Effect.CreateEffect(e:GetHandler())
			e1:SetType(EFFECT_TYPE_SINGLE)
			e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
			e1:SetCode(EFFECT_EQUIP_LIMIT)
			e1:SetReset(RESET_EVENT + RESETS_STANDARD)
			e1:SetValue(s.eqlimit)
			e1:SetLabelObject(ec)
			tc:RegisterEffect(e1)
		end
	end
end
function s.eqlimit(e, c)
	return c == e:GetLabelObject()
end

