Deep
You can discard this card and 1 WATER monster; look at your opponent's hand and banish 1 card from their hand face-up, until the End Phase. If this card is Special Summoned: You can send the top 3 cards of your Deck to the GY, then target 1 Level 4 or lower WATER monster in your GY, except "Deep Sea Minstrel"; place it on the top or bottom of the Deck. You can only use each effect of "Deep Sea Minstrel" once per turn.
local s, id, o = GetID()
function s.initial_effect(c)
	--remove
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_REMOVE)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id)
	e1:SetCost(s.rmcost)
	e1:SetTarget(s.rmtg)
	e1:SetOperation(s.rmop)
	c:RegisterEffect(e1)
	--to deck
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_TODECK)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
	e2:SetCountLimit(1, id + 1)
	e2:SetCost(s.tdcost)
	e2:SetTarget(s.tdtg)
	e2:SetOperation(s.tdop)
	c:RegisterEffect(e2)
end
function s.costfilter(c)
	return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable()
end
function s.rmcost(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, c)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND, 0, 1, 1, c)
	g:AddCard(c)
	Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
end
function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_HAND, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 1 - tp, LOCATION_HAND)
end
function s.rmop(e, tp, eg, ep, ev, re, r, rp)
	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_HAND, nil)
	if g:GetCount() == 0 then
		return
	end
	Duel.ConfirmCards(tp, g)
	local g1 = g:Filter(Card.IsAbleToRemove, nil)
	if g1:GetCount() == 0 then
		Duel.ShuffleHand(1 - tp)
		return
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
	local tc = g1:Select(tp, 1, 1, nil):GetFirst()
	Duel.Remove(tc, POS_FACEUP, REASON_EFFECT)
	Duel.ShuffleHand(1 - tp)
	local c = e:GetHandler()
	local fid = c:GetFieldID()
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e1:SetCode(EVENT_PHASE + PHASE_END)
	e1:SetCountLimit(1)
	e1:SetLabel(fid)
	e1:SetLabelObject(tc)
	e1:SetCondition(s.retcon)
	e1:SetOperation(s.retop)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
	tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1, fid)
end
function s.retcon(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	if tc:GetFlagEffectLabel(id) == e:GetLabel() then
		return true
	else
		e:Reset()
		return false
	end
end
function s.retop(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	Duel.SendtoHand(tc, nil, REASON_EFFECT)
end
function s.tdcost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsPlayerCanDiscardDeckAsCost(tp, 3)
	end
	Duel.DiscardDeck(tp, 3, REASON_COST)
end
function s.tdfilter(c)
	return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(id) and c:IsAbleToDeck()
end
function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_GRAVE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
	local g = Duel.SelectTarget(tp, s.tdfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, 1, 0, 0)
end
function s.tdop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) then
		if tc:IsExtraDeckMonster() or Duel.SelectOption(tp, aux.Stringid(id, 2), aux.Stringid(id, 3)) == 0 then
			Duel.SendtoDeck(tc, nil, SEQ_DECKTOP, REASON_EFFECT)
		else
			Duel.SendtoDeck(tc, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
		end
	end
end


Deep
You can discard this card and 1 WATER monster; look at your opponent's hand and banish 1 card from their hand face-up, until the End Phase. If this card is Special Summoned: You can send the top 3 cards of your Deck to the GY, then target 1 Level 4 or lower WATER monster in your GY, except "Deep Sea Minstrel"; place it on the top or bottom of the Deck. You can only use each effect of "Deep Sea Minstrel" once per turn.
-- Deep
local s, id, o = GetID()
function s.initial_effect(c)
	--remove
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_REMOVE)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_HAND)
	e1:SetCountLimit(1, id)
	e1:SetCost(s.rmcost)
	e1:SetTarget(s.rmtg)
	e1:SetOperation(s.rmop)
	c:RegisterEffect(e1)
	--to deck
	local e2 = Effect.CreateEffect(c)
	e2:SetDescription(aux.Stringid(id, 1))
	e2:SetCategory(CATEGORY_TODECK)
	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET + EFFECT_FLAG_DELAY)
	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
	e2:SetCountLimit(1, id + 1)
	e2:SetCost(s.tdcost)
	e2:SetTarget(s.tdtg)
	e2:SetOperation(s.tdop)
	c:RegisterEffect(e2)
end
function s.costfilter(c)
	return c:IsAttribute(ATTRIBUTE_WATER) and c:IsDiscardable()
end
function s.rmcost(e, tp, eg, ep, ev, re, r, rp, chk)
	local c = e:GetHandler()
	if chk == 0 then
		return c:IsDiscardable() and Duel.IsExistingMatchingCard(s.costfilter, tp, LOCATION_HAND, 0, 1, c)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_DISCARD)
	local g = Duel.SelectMatchingCard(tp, s.costfilter, tp, LOCATION_HAND, 0, 1, 1, c)
	g:AddCard(c)
	Duel.SendtoGrave(g, REASON_COST + REASON_DISCARD)
end
function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_HAND, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 1 - tp, LOCATION_HAND)
end
function s.rmop(e, tp, eg, ep, ev, re, r, rp)
	local g = Duel.GetMatchingGroup(aux.TRUE, tp, 0, LOCATION_HAND, nil)
	if g:GetCount() == 0 then
		return
	end
	Duel.ConfirmCards(tp, g)
	local g1 = g:Filter(Card.IsAbleToRemove, nil)
	if g1:GetCount() == 0 then
		Duel.ShuffleHand(1 - tp)
		return
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
	local tc = g1:Select(tp, 1, 1, nil):GetFirst()
	Duel.Remove(tc, POS_FACEUP, REASON_EFFECT)
	Duel.ShuffleHand(1 - tp)
	local c = e:GetHandler()
	local fid = c:GetFieldID()
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
	e1:SetCode(EVENT_PHASE + PHASE_END)
	e1:SetCountLimit(1)
	e1:SetLabel(fid)
	e1:SetLabelObject(tc)
	e1:SetCondition(s.retcon)
	e1:SetOperation(s.retop)
	e1:SetReset(RESET_PHASE + PHASE_END)
	Duel.RegisterEffect(e1, tp)
	tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1, fid)
end
function s.retcon(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	if tc:GetFlagEffectLabel(id) == e:GetLabel() then
		return true
	else
		e:Reset()
		return false
	end
end
function s.retop(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	Duel.SendtoHand(tc, nil, REASON_EFFECT)
end
function s.tdcost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsPlayerCanDiscardDeckAsCost(tp, 3)
	end
	Duel.DiscardDeck(tp, 3, REASON_COST)
end
function s.tdfilter(c)
	return c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_WATER) and not c:IsCode(id) and c:IsAbleToDeck()
end
function s.tdtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.tdfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_GRAVE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
	local g = Duel.SelectTarget(tp, s.tdfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, 1, 0, 0)
end
function s.tdop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	if tc:IsRelateToEffect(e) then
		if tc:IsExtraDeckMonster() or Duel.SelectOption(tp, aux.Stringid(id, 2), aux.Stringid(id, 3)) == 0 then
			Duel.SendtoDeck(tc, nil, SEQ_DECKTOP, REASON_EFFECT)
		else
			Duel.SendtoDeck(tc, nil, SEQ_DECKBOTTOM, REASON_EFFECT)
		end
	end
end

