name: Numeral
card_text: If this card is Summoned: Return all "Number" Xyz Monsters on the field to the Extra Deck. Neither player can Special Summon "Number" Xyz Monsters. Cannot be destroyed by battle with an Xyz Monster. This card is unaffected by the effects of Xyz Monsters.
external_ids: local SETCARD_ID_0 = 0x48 --Number
  
lua: local SETCARD_ID_0 = 0x48 --Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--todeck
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOEXTRA)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	--splimit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetTargetRange(1, 1)
  	e4:SetTarget(s.splimit)
  	c:RegisterEffect(e4)
  	--indes
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e5:SetValue(s.indval)
  	c:RegisterEffect(e5)
  	--immune
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_SINGLE)
  	e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e6:SetRange(LOCATION_MZONE)
  	e6:SetCode(EFFECT_IMMUNE_EFFECT)
  	e6:SetValue(s.efilter)
  	c:RegisterEffect(e6)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_XYZ) and c:IsAbleToExtra()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOEXTRA, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
  	end
  end
  function s.splimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_XYZ)
  end
  function s.indval(e, c)
  	return c:IsType(TYPE_XYZ)
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_XYZ)
  end
  
  
source_text: Numeral
  If this card is Summoned: Return all "Number" Xyz Monsters on the field to the Extra Deck. Neither player can Special Summon "Number" Xyz Monsters. Cannot be destroyed by battle with an Xyz Monster. This card is unaffected by the effects of Xyz Monsters.
target_text: -- Numeral
  local SETCARD_ID_0 = 0x48 --Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--todeck
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_TOEXTRA)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
  	c:RegisterEffect(e2)
  	local e3 = e1:Clone()
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	c:RegisterEffect(e3)
  	--splimit
  	local e4 = Effect.CreateEffect(c)
  	e4:SetType(EFFECT_TYPE_FIELD)
  	e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e4:SetTargetRange(1, 1)
  	e4:SetTarget(s.splimit)
  	c:RegisterEffect(e4)
  	--indes
  	local e5 = Effect.CreateEffect(c)
  	e5:SetType(EFFECT_TYPE_SINGLE)
  	e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
  	e5:SetValue(s.indval)
  	c:RegisterEffect(e5)
  	--immune
  	local e6 = Effect.CreateEffect(c)
  	e6:SetType(EFFECT_TYPE_SINGLE)
  	e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e6:SetRange(LOCATION_MZONE)
  	e6:SetCode(EFFECT_IMMUNE_EFFECT)
  	e6:SetValue(s.efilter)
  	c:RegisterEffect(e6)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_XYZ) and c:IsAbleToExtra()
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOEXTRA, g, g:GetCount(), 0, 0)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(s.filter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
  	if g:GetCount() > 0 then
  		Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
  	end
  end
  function s.splimit(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_XYZ)
  end
  function s.indval(e, c)
  	return c:IsType(TYPE_XYZ)
  end
  function s.efilter(e, te)
  	return te:IsActiveType(TYPE_XYZ)
  end
  
  