name: Space-Time
card_text: When this card is Special Summoned: Target 1 face-up card your opponent controls; banish that target. When this card leaves the field: Set the card that was banished by this effect to your opponent's side of the field.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--remove
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.rmtg)
  	e1:SetOperation(s.rmop)
  	c:RegisterEffect(e1)
  	--set
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_LEAVE_FIELD)
  	e2:SetCondition(s.setcon)
  	e2:SetTarget(s.settg)
  	e2:SetOperation(s.setop)
  	e2:SetLabelObject(e1)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsAbleToRemove()
  end
  function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsOnField() and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	e:SetLabelObject(nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, g:GetCount(), 0, 0)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		if Duel.Remove(tc, POS_FACEUP, REASON_EFFECT) ~= 0 and not tc:IsType(TYPE_TOKEN) and e:GetHandler():IsRelateToEffect(e) then
  			e:SetLabelObject(tc)
  			tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  		end
  	end
  end
  function s.setcon(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject():GetLabelObject()
  	return tc and tc:GetFlagEffect(id) ~= 0
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local tc = e:GetLabelObject():GetLabelObject()
  	Duel.SetTargetCard(tc)
  	if tc:IsType(TYPE_MONSTER) then
  		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
  		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, tc, 1, 0, 0)
  	else
  		e:SetCategory(0)
  	end
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) then
  		return
  	end
  	if tc:IsType(TYPE_MONSTER) then
  		Duel.SpecialSummon(tc, 0, tp, 1 - tp, false, false, POS_FACEDOWN_DEFENSE)
  	else
  		Duel.SSet(tp, tc, 1 - tp)
  	end
  end
  
  
source_text: Space-Time
  When this card is Special Summoned: Target 1 face-up card your opponent controls; banish that target. When this card leaves the field: Set the card that was banished by this effect to your opponent's side of the field.
target_text: -- Space-Time
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--remove
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_REMOVE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.rmtg)
  	e1:SetOperation(s.rmop)
  	c:RegisterEffect(e1)
  	--set
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_LEAVE_FIELD)
  	e2:SetCondition(s.setcon)
  	e2:SetTarget(s.settg)
  	e2:SetOperation(s.setop)
  	e2:SetLabelObject(e1)
  	c:RegisterEffect(e2)
  end
  function s.filter(c)
  	return c:IsFaceup() and c:IsAbleToRemove()
  end
  function s.rmtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(1 - tp) and chkc:IsOnField() and s.filter(chkc)
  	end
  	if chk == 0 then
  		return true
  	end
  	e:SetLabelObject(nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g = Duel.SelectTarget(tp, s.filter, tp, 0, LOCATION_ONFIELD, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g, g:GetCount(), 0, 0)
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
  		if Duel.Remove(tc, POS_FACEUP, REASON_EFFECT) ~= 0 and not tc:IsType(TYPE_TOKEN) and e:GetHandler():IsRelateToEffect(e) then
  			e:SetLabelObject(tc)
  			tc:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD, 0, 1)
  		end
  	end
  end
  function s.setcon(e, tp, eg, ep, ev, re, r, rp)
  	local tc = e:GetLabelObject():GetLabelObject()
  	return tc and tc:GetFlagEffect(id) ~= 0
  end
  function s.settg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local tc = e:GetLabelObject():GetLabelObject()
  	Duel.SetTargetCard(tc)
  	if tc:IsType(TYPE_MONSTER) then
  		e:SetCategory(CATEGORY_SPECIAL_SUMMON)
  		Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, tc, 1, 0, 0)
  	else
  		e:SetCategory(0)
  	end
  end
  function s.setop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if not tc:IsRelateToEffect(e) then
  		return
  	end
  	if tc:IsType(TYPE_MONSTER) then
  		Duel.SpecialSummon(tc, 0, tp, 1 - tp, false, false, POS_FACEDOWN_DEFENSE)
  	else
  		Duel.SSet(tp, tc, 1 - tp)
  	end
  end
  
  