name: Number
card_text: 2 Level 8 monsters
  If this card has a "Photon" card as material, it cannot be destroyed by card effects. You can only use each of the following effects of "Number 90: Galaxy-Eyes Photon Lord" once per turn.
  ��When an opponent's monster activates its effect (Quick Effect): You can detach 1 material from this card; negate that monster's effect, and if the detached material was a "Galaxy" card, destroy that card.
  ��During your opponent's turn (Quick Effect): You can take 1 "Photon" or "Galaxy" card from your Deck, and either add it to your hand or attach it to this card as material.
external_ids: local SETCARD_ID_0 = 0x7b --Galaxy
  local SETCARD_ID_1 = 0x55 --Photon
  
lua: local SETCARD_ID_0 = 0x7b --Galaxy
  local SETCARD_ID_1 = 0x55 --Photon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 8, 2)
  	c:EnableReviveLimit()
  	--indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(s.indcon)
  	e1:SetValue(1)
  	c:RegisterEffect(e1)
  	--negate activate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DISABLE + CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetCondition(s.negcon)
  	e2:SetCost(s.negcost)
  	e2:SetTarget(s.negtg)
  	e2:SetOperation(s.negop)
  	c:RegisterEffect(e2)
  	--search
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetHintTiming(0, TIMING_END_PHASE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  aux.xyz_number[id] = 90
  function s.indcon(e)
  	return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard, 1, nil, 0x55)
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
  end
  function s.negcost(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)
  	local ct = Duel.GetOperatedGroup():GetFirst()
  	e:SetLabelObject(ct)
  end
  function s.negtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  	if re:GetHandler():IsDestructable() and e:GetLabelObject():IsSetCard(SETCARD_ID_1) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, re:GetHandler(), 1, 0, 0)
  	end
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and e:GetLabelObject():IsSetCard(SETCARD_ID_1) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp
  end
  function s.filter(c, mc)
  	return c:IsSetCard(0x55, SETCARD_ID_1) and (c:IsAbleToHand() or (mc:IsType(TYPE_XYZ) and c:IsCanOverlay()))
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil, e:GetHandler())
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local c = e:GetHandler()
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil, c)
  	local tc = g:GetFirst()
  	if tc then
  		if c:IsType(TYPE_XYZ) and tc:IsCanOverlay() and (not tc:IsAbleToHand() or Duel.SelectOption(tp, 1190, aux.Stringid(id, 2)) == 1) then
  			Duel.Overlay(c, Group.FromCards(tc))
  		else
  			Duel.SendtoHand(tc, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, tc)
  		end
  	end
  end
  
  
source_text: Number
  2 Level 8 monsters
  If this card has a "Photon" card as material, it cannot be destroyed by card effects. You can only use each of the following effects of "Number 90: Galaxy-Eyes Photon Lord" once per turn.
  ��When an opponent's monster activates its effect (Quick Effect): You can detach 1 material from this card; negate that monster's effect, and if the detached material was a "Galaxy" card, destroy that card.
  ��During your opponent's turn (Quick Effect): You can take 1 "Photon" or "Galaxy" card from your Deck, and either add it to your hand or attach it to this card as material.
target_text: -- Number
  local SETCARD_ID_0 = 0x7b --Galaxy
  local SETCARD_ID_1 = 0x55 --Photon
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, nil, 8, 2)
  	c:EnableReviveLimit()
  	--indes
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCondition(s.indcon)
  	e1:SetValue(1)
  	c:RegisterEffect(e1)
  	--negate activate
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DISABLE + CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_QUICK_O)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCountLimit(1, id)
  	e2:SetCode(EVENT_CHAINING)
  	e2:SetCondition(s.negcon)
  	e2:SetCost(s.negcost)
  	e2:SetTarget(s.negtg)
  	e2:SetOperation(s.negop)
  	c:RegisterEffect(e2)
  	--search
  	local e3 = Effect.CreateEffect(c)
  	e3:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
  	e3:SetDescription(aux.Stringid(id, 1))
  	e3:SetType(EFFECT_TYPE_QUICK_O)
  	e3:SetCode(EVENT_FREE_CHAIN)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetHintTiming(0, TIMING_END_PHASE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCondition(s.condition)
  	e3:SetTarget(s.target)
  	e3:SetOperation(s.operation)
  	c:RegisterEffect(e3)
  end
  aux.xyz_number[id] = 90
  function s.indcon(e)
  	return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard, 1, nil, 0x55)
  end
  function s.negcon(e, tp, eg, ep, ev, re, r, rp)
  	return ep ~= tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
  end
  function s.negcost(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)
  	local ct = Duel.GetOperatedGroup():GetFirst()
  	e:SetLabelObject(ct)
  end
  function s.negtg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetOperationInfo(0, CATEGORY_DISABLE, eg, 1, 0, 0)
  	if re:GetHandler():IsDestructable() and e:GetLabelObject():IsSetCard(SETCARD_ID_1) then
  		Duel.SetOperationInfo(0, CATEGORY_DESTROY, re:GetHandler(), 1, 0, 0)
  	end
  end
  function s.negop(e, tp, eg, ep, ev, re, r, rp)
  	if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and e:GetLabelObject():IsSetCard(SETCARD_ID_1) then
  		Duel.Destroy(eg, REASON_EFFECT)
  	end
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() ~= tp
  end
  function s.filter(c, mc)
  	return c:IsSetCard(0x55, SETCARD_ID_1) and (c:IsAbleToHand() or (mc:IsType(TYPE_XYZ) and c:IsCanOverlay()))
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.filter, tp, LOCATION_DECK, 0, 1, nil, e:GetHandler())
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local c = e:GetHandler()
  	local g = Duel.SelectMatchingCard(tp, s.filter, tp, LOCATION_DECK, 0, 1, 1, nil, c)
  	local tc = g:GetFirst()
  	if tc then
  		if c:IsType(TYPE_XYZ) and tc:IsCanOverlay() and (not tc:IsAbleToHand() or Duel.SelectOption(tp, 1190, aux.Stringid(id, 2)) == 1) then
  			Duel.Overlay(c, Group.FromCards(tc))
  		else
  			Duel.SendtoHand(tc, nil, REASON_EFFECT)
  			Duel.ConfirmCards(1 - tp, tc)
  		end
  	end
  end
  
  