U.A.
(This card is always treated as a "F.A." card.)
Target 1 "U.A." or "F.A." monster you control or in your GY; add it to the hand, and if you do, you gain 500 LP, then you can apply this effect.
● Reveal any number of "U.A." and/or "F.A." monsters in your hand, shuffle them into the Deck, then draw cards equal to the number of shuffled cards.
You can only activate 1 "U.A. Locker Room" per turn.
local SETCARD_ID_0 = 0xb2 --U.A.

local SETCARD_ID_0 = 0xb2 --U.A.
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_RECOVER + CATEGORY_DRAW)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.filter(c)
	return c:IsSetCard(SETCARD_ID_0, 0x107) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE + LOCATION_GRAVE) and s.filter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
	Duel.SetTargetParam(500)
	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 500)
end
function s.cfilter(c)
	return c:IsSetCard(SETCARD_ID_0, 0x107) and c:IsType(TYPE_MONSTER) and not c:IsPublic() and c:IsAbleToDeck()
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if not tc:IsRelateToEffect(e) then
		return
	end
	if Duel.SendtoHand(tc, nil, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_HAND) then
		local d = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
		if Duel.Recover(tp, d, REASON_EFFECT) <= 0 then
			return
		end
		local tg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_HAND, 0, nil)
		if #tg <= 0 or not Duel.IsPlayerCanDraw(tp) or not Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
			return
		end
		Duel.BreakEffect()
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
		local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 63, nil)
		if g:GetCount() == 0 then
			return
		end
		Duel.ConfirmCards(1 - tp, g)
		local ct = Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
		Duel.ShuffleDeck(tp)
		if ct > 0 then
			Duel.BreakEffect()
			Duel.Draw(tp, ct, REASON_EFFECT)
		end
	end
end


U.A.
(This card is always treated as a "F.A." card.)
Target 1 "U.A." or "F.A." monster you control or in your GY; add it to the hand, and if you do, you gain 500 LP, then you can apply this effect.
● Reveal any number of "U.A." and/or "F.A." monsters in your hand, shuffle them into the Deck, then draw cards equal to the number of shuffled cards.
You can only activate 1 "U.A. Locker Room" per turn.
-- U.A.
local SETCARD_ID_0 = 0xb2 --U.A.
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_RECOVER + CATEGORY_DRAW)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.filter(c)
	return c:IsSetCard(SETCARD_ID_0, 0x107) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE + LOCATION_GRAVE) and s.filter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.filter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_MZONE + LOCATION_GRAVE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
	Duel.SetTargetParam(500)
	Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 500)
end
function s.cfilter(c)
	return c:IsSetCard(SETCARD_ID_0, 0x107) and c:IsType(TYPE_MONSTER) and not c:IsPublic() and c:IsAbleToDeck()
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if not tc:IsRelateToEffect(e) then
		return
	end
	if Duel.SendtoHand(tc, nil, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_HAND) then
		local d = Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM)
		if Duel.Recover(tp, d, REASON_EFFECT) <= 0 then
			return
		end
		local tg = Duel.GetMatchingGroup(s.cfilter, tp, LOCATION_HAND, 0, nil)
		if #tg <= 0 or not Duel.IsPlayerCanDraw(tp) or not Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
			return
		end
		Duel.BreakEffect()
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
		local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 63, nil)
		if g:GetCount() == 0 then
			return
		end
		Duel.ConfirmCards(1 - tp, g)
		local ct = Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
		Duel.ShuffleDeck(tp)
		if ct > 0 then
			Duel.BreakEffect()
			Duel.Draw(tp, ct, REASON_EFFECT)
		end
	end
end

