name: Time-Space
card_text: When your opponent Special Summons a monster(s) from the hand or Extra Deck: Shuffle that monster(s) into the Deck, then you lose 1000 LP for each returned monster.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TODECK)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c, tp)
  	return c:IsSummonPlayer(1 - tp) and c:IsSummonLocation(LOCATION_HAND + LOCATION_EXTRA) and c:IsAbleToDeck() and c:IsLocation(LOCATION_MZONE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = eg:Filter(s.filter, nil, tp)
  	local ct = g:GetCount()
  	if chk == 0 then
  		return ct > 0
  	end
  	Duel.SetTargetCard(eg)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, ct, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = eg:Filter(s.filter, nil, tp):Filter(Card.IsRelateToEffect, nil, e)
  	if g:GetCount() > 0 then
  		Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  		local og = Duel.GetOperatedGroup()
  		local ct = og:FilterCount(Card.IsLocation, nil, LOCATION_DECK + LOCATION_EXTRA)
  		if ct > 0 then
  			Duel.BreakEffect()
  			Duel.SetLP(tp, Duel.GetLP(tp) - ct * 1000)
  		end
  	end
  end
  
  
source_text: Time-Space
  When your opponent Special Summons a monster(s) from the hand or Extra Deck: Shuffle that monster(s) into the Deck, then you lose 1000 LP for each returned monster.
target_text: -- Time-Space
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_TODECK)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  end
  function s.filter(c, tp)
  	return c:IsSummonPlayer(1 - tp) and c:IsSummonLocation(LOCATION_HAND + LOCATION_EXTRA) and c:IsAbleToDeck() and c:IsLocation(LOCATION_MZONE)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local g = eg:Filter(s.filter, nil, tp)
  	local ct = g:GetCount()
  	if chk == 0 then
  		return ct > 0
  	end
  	Duel.SetTargetCard(eg)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, ct, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local g = eg:Filter(s.filter, nil, tp):Filter(Card.IsRelateToEffect, nil, e)
  	if g:GetCount() > 0 then
  		Duel.SendtoDeck(g, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
  		local og = Duel.GetOperatedGroup()
  		local ct = og:FilterCount(Card.IsLocation, nil, LOCATION_DECK + LOCATION_EXTRA)
  		if ct > 0 then
  			Duel.BreakEffect()
  			Duel.SetLP(tp, Duel.GetLP(tp) - ct * 1000)
  		end
  	end
  end
  
  