name: Super
card_text: 1 "roid" Fusion Monster + 1 "roid" monster
  You can target 1 face-up monster your opponent controls; Special Summon 1 "roid" monster from your Deck or Extra Deck with ATK less than or equal to that monster. You can only use this effect of "Super Vehicroid - Mobile Base" once per turn. Once per turn, during the End Phase: You can target 1 "roid" monster in your Main Monster Zone (other than this card); return that monster you control to the hand, and if you do, move this card you control to that monster's Monster Zone.
external_ids: local SETCARD_ID_0 = 0x16 --roid
  
lua: local SETCARD_ID_0 = 0x16 --roid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, s.matfilter, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), true)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--to hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_TOHAND)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_PHASE + PHASE_END)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetTarget(s.mvtg)
  	e2:SetOperation(s.mvop)
  	c:RegisterEffect(e2)
  end
  function s.matfilter(c)
  	return c:IsFusionType(TYPE_FUSION) and c:IsFusionSetCard(SETCARD_ID_0)
  end
  function s.spfilter1(c, e, tp)
  	return c:IsFaceup() and Duel.IsExistingMatchingCard(s.spfilter2, tp, LOCATION_DECK + LOCATION_EXTRA, 0, 1, nil, e, tp, c:GetAttack())
  end
  function s.spfilter2(c, e, tp, atk)
  	return c:IsSetCard(SETCARD_ID_0)
  		and c:IsAttackBelow(atk)
  		and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  		and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp) > 0 or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsLocation(LOCATION_MZONE) and s.spfilter1(chkc, e, tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.spfilter1, tp, 0, LOCATION_MZONE, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.spfilter1, tp, 0, LOCATION_MZONE, 1, 1, nil, e, tp)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK + LOCATION_EXTRA)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, s.spfilter2, tp, LOCATION_DECK + LOCATION_EXTRA, 0, 1, 1, nil, e, tp, tc:GetAttack())
  		if g:GetCount() > 0 then
  			Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  function s.mvfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand() and c:GetSequence() < 5
  end
  function s.mvtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.mvfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.mvfilter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
  	local g = Duel.SelectTarget(tp, s.mvfilter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.mvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsControler(tp) and Duel.SendtoHand(tc, nil, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_HAND) and c:IsFaceup() and c:IsRelateToEffect(e) then
  		local seq = tc:GetPreviousSequence()
  		Duel.MoveSequence(c, seq)
  	end
  end
  
  
source_text: Super
  1 "roid" Fusion Monster + 1 "roid" monster
  You can target 1 face-up monster your opponent controls; Special Summon 1 "roid" monster from your Deck or Extra Deck with ATK less than or equal to that monster. You can only use this effect of "Super Vehicroid - Mobile Base" once per turn. Once per turn, during the End Phase: You can target 1 "roid" monster in your Main Monster Zone (other than this card); return that monster you control to the hand, and if you do, move this card you control to that monster's Monster Zone.
target_text: -- Super
  local SETCARD_ID_0 = 0x16 --roid
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableReviveLimit()
  	aux.AddFusionProcFun2(c, s.matfilter, aux.FilterBoolFunction(Card.IsFusionSetCard, SETCARD_ID_0), true)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCountLimit(1, id)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--to hand
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_TOHAND)
  	e2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e2:SetCode(EVENT_PHASE + PHASE_END)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetTarget(s.mvtg)
  	e2:SetOperation(s.mvop)
  	c:RegisterEffect(e2)
  end
  function s.matfilter(c)
  	return c:IsFusionType(TYPE_FUSION) and c:IsFusionSetCard(SETCARD_ID_0)
  end
  function s.spfilter1(c, e, tp)
  	return c:IsFaceup() and Duel.IsExistingMatchingCard(s.spfilter2, tp, LOCATION_DECK + LOCATION_EXTRA, 0, 1, nil, e, tp, c:GetAttack())
  end
  function s.spfilter2(c, e, tp, atk)
  	return c:IsSetCard(SETCARD_ID_0)
  		and c:IsAttackBelow(atk)
  		and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  		and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp) > 0 or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp, tp, nil, c) > 0)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsLocation(LOCATION_MZONE) and s.spfilter1(chkc, e, tp)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.spfilter1, tp, 0, LOCATION_MZONE, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_FACEUP)
  	Duel.SelectTarget(tp, s.spfilter1, tp, 0, LOCATION_MZONE, 1, 1, nil, e, tp)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_DECK + LOCATION_EXTRA)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsFaceup() then
  		Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  		local g = Duel.SelectMatchingCard(tp, s.spfilter2, tp, LOCATION_DECK + LOCATION_EXTRA, 0, 1, 1, nil, e, tp, tc:GetAttack())
  		if g:GetCount() > 0 then
  			Duel.SpecialSummon(g, 0, tp, tp, false, false, POS_FACEUP)
  		end
  	end
  end
  function s.mvfilter(c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0) and c:IsAbleToHand() and c:GetSequence() < 5
  end
  function s.mvtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.mvfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.mvfilter, tp, LOCATION_MZONE, 0, 1, e:GetHandler())
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_RTOHAND)
  	local g = Duel.SelectTarget(tp, s.mvfilter, tp, LOCATION_MZONE, 0, 1, 1, e:GetHandler())
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.mvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsControler(tp) and Duel.SendtoHand(tc, nil, REASON_EFFECT) > 0 and tc:IsLocation(LOCATION_HAND) and c:IsFaceup() and c:IsRelateToEffect(e) then
  		local seq = tc:GetPreviousSequence()
  		Duel.MoveSequence(c, seq)
  	end
  end
  
  