--高速决斗技能-找回遗失物
Duel.LoadScript("speed_duel_common.lua")
function c100730237.initial_effect(c)
	aux.SpeedDuelAtMainPhase(c,c100730237.operation,c100730237.con,aux.Stringid(100730237,0))
	local e1=Effect.GlobalEffect(c)
	e1:SetCategory(CATEGORY_DRAW)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetOperation(c100730237.operation)
	c:RegisterEffect(e1)
	aux.RegisterSpeedDuelSkillCardCommon()
end
function c100730237.con(e,tp)
	tp=e:GetLabelObject():GetOwner()
	return aux.SpeedDuelAtMainPhaseCondition(e,tp)
		and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,nil)
		and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_GRAVE,0,1,nil,0x12e)
end
function c100730237.operation(e,tp,eg,ep,ev,re,r,rp)
	local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,0,nil)
	local g1=g:Select(tp,1,3,nil)
	if not g1 then return end
	Duel.SendtoGrave(g1,REASON_EFFECT+REASON_DISCARD)
	Duel.Hint(HINT_CARD,1-tp,100730237)
	local ct=g1:GetCount()
	local sg=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_GRAVE,0,ct,nil,0x12e)
	local sc=sg:Select(tp,ct,ct,nil)
	Duel.SendtoDeck(sc,tp,0,REASON_RULE)
	Duel.Draw(tp,ct,REASON_RULE)
	e:Reset()  
end