--Timeglass of Star Regalia function c97569835.initial_effect(c) c:SetUniqueOnField(1,0,97569835) --Activate local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetTarget(c97569835.target) e1:SetOperation(c97569835.operation) c:RegisterEffect(e1) --Atk up local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_EQUIP) e2:SetCode(EFFECT_UPDATE_ATTACK) e2:SetValue(500) c:RegisterEffect(e2) --recover local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(97569835,0)) e3:SetCategory(CATEGORY_RECOVER) e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD) e3:SetCode(EVENT_PHASE+PHASE_END) e3:SetRange(LOCATION_SZONE) e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e3:SetCountLimit(1) e3:SetCondition(c97569835.reccon) e3:SetTarget(c97569835.rectg) e3:SetOperation(c97569835.recop) c:RegisterEffect(e3) --Equip limit local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_SINGLE) e4:SetCode(EFFECT_EQUIP_LIMIT) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e4:SetValue(c97569835.eqlimit) c:RegisterEffect(e4) --tohand local e5=Effect.CreateEffect(c) e5:SetDescription(aux.Stringid(97569835,0)) e5:SetCategory(CATEGORY_TOHAND) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetCode(EVENT_TO_GRAVE) e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetCountLimit(1,97569835) e5:SetCondition(c97569835.thcon) e5:SetCost(c97569835.thcost) e5:SetTarget(c97569835.thtg) e5:SetOperation(c97569835.thop) c:RegisterEffect(e5) --act in hand local e7=Effect.CreateEffect(c) e7:SetCategory(CATEGORY_EQUIP) e7:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O) e7:SetCode(EVENT_FREE_CHAIN) e7:SetProperty(EFFECT_FLAG_CARD_TARGET) e7:SetCondition(c97569835.condition) e7:SetTarget(c97569835.target) e7:SetOperation(c97569835.operation) c:RegisterEffect(e7) end function c97569835.eqlimit(e,c) return c:IsSetCard(0xd0a1) end function c97569835.filter1(c) return c:IsFaceup() and c:IsSetCard(0xd0a1) end function c97569835.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:GetLocation()==LOCATION_MZONE and c97569835.filter1(chkc) end if chk==0 then return Duel.IsExistingTarget(c97569835.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c97569835.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function c97569835.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) and tc:IsFaceup() then Duel.Equip(tp,c,tc) end end function c97569835.reccon(e,tp,eg,ep,ev,re,r,rp) return Duel.GetTurnPlayer()==tp end function c97569835.filter(c) return c:IsFaceup() and c:IsSetCard(0xd0a2) and c:IsType(TYPE_EQUIP) end function c97569835.rectg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local ct=Duel.GetMatchingGroupCount(c97569835.filter,tp,LOCATION_SZONE,LOCATION_SZONE,nil) Duel.SetTargetPlayer(tp) Duel.SetTargetParam(ct*500) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*500) end function c97569835.recop(e,tp,eg,ep,ev,re,r,rp) local ct=Duel.GetMatchingGroupCount(c97569835.filter,tp,LOCATION_SZONE,LOCATION_SZONE,nil) Duel.Recover(tp,ct*500,REASON_EFFECT) end function c97569835.thcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function c97569835.thcost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLPCost(tp,800) end Duel.PayLPCost(tp,800) end function c97569835.thtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) end function c97569835.thop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) then Duel.SendtoHand(c,nil,REASON_EFFECT) end end function c97569835.condition(e,tp,eg,ep,ev,re,r,rp) return Duel.IsPlayerAffectedByEffect(tp,97569819) end