name: Number
card_text: 2 Level 6 monsters
  If this card is Xyz Summoned: The ATK of all monsters your opponent currently controls become 0. Once per turn (Quick Effect): You can detach 1 material from this card, then target 1 face-up Xyz Monster you control and 1 "Utopia" monster in your GY; banish the first target, and if you do, Special Summon the second target, then gain 1250 LP.
external_ids: local SETCARD_ID_0 = 0x107f --Utopia
  
lua: local SETCARD_ID_0 = 0x107f --Utopia
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 6, 2)
  	c:EnableReviveLimit()
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.atkcon)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_REMOVE + CATEGORY_SPECIAL_SUMMON + CATEGORY_RECOVER)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCountLimit(1)
  	e2:SetCost(s.spcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 39
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, 0, LOCATION_MZONE, nil)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetValue(0)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		tc = g:GetNext()
  	end
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.rmfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsAbleToRemove()
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > -1
  			and Duel.IsExistingTarget(s.rmfilter, tp, LOCATION_MZONE, 0, 1, nil)
  			and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g1 = Duel.SelectTarget(tp, s.rmfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g2 = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g1, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g2, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, 0, 0, tp, 1250)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local ex, g1 = Duel.GetOperationInfo(0, CATEGORY_REMOVE)
  	local ex, g2 = Duel.GetOperationInfo(0, CATEGORY_SPECIAL_SUMMON)
  	local tc1 = g1:GetFirst()
  	if not tc1:IsRelateToEffect(e) or Duel.Remove(tc1, POS_FACEUP, REASON_EFFECT) == 0 then
  		return
  	end
  	local tc2 = g2:GetFirst()
  	if not tc2:IsRelateToEffect(e) or Duel.SpecialSummon(tc2, 0, tp, tp, false, false, POS_FACEUP) == 0 then
  		return
  	end
  	Duel.BreakEffect()
  	Duel.Recover(tp, 1250, REASON_EFFECT)
  end
  
  
source_text: Number
  2 Level 6 monsters
  If this card is Xyz Summoned: The ATK of all monsters your opponent currently controls become 0. Once per turn (Quick Effect): You can detach 1 material from this card, then target 1 face-up Xyz Monster you control and 1 "Utopia" monster in your GY; banish the first target, and if you do, Special Summon the second target, then gain 1250 LP.
target_text: -- Number
  local SETCARD_ID_0 = 0x107f --Utopia
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 6, 2)
  	c:EnableReviveLimit()
  	--atk
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_ATKCHANGE)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e1:SetCondition(s.atkcon)
  	e1:SetOperation(s.atkop)
  	c:RegisterEffect(e1)
  	--spsummon
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_REMOVE + CATEGORY_SPECIAL_SUMMON + CATEGORY_RECOVER)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetCode(EVENT_FREE_CHAIN)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetCountLimit(1)
  	e2:SetCost(s.spcost)
  	e2:SetTarget(s.sptg)
  	e2:SetOperation(s.spop)
  	c:RegisterEffect(e2)
  end
  aux.xyz_number[id] = 39
  function s.atkcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, 0, LOCATION_MZONE, nil)
  	local tc = g:GetFirst()
  	while tc do
  		local e1 = Effect.CreateEffect(e:GetHandler())
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetValue(0)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  		tc:RegisterEffect(e1)
  		tc = g:GetNext()
  	end
  end
  function s.spcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.rmfilter(c)
  	return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsAbleToRemove()
  end
  function s.spfilter(c, e, tp)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return false
  	end
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > -1
  			and Duel.IsExistingTarget(s.rmfilter, tp, LOCATION_MZONE, 0, 1, nil)
  			and Duel.IsExistingTarget(s.spfilter, tp, LOCATION_GRAVE, 0, 1, nil, e, tp)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_REMOVE)
  	local g1 = Duel.SelectTarget(tp, s.rmfilter, tp, LOCATION_MZONE, 0, 1, 1, nil)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g2 = Duel.SelectTarget(tp, s.spfilter, tp, LOCATION_GRAVE, 0, 1, 1, nil, e, tp)
  	Duel.SetOperationInfo(0, CATEGORY_REMOVE, g1, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, g2, 1, 0, 0)
  	Duel.SetOperationInfo(0, CATEGORY_RECOVER, 0, 0, tp, 1250)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local ex, g1 = Duel.GetOperationInfo(0, CATEGORY_REMOVE)
  	local ex, g2 = Duel.GetOperationInfo(0, CATEGORY_SPECIAL_SUMMON)
  	local tc1 = g1:GetFirst()
  	if not tc1:IsRelateToEffect(e) or Duel.Remove(tc1, POS_FACEUP, REASON_EFFECT) == 0 then
  		return
  	end
  	local tc2 = g2:GetFirst()
  	if not tc2:IsRelateToEffect(e) or Duel.SpecialSummon(tc2, 0, tp, tp, false, false, POS_FACEUP) == 0 then
  		return
  	end
  	Duel.BreakEffect()
  	Duel.Recover(tp, 1250, REASON_EFFECT)
  end
  
  