name: Orbital
card_text: When this card is flipped face-up: Place 1 You Got It Boss! Counter on it. You can remove all You Got It Boss! Counters on this card; its ATK becomes 2000. After you change this card's ATK with this effect, it cannot attack your opponent directly for the rest of this turn, and is sent to the GY during the End Phase. You can Tribute this card to target 1 "Photon" or "Galaxy" monster in your GY; add that target to your hand.
external_ids: local SETCARD_ID_0 = 0x55 --Photon
  local COUNTER_ID_0 = 0x2c --You
  
lua: local SETCARD_ID_0 = 0x55 --Photon
  local COUNTER_ID_0 = 0x2c --You
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x2c)
  	--counter
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_COUNTER)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_FLIP)
  	e1:SetOperation(s.ctop)
  	c:RegisterEffect(e1)
  	--atkchange
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_ATKCHANGE)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.atkcost)
  	e2:SetTarget(s.atktg)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  	--salvage
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 2))
  	e3:SetCategory(CATEGORY_TOHAND)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.thcost)
  	e3:SetTarget(s.thtg)
  	e3:SetOperation(s.thop)
  	c:RegisterEffect(e3)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		c:AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = e:GetHandler():GetCounter(COUNTER_ID_0)
  	if chk == 0 then
  		return ct > 0 and e:GetHandler():IsCanRemoveCounter(tp, COUNTER_ID_0, ct, REASON_COST)
  	end
  	e:GetHandler():RemoveCounter(tp, COUNTER_ID_0, ct, REASON_COST)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not e:GetHandler():IsAttack(2000)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e1:SetValue(2000)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e2)
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e3:SetRange(LOCATION_MZONE)
  		e3:SetCountLimit(1)
  		e3:SetCode(EVENT_PHASE + PHASE_END)
  		e3:SetOperation(s.tgop)
  		e3:SetReset(RESET_EVENT + 0xc6e0000)
  		c:RegisterEffect(e3)
  	end
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SendtoGrave(e:GetHandler(), REASON_EFFECT)
  end
  function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable()
  	end
  	Duel.Release(e:GetHandler(), REASON_COST)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0, 0x7b) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, tc)
  	end
  end
  
  
source_text: Orbital
  When this card is flipped face-up: Place 1 You Got It Boss! Counter on it. You can remove all You Got It Boss! Counters on this card; its ATK becomes 2000. After you change this card's ATK with this effect, it cannot attack your opponent directly for the rest of this turn, and is sent to the GY during the End Phase. You can Tribute this card to target 1 "Photon" or "Galaxy" monster in your GY; add that target to your hand.
target_text: -- Orbital
  local SETCARD_ID_0 = 0x55 --Photon
  local COUNTER_ID_0 = 0x2c --You
  local s, id, o = GetID()
  function s.initial_effect(c)
  	c:EnableCounterPermit(0x2c)
  	--counter
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_COUNTER)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_FLIP)
  	e1:SetOperation(s.ctop)
  	c:RegisterEffect(e1)
  	--atkchange
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_ATKCHANGE)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetCost(s.atkcost)
  	e2:SetTarget(s.atktg)
  	e2:SetOperation(s.atkop)
  	c:RegisterEffect(e2)
  	--salvage
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 2))
  	e3:SetCategory(CATEGORY_TOHAND)
  	e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
  	e3:SetType(EFFECT_TYPE_IGNITION)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetCost(s.thcost)
  	e3:SetTarget(s.thtg)
  	e3:SetOperation(s.thop)
  	c:RegisterEffect(e3)
  end
  function s.ctop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		c:AddCounter(COUNTER_ID_0, 1)
  	end
  end
  function s.atkcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	local ct = e:GetHandler():GetCounter(COUNTER_ID_0)
  	if chk == 0 then
  		return ct > 0 and e:GetHandler():IsCanRemoveCounter(tp, COUNTER_ID_0, ct, REASON_COST)
  	end
  	e:GetHandler():RemoveCounter(tp, COUNTER_ID_0, ct, REASON_COST)
  end
  function s.atktg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return not e:GetHandler():IsAttack(2000)
  	end
  end
  function s.atkop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_SET_ATTACK_FINAL)
  		e1:SetValue(2000)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e2)
  		local e3 = Effect.CreateEffect(c)
  		e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  		e3:SetRange(LOCATION_MZONE)
  		e3:SetCountLimit(1)
  		e3:SetCode(EVENT_PHASE + PHASE_END)
  		e3:SetOperation(s.tgop)
  		e3:SetReset(RESET_EVENT + 0xc6e0000)
  		c:RegisterEffect(e3)
  	end
  end
  function s.tgop(e, tp, eg, ep, ev, re, r, rp)
  	Duel.SendtoGrave(e:GetHandler(), REASON_EFFECT)
  end
  function s.thcost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsReleasable()
  	end
  	Duel.Release(e:GetHandler(), REASON_COST)
  end
  function s.filter(c)
  	return c:IsSetCard(SETCARD_ID_0, 0x7b) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
  end
  function s.thtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
  	if chkc then
  		return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc)
  	end
  	if chk == 0 then
  		return Duel.IsExistingTarget(s.filter, tp, LOCATION_GRAVE, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_ATOHAND)
  	local g = Duel.SelectTarget(tp, s.filter, tp, LOCATION_GRAVE, 0, 1, 1, nil)
  	Duel.SetOperationInfo(0, CATEGORY_TOHAND, g, 1, 0, 0)
  end
  function s.thop(e, tp, eg, ep, ev, re, r, rp)
  	local tc = Duel.GetFirstTarget()
  	if tc:IsRelateToEffect(e) then
  		Duel.SendtoHand(tc, nil, REASON_EFFECT)
  		Duel.ConfirmCards(1 - tp, tc)
  	end
  end
  
  