Constellar
2 Level 4 "Constellar" monsters
Once per turn, during the Damage Step of either player's turn, when a "Constellar" monster you control is attacking or being attacked: You can detach 1 Xyz Material from this card; that monster gains 1000 ATK, until the End Phase.
local SETCARD_ID_0 = 0x53 --Constellar

local SETCARD_ID_0 = 0x53 --Constellar
local s, id, o = GetID()
function s.initial_effect(c)
	--xyz summon
	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsSetCard, SETCARD_ID_0), 4, 2)
	c:EnableReviveLimit()
	--attack up
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_ATKCHANGE)
	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
	e1:SetType(EFFECT_TYPE_QUICK_O)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetHintTiming(TIMING_DAMAGE_STEP)
	e1:SetCountLimit(1)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCondition(s.condition)
	e1:SetCost(s.cost)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.condition(e, tp, eg, ep, ev, re, r, rp)
	local phase = Duel.GetCurrentPhase()
	if phase ~= PHASE_DAMAGE or Duel.IsDamageCalculated() then
		return false
	end
	local tc = Duel.GetAttacker()
	if tc:IsControler(1 - tp) then
		tc = Duel.GetAttackTarget()
	end
	e:SetLabelObject(tc)
	return tc and tc:IsFaceup() and tc:IsSetCard(SETCARD_ID_0) and tc:IsRelateToBattle()
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
	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	if not tc:IsRelateToBattle() or tc:IsFacedown() then
		return
	end
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
	e1:SetValue(1000)
	tc:RegisterEffect(e1)
end


Constellar
2 Level 4 "Constellar" monsters
Once per turn, during the Damage Step of either player's turn, when a "Constellar" monster you control is attacking or being attacked: You can detach 1 Xyz Material from this card; that monster gains 1000 ATK, until the End Phase.
-- Constellar
local SETCARD_ID_0 = 0x53 --Constellar
local s, id, o = GetID()
function s.initial_effect(c)
	--xyz summon
	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsSetCard, SETCARD_ID_0), 4, 2)
	c:EnableReviveLimit()
	--attack up
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_ATKCHANGE)
	e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
	e1:SetType(EFFECT_TYPE_QUICK_O)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetHintTiming(TIMING_DAMAGE_STEP)
	e1:SetCountLimit(1)
	e1:SetRange(LOCATION_MZONE)
	e1:SetCondition(s.condition)
	e1:SetCost(s.cost)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.condition(e, tp, eg, ep, ev, re, r, rp)
	local phase = Duel.GetCurrentPhase()
	if phase ~= PHASE_DAMAGE or Duel.IsDamageCalculated() then
		return false
	end
	local tc = Duel.GetAttacker()
	if tc:IsControler(1 - tp) then
		tc = Duel.GetAttackTarget()
	end
	e:SetLabelObject(tc)
	return tc and tc:IsFaceup() and tc:IsSetCard(SETCARD_ID_0) and tc:IsRelateToBattle()
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
	e:GetHandler():RemoveOverlayCard(tp, 1, 1, REASON_COST)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	if not tc:IsRelateToBattle() or tc:IsFacedown() then
		return
	end
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
	e1:SetType(EFFECT_TYPE_SINGLE)
	e1:SetCode(EFFECT_UPDATE_ATTACK)
	e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END)
	e1:SetValue(1000)
	tc:RegisterEffect(e1)
end

