Vision
When you activate this card: You can reveal 1 "Blue-Eyes White Dragon" in your hand; Special Summon 1 monster from your hand. Once per turn: You can target 1 face-up monster you control; return that face-up monster to the hand, then you can apply the following effect, based on the original name of the card returned to the hand.
● "Blue-Eyes White Dragon": Special Summon 1 monster from your hand.
● Other: Special Summon 1 "Blue-Eyes" monster from your hand.
You can only activate 1 "Vision with Eyes of Blue" per turn.
local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
local SETCARD_ID_0 = 0xdd --Blue-Eyes

local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
local SETCARD_ID_0 = 0xdd --Blue-Eyes
local s, id, o = GetID()
function s.initial_effect(c)
	aux.AddCodeList(c, CARD_ID_0)
	--activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
	--spsummon
	local e2 = Effect.CreateEffect(c)
	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_SZONE)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetCountLimit(1)
	e2:SetTarget(s.sptg)
	e2:SetOperation(s.spop)
	c:RegisterEffect(e2)
end
function s.showfilter(c)
	return c:IsCode(CARD_ID_0) and not c:IsPublic()
end
function s.spfilter(c, e, tp)
	return c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	if
		Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
		and Duel.IsExistingMatchingCard(s.showfilter, tp, LOCATION_HAND, 0, 1, nil)
		and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
		and Duel.SelectYesNo(tp, aux.Stringid(id, 0))
	then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
		local g = Duel.SelectMatchingCard(tp, s.showfilter, tp, LOCATION_HAND, 0, 1, 1, nil)
		Duel.ConfirmCards(1 - tp, g)
		Duel.ShuffleHand(tp)
		e:SetLabel(1)
		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
	else
		e:SetLabel(0)
		e:SetCategory(0)
	end
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	if e:GetLabel() == 1 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
		if sg:GetCount() > 0 then
			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
		end
	end
end
function s.thfilter(c)
	return c:IsAbleToHand() and c:IsFaceup()
end
function s.spfilter2(c, e, tp)
	return c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and c:IsSetCard(SETCARD_ID_0)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.thfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_MZONE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	local code = tc:GetOriginalCode()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.SendtoHand(tc, nil, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_HAND) then
		local g1 = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND, 0, nil, e, tp)
		if code == CARD_ID_0 and #g1 > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
			Duel.BreakEffect()
			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
			local sg1 = g1:Select(tp, 1, 1, nil)
			Duel.SpecialSummon(sg1, 0, tp, tp, false, false, POS_FACEUP)
		end
		local g2 = Duel.GetMatchingGroup(s.spfilter2, tp, LOCATION_HAND, 0, nil, e, tp)
		if code ~= CARD_ID_0 and #g2 > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
			Duel.BreakEffect()
			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
			local sg2 = g2:Select(tp, 1, 1, nil)
			Duel.SpecialSummon(sg2, 0, tp, tp, false, false, POS_FACEUP)
		end
	end
end


Vision
When you activate this card: You can reveal 1 "Blue-Eyes White Dragon" in your hand; Special Summon 1 monster from your hand. Once per turn: You can target 1 face-up monster you control; return that face-up monster to the hand, then you can apply the following effect, based on the original name of the card returned to the hand.
● "Blue-Eyes White Dragon": Special Summon 1 monster from your hand.
● Other: Special Summon 1 "Blue-Eyes" monster from your hand.
You can only activate 1 "Vision with Eyes of Blue" per turn.
-- Vision
local CARD_ID_0 = 89631139 --Blue-Eyes White Dragon
local SETCARD_ID_0 = 0xdd --Blue-Eyes
local s, id, o = GetID()
function s.initial_effect(c)
	aux.AddCodeList(c, CARD_ID_0)
	--activate
	local e1 = Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
	--spsummon
	local e2 = Effect.CreateEffect(c)
	e2:SetCategory(CATEGORY_TOHAND + CATEGORY_SPECIAL_SUMMON)
	e2:SetType(EFFECT_TYPE_IGNITION)
	e2:SetRange(LOCATION_SZONE)
	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e2:SetCountLimit(1)
	e2:SetTarget(s.sptg)
	e2:SetOperation(s.spop)
	c:RegisterEffect(e2)
end
function s.showfilter(c)
	return c:IsCode(CARD_ID_0) and not c:IsPublic()
end
function s.spfilter(c, e, tp)
	return c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return true
	end
	if
		Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
		and Duel.IsExistingMatchingCard(s.showfilter, tp, LOCATION_HAND, 0, 1, nil)
		and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
		and Duel.SelectYesNo(tp, aux.Stringid(id, 0))
	then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
		local g = Duel.SelectMatchingCard(tp, s.showfilter, tp, LOCATION_HAND, 0, 1, 1, nil)
		Duel.ConfirmCards(1 - tp, g)
		Duel.ShuffleHand(tp)
		e:SetLabel(1)
		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
	else
		e:SetLabel(0)
		e:SetCategory(0)
	end
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	if e:GetLabel() == 1 then
		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
		local sg = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
		if sg:GetCount() > 0 then
			Duel.SpecialSummon(sg, 0, tp, tp, false, false, POS_FACEUP)
		end
	end
end
function s.thfilter(c)
	return c:IsAbleToHand() and c:IsFaceup()
end
function s.spfilter2(c, e, tp)
	return c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and c:IsSetCard(SETCARD_ID_0)
end
function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.thfilter(chkc)
	end
	if chk == 0 then
		return Duel.IsExistingTarget(s.thfilter, tp, LOCATION_MZONE, 0, 1, nil)
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
	local g = Duel.SelectTarget(tp, s.thfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
end
function s.spop(e, tp, eg, ep, ev, re, r, rp)
	local tc = Duel.GetFirstTarget()
	local code = tc:GetOriginalCode()
	if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.SendtoHand(tc, nil, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_HAND) then
		local g1 = Duel.GetMatchingGroup(s.spfilter, tp, LOCATION_HAND, 0, nil, e, tp)
		if code == CARD_ID_0 and #g1 > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
			Duel.BreakEffect()
			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
			local sg1 = g1:Select(tp, 1, 1, nil)
			Duel.SpecialSummon(sg1, 0, tp, tp, false, false, POS_FACEUP)
		end
		local g2 = Duel.GetMatchingGroup(s.spfilter2, tp, LOCATION_HAND, 0, nil, e, tp)
		if code ~= CARD_ID_0 and #g2 > 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
			Duel.BreakEffect()
			Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
			local sg2 = g2:Select(tp, 1, 1, nil)
			Duel.SpecialSummon(sg2, 0, tp, tp, false, false, POS_FACEUP)
		end
	end
end

