name: Speedroid
card_text: When this card is Normal Summoned: You can target 1 Tuner monster in either player's Graveyard; Special Summon it to your side of the field, and if you do, immediately after this effect resolves, Synchro Summon 1 WIND Synchro Monster, using that monster and this card only.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c, e, tp, mc)
  	local mg = Group.FromCards(c, mc)
  	return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and Duel.IsExistingMatchingCard(s.scfilter, tp, LOCATION_EXTRA, 0, 1, nil, mg)
  end
  function s.scfilter(c, mg)
  	return c:IsAttribute(ATTRIBUTE_WIND) and c:IsSynchroSummonable(nil, mg)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc, e, tp, e:GetHandler())
  	end
  	if chk == 0 then
  		return Duel.IsPlayerCanSpecialSummonCount(tp, 2)
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, LOCATION_GRAVE, 1, nil, e, tp, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, LOCATION_GRAVE, 1, 1, nil, e, tp, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 1 then
  		return
  	end
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) or Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP) == 0 then
  		return
  	end
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	local mg = Group.FromCards(c, tc)
  	local g = Duel.GetMatchingGroup(s.scfilter, tp, LOCATION_EXTRA, 0, nil, mg)
  	if g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SynchroSummon(tp, sg:GetFirst(), nil, mg)
  	end
  end
  
  
source_text: Speedroid
  When this card is Normal Summoned: You can target 1 Tuner monster in either player's Graveyard; Special Summon it to your side of the field, and if you do, immediately after this effect resolves, Synchro Summon 1 WIND Synchro Monster, using that monster and this card only.
target_text: -- Speedroid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.filter(c, e, tp, mc)
  	local mg = Group.FromCards(c, mc)
  	return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false) and Duel.IsExistingMatchingCard(s.scfilter, tp, LOCATION_EXTRA, 0, 1, nil, mg)
  end
  function s.scfilter(c, mg)
  	return c:IsAttribute(ATTRIBUTE_WIND) and c:IsSynchroSummonable(nil, mg)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc, e, tp, e:GetHandler())
  	end
  	if chk == 0 then
  		return Duel.IsPlayerCanSpecialSummonCount(tp, 2)
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, LOCATION_GRAVE, 1, nil, e, tp, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, LOCATION_GRAVE, 1, 1, nil, e, tp, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g, 1, 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) < 1 then
  		return
  	end
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) or Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP) == 0 then
  		return
  	end
  	if not c:IsRelateToEffect(e) then
  		return
  	end
  	local mg = Group.FromCards(c, tc)
  	local g = Duel.GetMatchingGroup(s.scfilter, tp, LOCATION_EXTRA, 0, nil, mg)
  	if g:GetCount() > 0 then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local sg = g:Select(tp, 1, 1, nil)
  		Duel.SynchroSummon(tp, sg:GetFirst(), nil, mg)
  	end
  end
  
  