name: Number
card_text: 2 Level 8 Dragon-Type monsters
  Once per turn, if you control no other monsters: You can detach 1 Xyz Material from this card, then activate 1 of these effects.
  ● Special Summon 1 Dragon-Type monster from your hand.
  ● Target 1 Dragon-Type monster your opponent controls; take control of that target.
  ● Dragon-Type monsters your opponent controls cannot activate their effects until the end of your opponent's tur
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsRace, RACE_DRAGON), 8, 2)
  	c:EnableReviveLimit()
  	--spsummon
  	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, EFFECT_COUNT_CODE_SINGLE)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--control
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_CONTROL)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, EFFECT_COUNT_CODE_SINGLE)
  	e2:SetCondition(s.condition)
  	e2:SetCost(s.cost)
  	e2:SetTarget(s.cttg)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  	--effect limit
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 2))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1, EFFECT_COUNT_CODE_SINGLE)
  	e3:SetCondition(s.condition)
  	e3:SetCost(s.cost)
  	e3:SetOperation(s.efop)
  	c:RegisterEffect(e3)
  end
  aux.xyz_number[id] = 46
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) <= 1
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.spfilter(c, e, tp)
  	return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e, 0, tp, false, aux.DragonXyzSpSummonType(c))
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		local sc = g:GetFirst()
  		if Duel.SpecialSummon(g, 0, tp, tp, false, aux.DragonXyzSpSummonType(sc), POS_FACEUP) ~= 0 and aux.DragonXyzSpSummonType(sc) then
  			sc:CompleteProcedure()
  		end
  	end
  end
  function s.ctfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsControlerCanBeChanged()
  end
  function s.cttg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.ctfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.ctfilter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local g = Duel.SelectTarget(tp, s.ctfilter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsRace(RACE_DRAGON) then
  		Duel.GetControl(tc, tp)
  	end
  end
  function s.efop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_TRIGGER)
  	e1:SetTargetRange(0, LOCATION_MZONE)
  	e1:SetTarget(s.actfilter)
  	e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 1)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.actfilter(e, c)
  	return c:IsRace(RACE_DRAGON)
  end
  
  
source_text: Number
  2 Level 8 Dragon-Type monsters
  Once per turn, if you control no other monsters: You can detach 1 Xyz Material from this card, then activate 1 of these effects.
  ● Special Summon 1 Dragon-Type monster from your hand.
  ● Target 1 Dragon-Type monster your opponent controls; take control of that target.
  ● Dragon-Type monsters your opponent controls cannot activate their effects until the end of your opponent's tur
target_text: -- Number
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsRace, RACE_DRAGON), 8, 2)
  	c:EnableReviveLimit()
  	--spsummon
  	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, EFFECT_COUNT_CODE_SINGLE)
  	e1:SetCondition(s.condition)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--control
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetCategory(CATEGORY_CONTROL)
  	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, EFFECT_COUNT_CODE_SINGLE)
  	e2:SetCondition(s.condition)
  	e2:SetCost(s.cost)
  	e2:SetTarget(s.cttg)
  	e2:SetOperation(s.ctop)
  	c:RegisterEffect(e2)
  	--effect limit
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 2))
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCountLimit(1, EFFECT_COUNT_CODE_SINGLE)
  	e3:SetCondition(s.condition)
  	e3:SetCost(s.cost)
  	e3:SetOperation(s.efop)
  	c:RegisterEffect(e3)
  end
  aux.xyz_number[id] = 46
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) <= 1
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():CheckRemoveOverlayCard(tp, 1, REASON_COST)
  	end
  	Duel.Hint(HINT_OPSELECTED, 1 - tp, e:GetDescription())
  	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
  end
  function s.spfilter(c, e, tp)
  	return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e, 0, tp, false, aux.DragonXyzSpSummonType(c))
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and Duel.IsExistingMatchingCard(s.spfilter, tp, LOCATION_HAND, 0, 1, nil, e, tp)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, LOCATION_HAND)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.GetLocationCount(tp, LOCATION_MZONE) <= 0 then
  		return
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_SPSUMMON)
  	local g = Duel.SelectMatchingCard(tp, s.spfilter, tp, LOCATION_HAND, 0, 1, 1, nil, e, tp)
  	if g:GetCount() > 0 then
  		local sc = g:GetFirst()
  		if Duel.SpecialSummon(g, 0, tp, tp, false, aux.DragonXyzSpSummonType(sc), POS_FACEUP) ~= 0 and aux.DragonXyzSpSummonType(sc) then
  			sc:CompleteProcedure()
  		end
  	end
  end
  function s.ctfilter(c)
  	return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsControlerCanBeChanged()
  end
  function s.cttg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1 - tp) and s.ctfilter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.ctfilter, tp, 0, LOCATION_MZONE, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONTROL)
  	local g = Duel.SelectTarget(tp, s.ctfilter, tp, 0, LOCATION_MZONE, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_CONTROL, g, 1, 0, 0)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) and tc:IsRace(RACE_DRAGON) then
  		Duel.GetControl(tc, tp)
  	end
  end
  function s.efop(e, tp, eg, ep, ev, re, r, rp)
  	local e1 = Effect.CreateEffect(e:GetHandler())
  	e1:SetType(EFFECT_TYPE_FIELD)
  	e1:SetCode(EFFECT_CANNOT_TRIGGER)
  	e1:SetTargetRange(0, LOCATION_MZONE)
  	e1:SetTarget(s.actfilter)
  	e1:SetReset(RESET_PHASE + PHASE_END + RESET_OPPO_TURN, 1)
  	Duel.RegisterEffect(e1, tp)
  end
  function s.actfilter(e, c)
  	return c:IsRace(RACE_DRAGON)
  end
  
  