name: Speedlift
card_text: If you control exactly 1 Tuner and no other monsters: Special Summon 1 Level 4 or lower "Speedroid" monster from your Deck. Neither player can activate cards or effects when that monster is Special Summoned.
external_ids: local SETCARD_ID_0 = 0x2016 --Speedroid
  
lua: local SETCARD_ID_0 = 0x2016 --Speedroid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetFieldGroup(tp, LOCATION_MZONE, 0)
  	if g:GetCount() ~= 1 then
  		return false
  	end
  	local c = g:GetFirst()
  	return c:IsFaceup() and c:IsType(TYPE_TUNER)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsLevelBelow(4) and 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 Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	local tc = g:GetFirst()
  	if tc then
  		if Duel.GetCurrentChain() == 1 then
  			local e2 = Effect.CreateEffect(e:GetHandler())
  			e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  			e2:SetCode(EVENT_CHAIN_END)
  			e2:SetOperation(s.limitop)
  			e2:SetCountLimit(1)
  			e2:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e2, tp)
  		end
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.limitop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SetChainLimitTillChainEnd(aux.FALSE)
  end
  
  
source_text: Speedlift
  If you control exactly 1 Tuner and no other monsters: Special Summon 1 Level 4 or lower "Speedroid" monster from your Deck. Neither player can activate cards or effects when that monster is Special Summoned.
target_text: -- Speedlift
  local SETCARD_ID_0 = 0x2016 --Speedroid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetFieldGroup(tp, LOCATION_MZONE, 0)
  	if g:GetCount() ~= 1 then
  		return false
  	end
  	local c = g:GetFirst()
  	return c:IsFaceup() and c:IsType(TYPE_TUNER)
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsLevelBelow(4) and 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 Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_DECK, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_DECK, 0, 1, 1, nil, e, tp)
  	local tc = g:GetFirst()
  	if tc then
  		if Duel.GetCurrentChain() == 1 then
  			local e2 = Effect.CreateEffect(e:GetHandler())
  			e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  			e2:SetCode(EVENT_CHAIN_END)
  			e2:SetOperation(s.limitop)
  			e2:SetCountLimit(1)
  			e2:SetReset(RESET_PHASE + PHASE_END)
  			Duel.RegisterEffect(e2, tp)
  		end
  		Duel.SpecialSummon(tc, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  function s.limitop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SetChainLimitTillChainEnd(aux.FALSE)
  end
  
  