Phantom
2 Level 9 monsters
Once per turn: You can detach 1 material from this card, then activate 1 of these effects;
● Banish 1 card your opponent controls.
● Banish 1 random card from your opponent's hand.
● Banish 1 card from your opponent's GY.
● Banish the top card of your opponent's Deck, face-up.
local s, id, o = GetID()
function s.initial_effect(c)
	--xyz summon
	aux.AddXyzProcedure(c, nil, 9, 2)
	c:EnableReviveLimit()
	--remove
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_REMOVE)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCountLimit(1)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
	end
	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD + LOCATION_HAND + LOCATION_GRAVE + LOCATION_DECK, 1, nil)
	end
	local b1 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, 1, nil)
	local b2 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_HAND, 1, nil)
	local b3 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, nil)
	local b4 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_DECK, 1, nil)
	local op = aux.SelectFromOptions(tp, { b1, aux.Stringid(id, 1) }, { b2, aux.Stringid(id, 2) }, { b3, aux.Stringid(id, 3) }, { b4, aux.Stringid(id, 4) })
	e:SetLabel(op)
	local oploc = ({ LOCATION_ONFIELD, LOCATION_HAND, LOCATION_GRAVE, LOCATION_DECK })[op]
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 1 - tp, oploc)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local op = e:GetLabel()
	if op == 1 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
		if g:GetCount() > 0 then
			Duel.HintSelection(g)
			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
		end
	elseif op == 2 then
		local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, 0, LOCATION_HAND, nil)
		if g:GetCount() > 0 then
			local sg = g:RandomSelect(tp, 1)
			Duel.Remove(sg, POS_FACEUP, REASON_EFFECT)
		end
	elseif op == 3 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, 1, nil)
		if g:GetCount() > 0 then
			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
		end
	elseif op == 4 then
		local g = Duel.GetDecktopGroup(1 - tp, 1)
		if g:GetCount() > 0 then
			Duel.DisableShuffleCheck()
			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
		end
	end
end


Phantom
2 Level 9 monsters
Once per turn: You can detach 1 material from this card, then activate 1 of these effects;
● Banish 1 card your opponent controls.
● Banish 1 random card from your opponent's hand.
● Banish 1 card from your opponent's GY.
● Banish the top card of your opponent's Deck, face-up.
-- Phantom
local s, id, o = GetID()
function s.initial_effect(c)
	--xyz summon
	aux.AddXyzProcedure(c, nil, 9, 2)
	c:EnableReviveLimit()
	--remove
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_REMOVE)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCountLimit(1)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
	end
	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD + LOCATION_HAND + LOCATION_GRAVE + LOCATION_DECK, 1, nil)
	end
	local b1 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, 1, nil)
	local b2 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_HAND, 1, nil)
	local b3 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, nil)
	local b4 = Duel.IsExistingMatchingCard(Card.IsAbleToRemove, tp, 0, LOCATION_DECK, 1, nil)
	local op = aux.SelectFromOptions(tp, { b1, aux.Stringid(id, 1) }, { b2, aux.Stringid(id, 2) }, { b3, aux.Stringid(id, 3) }, { b4, aux.Stringid(id, 4) })
	e:SetLabel(op)
	local oploc = ({ LOCATION_ONFIELD, LOCATION_HAND, LOCATION_GRAVE, LOCATION_DECK })[op]
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, nil, 1, 1 - tp, oploc)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local op = e:GetLabel()
	if op == 1 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
		if g:GetCount() > 0 then
			Duel.HintSelection(g)
			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
		end
	elseif op == 2 then
		local g = Duel.GetMatchingGroup(Card.IsAbleToRemove, tp, 0, LOCATION_HAND, nil)
		if g:GetCount() > 0 then
			local sg = g:RandomSelect(tp, 1)
			Duel.Remove(sg, POS_FACEUP, REASON_EFFECT)
		end
	elseif op == 3 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
		local g = Duel.SelectMatchingCard(tp, Card.IsAbleToRemove, tp, 0, LOCATION_GRAVE, 1, 1, nil)
		if g:GetCount() > 0 then
			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
		end
	elseif op == 4 then
		local g = Duel.GetDecktopGroup(1 - tp, 1)
		if g:GetCount() > 0 then
			Duel.DisableShuffleCheck()
			Duel.Remove(g, POS_FACEUP, REASON_EFFECT)
		end
	end
end

