Hero you go this is script for Re-Galaxy.Quick play to Equip thing work and all other work excep for the last part where this card can be used as xyz material for XYZ summon so if you can add that effect great.
--Re-Galaxy
function c111013401.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c111013401.target)
e1:SetOperation(c111013401.operation)
c:RegisterEffect(e1)
--Des
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c111013401.ccost)
c:RegisterEffect(e2)
end
function c111013401.spfilter(c,e,tp)
return c:IsSetCard(0x7b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c111013401.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c111013401.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c111013401.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c111013401.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c111013401.eqlimit(e,c)
return e:GetLabelObject()==c
end
function c111013401.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
c:CancelToGrave()
Duel.Equip(tp,c,tc,true)
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c111013401.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_SET_ATTACK_FINAL)
e2:SetValue(tc:GetAttack()/2)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(111013401,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetOperation(c111013401.operation2)
tc:RegisterEffect(e3)
--flag
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(100000214)
tc:RegisterEffect(e4)
end
end
function c111013401.operation2(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp then
e:GetHandler():RegisterFlagEffect(111013401,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c111013401.ccost(e,tp)
if tp~=Duel.GetTurnPlayer() then return end
if e:GetHandler():GetEquipTarget():GetFlagEffect(111013401)==0 then
Duel.Destroy(e:GetHandler():GetEquipTarget(),REASON_EFFECT)
end
end