name: Speedroid
card_text: If this card is sent to the GY as Synchro Material: You can Special Summon 1 "Speedroid Token" (Machine/WIND/ATK 0/DEF 0) with a Level equal to the original Level of the Synchro Monster that used this card as material. You can only use this effect of "Speedroid Block-n-Roll" once per turn.
external_ids: local CARD_ID_0 = 69550260 --Speedroid Token
  local SETCARD_ID_0 = 0x2016 --Speedroid
  
lua: local CARD_ID_0 = 69550260 --Speedroid Token
  local SETCARD_ID_0 = 0x2016 --Speedroid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BE_MATERIAL)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	aux.CreateMaterialReasonCardRelation(c, e1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and r == REASON_SYNCHRO
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local rc = e:GetHandler():GetReasonCard()
  	local lv = rc:GetOriginalLevel()
  	if chk == 0 then
  		return rc:IsRelateToEffect(e)
  			and rc:IsFaceup()
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, lv, RACE_MACHINE, ATTRIBUTE_WIND)
  	end
  	Duel.SetTargetCard(rc)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local rc = Duel.GetFirstTarget()
  	if not rc:IsRelateToChain() or rc:IsFacedown() then
  		return
  	end
  	local lv = rc:GetOriginalLevel()
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	if Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, lv, RACE_MACHINE, ATTRIBUTE_WIND) then
  		local token = Duel.CreateToken(tp, id + 1)
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_LEVEL)
  		e1:SetValue(lv)
  		token:RegisterEffect(e1)
  		Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Speedroid
  If this card is sent to the GY as Synchro Material: You can Special Summon 1 "Speedroid Token" (Machine/WIND/ATK 0/DEF 0) with a Level equal to the original Level of the Synchro Monster that used this card as material. You can only use this effect of "Speedroid Block-n-Roll" once per turn.
target_text: -- Speedroid
  local CARD_ID_0 = 69550260 --Speedroid Token
  local SETCARD_ID_0 = 0x2016 --Speedroid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--spsummon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BE_MATERIAL)
  	e1:SetProperty(EFFECT_FLAG_DELAY)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	aux.CreateMaterialReasonCardRelation(c, e1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsLocation(LOCATION_GRAVE) and r == REASON_SYNCHRO
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local rc = e:GetHandler():GetReasonCard()
  	local lv = rc:GetOriginalLevel()
  	if chk == 0 then
  		return rc:IsRelateToEffect(e)
  			and rc:IsFaceup()
  			and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
  			and Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, lv, RACE_MACHINE, ATTRIBUTE_WIND)
  	end
  	Duel.SetTargetCard(rc)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local rc = Duel.GetFirstTarget()
  	if not rc:IsRelateToChain() or rc:IsFacedown() then
  		return
  	end
  	local lv = rc:GetOriginalLevel()
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	if Duel.IsPlayerCanSpecialSummonMonster(tp, id + 1, SETCARD_ID_0, TYPES_TOKEN_MONSTER, 0, 0, lv, RACE_MACHINE, ATTRIBUTE_WIND) then
  		local token = Duel.CreateToken(tp, id + 1)
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_LEVEL)
  		e1:SetValue(lv)
  		token:RegisterEffect(e1)
  		Duel.SpecialSummon(token, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  